# codex · Confinement

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [codex](https://ai-agents-review.com/runtime/codex.md)
- Column: [Confinement](https://ai-agents-review.com/column/confinement.md) (Execution controls)
- Mark: 3 s
- Default deployment: 3
- Best supported configuration: 3
- Page: https://ai-agents-review.com/cell/codex/confinement

## Rationale

Default-on bwrap/seccomp/Seatbelt for shell and apply-patch, network denied; L4 unmet: MCP stdio servers unsandboxed

## Rubric criteria for this column

- 0: No restriction: tools run as the user with no approval or policy by default
- 1: Policy or approval layer only (allowlists, approval prompts, reviewer model). No OS boundary
- 2: An OS/container boundary exists but is opt-in, **or** is default-on only for a subset of effect paths, leaving the main shell/file tools unconfined
- 3: Default-on OS-enforced boundary for the main shell and file effects (filesystem writes restricted)
- 4: Level 3, plus network restricted by default **and** children and auxiliary processes (MCP stdio, hooks, cron) confined at least as tightly

## Review finding

Built in, on by default for shell, unified-exec and apply-patch: Seatbelt (macOS); bwrap + seccomp + no_new_privs (Linux); restricted token (Windows, only when enabled). Default `read-only` mode can still read the whole filesystem. Trusted projects get `workspace-write`. Network is denied inside the sandbox. MCP stdio servers run unsandboxed. An approval can lift a sandbox denial. [X1][X2][X3][X4][X5][X6] Note X-1

## Evidence cited by the mark

- [X1] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/protocol/src/config_types.rs#L116-L126 — `SandboxMode` default `ReadOnly` — [S]
- [X4] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/linux-sandbox/src/seccomp.rs#L238-L277 — restricted mode denies connect/bind/io_uring; only AF_UNIX sockets — [S]
- [X5] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/rmcp-client/src/stdio_server_launcher.rs#L943 — MCP stdio servers launched with `sandbox: None` — [S]

## Evidence also cited by the review finding

- [X2] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/config/src/config_toml.rs#L904-L920 — trusted/untrusted project resolves to `WorkspaceWrite` when no mode set — [S]
- [X3] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/protocol/src/permissions.rs#L610-L617 — read-only profile grants read on filesystem root — [S]
- [X6] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/core/src/tools/orchestrator.rs#L402-L435 — retry without sandbox after denial only if escalation and approval policy permit — [S]

## Grading record

- Grader A (default / best): 3 / 3
- Grader B (default / best): 3 / 3
