Codex full auto: what replaced --full-auto and which settings to use
Codex full auto used to be the --full-auto flag. The non-interactive docs for codex exec say it is no longer supported and tell you to use --sandbox workspace-write or --approve-for-me. Today you combine a sandbox mode with an approval policy. For low-friction local work the docs give --sandbox workspace-write --ask-for-approval on-request. The flag with no fence and no prompts is --dangerously-bypass-approvals-and-sandbox, alias --yolo, and it belongs in a dedicated sandbox VM.
01What the non-interactive docs say about --full-auto
codex exec is the non-interactive way to run Codex, the one you put in scripts and CI jobs. Its docs now read: "--full-auto is no longer supported". If a script of yours uses the flag with codex exec, change it. Two replacements are named: --sandbox workspace-write, or --approve-for-me, which routes approval requests through automatic review with the workspace-write sandbox.
Older blog posts still show the flag, so check any copied command against the settings below.
One more retired setting: Codex and ChatGPT Work no longer support approval_policy = "untrusted", and the retired setting can prevent either client from starting. If Codex will not start and your config has that line, remove it.
02Two settings decide everything: sandbox and approvals
A sandbox is a fence the operating system puts around a program. An approval policy decides when Codex must stop and ask you. By default Codex runs with network access turned off, inside an OS-enforced sandbox that limits what it can touch (typically the current workspace), with an approval policy on top. On macOS the sandbox works out of the box using the built-in Seatbelt framework, a macOS tool for restricting what a program may touch.
The sandbox modes are read-only, workspace-write and danger-full-access:
- read-only. The agent can inspect files, but it cannot edit files or run commands without approval.
- workspace-write. The agent can read files, edit within the workspace and run routine local commands inside that boundary. It is the default low-friction mode for local work. The network stays off unless you enable it in your configuration.
- danger-full-access. The agent runs without sandbox restrictions, with no filesystem or network boundaries.
Two approval policies matter here. With on-request the agent works inside the sandbox and asks when it needs to go beyond it. With never the agent does not stop for approval prompts.
03The replacement table
| What you want | Setting | What happens |
|---|---|---|
| Fewer prompts, still fenced | --sandbox workspace-write --ask-for-approval on-request | Codex reads, edits and runs commands in the working directory on its own, and asks for edits outside the workspace or commands that need network |
| Unattended read-only job | --sandbox read-only --ask-for-approval never | Codex reads and runs commands in the read-only sandbox and never asks |
| No prompts, any sandbox | --ask-for-approval never or -a never | Prompts off; works with all sandbox modes |
| Approval requests reviewed by a model | --sandbox workspace-write --ask-for-approval on-request -c approvals_reviewer=auto_review | Same sandbox boundary as on-request, but eligible requests go to Auto-review instead of you |
| No fence, no prompts | --dangerously-bypass-approvals-and-sandbox, alias --yolo | Read, edit and run commands with network access and no prompts |
The pair in the first row is the closest thing to Codex full auto today. Copy it like this:
codex --sandbox workspace-write --ask-for-approval on-requestAuto-review has a cost: it uses extra model calls, so it can add to Codex usage. To go back to the cautious end, switch to read-only mode with the /permissions command.
04Check your scripts for the old flag
Scripts are where a removed flag hurts most, because they run without a person watching. Search your repositories and shell aliases for --full-auto next to codex exec. For a job that only reads code, use --sandbox read-only --ask-for-approval never. For a job that must edit files, use --sandbox workspace-write.
05What workspace-write still protects
Inside a writable folder, Codex keeps some paths read-only. The .git path is protected as read-only whether it is a directory or a file, and the .codex directory is read-only when it exists as a directory. Tools that Codex starts, such as git, package managers and test runners, inherit the same sandbox boundaries. Destructive app or MCP tool calls always require approval when the tool advertises a destructive annotation.
There is one gap. An MCP server is a helper program that gives the agent extra tools, and project-defined MCP servers can run commands outside the sandbox. Check which servers a repository wants before you run Codex in it.
06What the bypass flag removes
The --yolo flag turns off both layers. Codex then reads files, makes edits and runs commands with network access and no prompts. Web search also defaults to live results with --yolo or another full access setting.
That matters because of prompt injection, which is when the agent retrieves and follows instructions from untrusted content, for example a web page or a dependency README. With no fence, an injected instruction runs with your user permissions. Point Codex only at trusted resources and keep internet access as limited as possible.
07When the bypass flag is acceptable
Only inside a box you can throw away. The CLI reference says to avoid the bypass flag unless you are inside a dedicated sandbox VM. For danger-full-access, the non-interactive docs say a controlled environment, such as an isolated CI runner or container.
One OpenAI pattern runs Codex with --sandbox danger-full-access inside a Docker container you have configured for isolation. It comes with two warnings: devcontainers provide substantial protection but do not prevent every attack, and the pattern is for trusted repositories only, with Codex activity monitored. Container setup is covered once, on the devcontainer page. The same rule holds across tools: see Claude Code bypass mode and Cursor Run Everything.
08If Codex already ran with no fence
Stop the session first. Then look at what changed in your Git repository. git restore brings paths in the working tree back from a restore source. Think about what the session could read, such as .env files and tokens, and rotate any credential you cannot rule out, from a trusted system, meaning a machine you know is clean.
09A safe way to run Codex on your own Mac
- Install Codex. The CLI is a coding agent from OpenAI that runs locally on your computer. One route on a Mac is Homebrew:
brew install --cask codex. - Start in a project folder, not your home directory.
- Use
--sandbox workspace-write --ask-for-approval on-requestfor daily work. - Commit before long runs, so Git can undo what Codex changes.
- Keep network access and web search off unless the task needs them, and use caution when you turn them on.
- Move to a VM before you use
--yolo.
More on the fence itself: Codex sandbox. A wider view: is Codex safe.
10Which Codex full auto setup to pick
Use the workspace-write and on-request pair. It gives most of the speed people wanted from Codex full auto, and the sandbox stays on. Add -a never only with a read-only or workspace-write sandbox, and use --yolo only in a disposable VM. Related reading: AI agent permissions and Claude Code permissions.
Whatever setting you choose, it helps to know what actually ran on the Mac. Artificial Immunity's free, open-source core watches Codex, Claude Code, Cursor, MCP servers and every program start, and reports what it finds without blocking anything.
FAQ
How to run Codex in full auto mode?
For codex exec, use --sandbox workspace-write, because the non-interactive docs say --full-auto is no longer supported there. The same docs offer --approve-for-me, which sends approval requests to automatic review with the workspace-write sandbox.
Does Codex have something like auto mode?
Yes, in two forms. The Auto preset lets Codex read files, edit and run commands in the working directory automatically. Auto-review goes further: eligible approval requests are reviewed by Auto-review instead of surfacing to you.
Does Codex have an auto model?
The closest thing is Auto-review, where model calls review eligible approval requests. Those calls can add to your Codex usage.
How to turn on auto accept in Codex?
Pass --ask-for-approval never or -a never. That disables approval prompts and works with all --sandbox modes, so you still control how much the agent can touch.
What does --yolo do in Codex?
It is an alias of --dangerously-bypass-approvals-and-sandbox. It lets Codex read files, edit and run commands with network access and no approval prompts. The CLI reference says to avoid it unless you are inside a dedicated sandbox VM.
Is Codex full auto safe on a Mac?
It is safer with the sandbox on. On macOS the sandbox works out of the box using the built-in Seatbelt framework. The --yolo flag removes that fence.