Codex CLI Integration¶
Preloop governs OpenAI's Codex CLI through the same managed onboarding flow as other local agents:
preloop agents discover
preloop agents onboard "codex cli" # MCP firewall + model gateway
preloop agents onboard "codex cli" --approvals # also route would-prompt tool calls to Preloop approvals
Onboarding backs up and rewrites Codex's configuration at ~/.codex/config.toml (primary; ~/.codex/config.json is only a legacy fallback), adding a managed [mcp_servers.preloop] entry that points at the Preloop MCP Firewall. The optional --approvals flag installs a PermissionRequest hook in ~/.codex/hooks.json so tool calls Codex would prompt you for become Preloop approval requests you can answer from mobile, watch, or the web console.
Verify, roll back, or remove the enrollment with:
preloop agents status "codex cli"
preloop agents validate "codex cli"
preloop agents restore "codex cli"
preloop agents offboard "codex cli"
For the full flow and command reference, see:
- CLI quickstart — install the Preloop CLI and onboard local agents
- Safety Layer & Access Rules — how rules are evaluated
- Claude Code Integration — the equivalent flow for Claude Code