Skip to content

OpenAI Codex is an autonomous coding agent that inspects repositories, edits code, runs commands inside a sandbox, and reviews diffs across CLI, desktop, IDE, and cloud surfaces. For developers and tech leads standardizing Codex, reliable delivery depends on four durable layers: sandbox boundaries, approval policy, concise AGENTS.md instructions, and automated verification gates.

Most teams stall when they treat the model itself as the safety net. Sessions run with overly permissive defaults, AGENTS.md omits real test and lint commands, and engineers end up auditing every changed line manually to catch regressions. This hub maps the mental models, architecture, and verification habits that move a team up the Autonomy Ladder with Codex.

Local Codex surfaces share one configuration directory (CODEX_HOME, default ~/.codex), project AGENTS.md files, Agent Skills, and MCP servers. Codex cloud runs inside hosted containers configured separately per repository.

SurfaceBest fitPrimary trade-off
Interactive CLIPlan mode (/plan), local iteration, worktrees, and live steeringTies work to your machine’s shell and local services
Non-interactive CLI (codex exec)CI checks, scripts, and schema-constrained review passesRuns unattended (never approvals), requiring strict sandboxing
Desktop appParallel local threads, each isolated in its own worktreeLocal compute and environment setup still apply
IDE extensionTargeted edits alongside open files in VS Code-compatible editorsNarrower orchestration scope than multi-worktree or cloud runs
Codex cloudBackground tasks, best-of-N spikes, and @codex review on PRsReads only committed remote state; requires cloud environment setup

For installation steps, authentication options, current CLI flags, and supported models, follow the official OpenAI Codex documentation and our models hub.

Codex divides control across two orthogonal axes in the Software Factory Harness:

  • Sandbox boundaries determine what a command can technically touch (sandbox_mode values read-only, workspace-write, danger-full-access, or named permission profiles).
  • Approval policy determines when Codex asks a human before crossing a boundary (on-request for interactive work, granular for category-level controls, and never for tightly bounded unattended runs). Legacy approval_policy = "untrusted" was retired and breaks startup if left in older configs.

Keep planning and review read-only, run daily implementation inside workspace-scoped writes without network access, and reserve full-access modes for disposable, network-isolated runners.

Prove Codex output without reading every line

Section titled “Prove Codex output without reading every line”

Each verification layer enforces what the layer above asks for:

  1. AGENTS.md declares commands and invariants, while linters, type checkers, and tests enforce them deterministically.
  2. An independent codex review pass inspects the diff before merge against team rules in AGENTS.md.
  3. CI re-runs the full oracle on a clean runner, and a human signs off on the evidence bundle (why evidence beats diffs).

Baseline your repository before scaling Codex across the team by running npx @wondelai/harness-audit (Harness Audit).

  • Project instructions silently fail to load: untrusted repositories suppress both .codex/config.toml and project AGENTS.md. Trust only repositories you control.
  • Retired config keys break scripts: older snippets using approval_policy = "untrusted" or removed convenience flags fail fast; migrate to explicit sandbox profiles and on-request or never.
  • Parallel local sessions collide: Git worktrees isolate files, while ports, local databases, and cloud credentials remain shared unless isolated explicitly.

Did this guide help you?

One tap, no sign-in.

not at all a lot

Primary sources & references