Add policy enforcement to Codex in one line.
Config file: ~/.codex/config.toml (global) or .codex/config.toml (project)
Codex uses TOML format, not JSON. Each server is a [mcp_servers.name] table.
A standard MCP server in your Codex config -- no controls.
[mcp_servers.stripe] command = "npx" args = ["-y", "@stripe/mcp-server"] [mcp_servers.stripe.env] STRIPE_SECRET_KEY = "sk_live_..."
Wrap the server command with Intercept. Same config structure, policy enforced.
[mcp_servers.stripe] command = "npx" args = ["-y", "@policylayer/intercept", "-c", "policy.yaml", "--", "npx", "-y", "@stripe/mcp-server"] [mcp_servers.stripe.env] STRIPE_SECRET_KEY = "sk_live_..."
version: "1"
default: deny
tools:
list_customers:
rules:
- action: allow
rate_limit: 30/minute
create_refund:
rules:
- name: "daily cap"
rate_limit: 10/day
delete_repository:
rules:
- action: deny