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

bash
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 withWhat Guardrail does
An OpenAI API keyProxies the request, meters it in full, and enforces your policies before the call is sent.
A ChatGPT subscriptionThat 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

bash
guardrail status
guardrail doctor

Run a Codex prompt and confirm a session shows up in the dashboard with codex as its tool.

Disconnect

bash
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.