Codex full-access mode
Run Codex without permission prompts with codex --dangerously-bypass-approvals-and-sandbox. What it changes, what it still blocks, and the machines where it is safe.
Updated November 23, 2026 · Checked against Codex 0.157.1 in EnvHaven v1.9.0
In EnvHaven: The image writes both settings into ~/.codex/config.toml, so codex starts without approvals. Each workspace is its own Linux machine, so full access stays contained there. On any other machine, here is the switch, what it changes and where it is safe.
The switch
For one session:
codex --dangerously-bypass-approvals-and-sandbox
As the default, in ~/.codex/config.toml:
approval_policy = "never"
sandbox_mode = "danger-full-access"
What it does
The flag turns off approvals and the sandbox together; its help calls it “EXTREMELY DANGEROUS” and meant for environments that are already sandboxed, and OpenAI’s docs recommend full access inside Docker for that reason. Quote the values in config.toml: an unquoted never fails with “Error loading config.toml”. Administrators can forbid both values through requirements.toml.
Milder settings
-a/--ask-for-approval sets the approval policy and -s/--sandbox the sandbox (read-only, workspace-write, danger-full-access); /permissions changes both inside a session. --approve-for-me routes approval requests through automatic review inside the workspace-write sandbox.
Where full access is safe
- On your everyday computer: rarely. An agent with full access can delete files, read credentials and run anything a mistyped instruction or a malicious README suggests.
- In a container or VM that holds nothing you would miss: yes. A mistake costs a rebuild.
- In an EnvHaven workspace: by default. The image writes both settings into
~/.codex/config.toml, socodexstarts without approvals. The workspace is a separate Linux machine, so the worst case stays there.
Turning prompts back on
Leave out the flag, or reset the setting you changed. In a workspace, the setting EnvHaven applies is described above, and editing or removing it brings Codex’s own defaults back.
How this was checked
From the help text of Codex 0.157.1, as shipped in EnvHaven v1.9.0:
--dangerously-bypass-approvals-and-sandbox