Codex config.toml: How sandbox_mode and approval_policy Control Agent Permissions
OpenAI's Codex relies on two settings that work together: a sandbox that limits what generated commands can technically do, and an approval policy that determines when the agent must pause and ask for permission. In the CLI and IDE extension, the sandbox is enforced by operating-system mechanisms and by default blocks network access and confines writes to the active workspace. The sandbox_mode option offers read-only, workspace-write, and danger-full-access levels, with danger-full-access described as a last resort. The approval_policy setting, including on-request, never, and granular variants, governs when prompts appear, and the untrusted value is no longer supported and should be removed from configs. The guide recommends sandbox_mode set to read-only with approval_policy set to on-request for a cautious interactive setup.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in