Skip to Content
Agent ClientsCoding agents

Connect OpenAI Codex CLI to Agent Authority

Add SecureAuth Agent Authority as an MCP server in OpenAI's Codex CLI so every tool call is checked and audited

When you finish, every MCP tool call Codex CLI makes is checked against your policies and recorded in the audit log. OpenAI's Codex CLI reaches your approved tools through one SecureAuth Agent Authority gateway URL, and each developer signs in as themselves.

Setup

  1. Add the MCP server. Add the following to ~/.codex/config.toml:

    [mcp_servers.secureauth]
    url = "https://your-gateway-url/gateway/mcp"
  2. Authenticate.

    codex mcp login secureauth
  3. Start Codex.

    codex

    The agent is auto-registered on first connect.

Connecting to just one MCP? To stay under an agent's tool limit, point the URL at a single MCP — /gateway/mcp/{slug} instead of /gateway/mcp. Grab the exact URL from the resource's detail page; see Scope a connection.

Send model calls through the AI gateway

The steps above put Codex's MCP tool calls through the gateway. To put its model calls through the AI gateway too, where model access rules decide each one, follow Connect Claude Code and Codex. It covers the agent token, the [model_providers.secureauth] entry in config.toml, and keeping a ChatGPT sign-in instead of an API key.

Next steps

On this page