Frequently Asked Question

Which sandbox and approval mode should I use with Codex?

Codex separates two questions that are easy to conflate. approval_policy decides whether you are asked before a command runs; sandbox_mode decides what that command can reach once it does.

For ordinary development, sandbox_mode = "workspace-write" with approval_policy = "on-request" is the sensible combination. The agent can edit the project it is working on, cannot touch anything else, and pauses to ask when it judges something consequential.

Use read-only when you want analysis without changes, such as reviewing unfamiliar code. Reserve danger-full-access for a container or VM you are prepared to lose; the name is a deliberate discouragement.

Settings live in ~/.codex/config.toml in TOML format, with a precedence chain running from CLI flags down through project and user files to /etc/codex/config.toml, which is where an administrator would set policy on a shared machine.