Definition
Codex sandbox modes are the settings that limit what the commands Codex runs can read, write and reach on your machine: `read-only`, `workspace-write` or `danger-full-access`.
Also called: Codex sandbox, sandbox_mode, workspace-write, full access.
| Mode | File writes | Network |
|---|---|---|
read-only | none | off |
workspace-write (usual default) | inside the workspace only; .git, .agents and .codex stay read-only | off unless you enable it |
danger-full-access | anywhere | on |
Set it with --sandbox (-s), e.g. codex exec -s read-only "Explain the auth flow", or in config.toml. The sandbox works with a separate approval policy that decides when Codex stops to ask: on-request asks before going beyond the sandbox, never doesn't ask, and granular asks only for chosen categories. By default Codex suggests workspace-write with on-request in a version-controlled folder and read-only with on-request elsewhere.
The difference from Claude Code's permission modes: Codex limits what a command can do once it runs, while Claude's modes decide which tool calls need your approval. Codex has no mode that runs commands but blocks edits.
In Pairbar
For Codex chats the composer shows a sandbox chip where Claude has a Mode chip, and “full access” is never remembered for the next chat. Workflow steps map Pairbar's levels onto the sandbox: Read-only runs with -s read-only, and both Can run commands and Can edit files run with -s workspace-write, so only the prompt keeps a “commands” step from editing. The planner, goal check and doctor always use the read-only sandbox. See Permissions.
Frequently asked questions
- What is Codex's default sandbox?
- In a version-controlled folder Codex suggests
workspace-writewith theon-requestapproval policy; in other folders,read-only. - Does workspace-write allow internet access?
- Not by default. Network access is off in
workspace-writeunless you turn it on. - Why can a read-only Codex step fail to run tests?
- Tests and builds usually write files such as caches or output, which the read-only sandbox blocks. Pairbar's Can run commands level uses
workspace-writefor that.
Related
- GlossaryPermission modeThe Claude Code setting that decides which actions Claude may take in a session without asking you first.
- GuideChoose the right permission level for each workflow stepThe three step permission levels, the exact Claude Code flags and Codex sandboxes they map to, their caveats and when to use each.
- GlossaryHeadless modeRunning Claude Code (`claude -p`) or Codex (`codex exec`) from a command or script, with no interactive interface.
- DocsWorkflowsScheduled prompts, check-ins on a chat, run history, limits