Skip to content

Glossary

Codex sandbox modes

Last updated

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.

ModeFile writesNetwork
read-onlynoneoff
workspace-write (usual default)inside the workspace only; .git, .agents and .codex stay read-onlyoff unless you enable it
danger-full-accessanywhereon

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-write with the on-request approval policy; in other folders, read-only.
Does workspace-write allow internet access?
Not by default. Network access is off in workspace-write unless 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-write for that.