Codex auto mode: how approval policies and the sandbox work
Short answerHow to make OpenAI Codex ask for approval less: the approval policy, sandbox modes and auto-review explained, with safe settings for everyday work.
Codex does not have a single "auto mode" switch. How often it asks you depends on two settings that work together: the sandbox (what Codex is allowed to touch) and the approval policy (when it stops to ask). This page explains both, as of November 2026. Codex changes often, so check codex --help and the official Codex documentation for the exact names in your version.
The two settings
| Setting | Controls | Common values |
|---|---|---|
| Sandbox (`--sandbox`) | Which files and network Codex can use | `read-only`, `workspace-write`, `danger-full-access` |
| Approval policy (`--ask-for-approval`) | When Codex stops and asks you | `on-request`, `never` (and others, depending on version) |
You can set both on the command line or in ~/.codex/config.toml with sandbox_mode and approval_policy, so they apply every time.
Three setups, from careful to hands-off
- Everyday:
workspace-writewithon-request. Codex can edit your project, and asks before anything outside it. This is the usual choice. - Fewer prompts: keep
workspace-writeand turn on auto-review, which hands approval requests to a reviewer agent instead of you. It does not widen what Codex is allowed to touch. - No prompts:
never. Codex runs everything without asking. Keep this for a throwaway container or a project you can restore from git.
Staying safe while asking less
For more, see the AI coding agent safety checklist. If you run Codex all day, also see when Codex usage limits reset.
- Keep the sandbox on
workspace-writeso Codex stays inside your project. - Commit before a long task, so you can undo anything.
- Use
danger-full-accessonly when you understand why you need it.
Answer Codex approvals from anywhere
The other way to ask less is to make each answer faster. Herdbell shows Codex approval requests as a card at your cursor in any app: press Return to allow or D to deny, and you can tap Codex's multiple-choice answers there too. See Codex notifications when a task finishes.
Common questions
How do I enable auto mode in Codex?
There is no single switch. Use workspace-write with on-request for everyday work, add auto-review for fewer prompts, or set the approval policy to never only in a throwaway environment.
Is --full-auto still available in Codex?
Older versions used --full-auto as a shortcut for workspace-write plus on-request. Newer versions may not accept it, so check codex --help.
Where do I set the Codex approval policy permanently?
In ~/.codex/config.toml, with approval_policy and sandbox_mode.
Is approval policy never safe?
Only somewhere you can throw away or restore, because Codex runs every command without asking.