Connect Codex
Codex is connected as a custom model provider. How much Guardrail can do depends on how Codex is signed in, and it detects that per request.
Connect
guardrail connect codex
This adds a model provider pointing at http://localhost:4000/openai/v1 to your ~/.codex/config.toml, preserving the file’s permissions and leaving your other settings untouched. Restart Codex afterwards.
Two login modes
| Signed in with | What Guardrail does |
|---|---|
| An OpenAI API key | Proxies the request, meters it in full, and enforces your policies before the call is sent. |
| A ChatGPT subscription | That traffic goes to the ChatGPT backend and cannot be proxied, so Guardrail records the usage telemetry Codex emits instead. You get visibility, not enforcement. |
Nothing needs configuring for this: the mode is detected from the credentials on each request.
Check it worked
guardrail status guardrail doctor
Run a Codex prompt and confirm a session shows up in the dashboard with codex as its tool.
Disconnect
guardrail disconnect codex
Cursor is coming. Cursor routes model calls through its own cloud, so it is metered differently from the tools above: support is in progress through Cursor Hooks, which give per-session activity metering and enforcement. See the supported tools for what ships today.