What does Codex --full-auto actually do? Approvals and sandbox explained

Codex Published: Updated:

--full-auto is shorthand for on-request approvals plus a workspace-write sandbox, and it is now deprecated. What runs unattended, what stays blocked, and what to use instead.

Verified on Sep 18, 2026 These tools change quickly. Please also check the latest official documentation.
Contents
  1. What it maps to
  2. What runs and what stops
  3. Pinning it in config.toml
  4. Where it fits
  5. Switching mid-session
  6. Summary

codex --full-auto reads like "do everything automatically", but what it actually grants is freedom inside the workspace. Writing outside the workspace and reaching the network remain restricted by the sandbox.

One thing to know up front: the documentation now marks --full-auto as deprecated and points to codex exec --sandbox workspace-write instead. The flag still works, and knowing what it maps to is what lets you replace it.

KEY POINT

What you will learn

  • The exact approval policy and sandbox mode --full-auto is shorthand for
  • What runs unattended and what stays restricted
  • How to pin the same behavior in config.toml, and what to use now

What it maps to

--full-auto is shorthand for two settings:

approval_policy = "on-request"
sandbox_mode = "workspace-write"
SettingValueMeaning
Sandboxworkspace-writeRead files, edit within the workspace, run routine local commands inside that boundary. Network access disabled by default
Approval policyon-requestThe default: approval is required for sandbox escalations and network access

The other sandbox modes are read-only, where Codex can read files and run commands inside a read-only sandbox, and danger-full-access, which removes all sandbox restrictions and approval requirements and is not recommended for untrusted code.

Approval policies are on-failure (approval only when operations fail), on-request (the default), and never (no approval prompts). The older untrusted value has been retired and now causes startup failures.

用語解説

Sandbox versus approvals: approvals decide whether Codex asks you before running something; the sandbox decides what an action can reach once it runs. --full-auto reduces how often you are asked, but the sandbox still sets the boundary. See Codex CLI approval modes versus sandbox modes.

What runs and what stops

OperationUnder --full-auto
Reading and editing files in the workspaceRuns
Running commands in the workspace (tests, builds)Runs
Writing outside the workspace (~/.ssh, for example)Sandbox refuses
Network access (npm install, curl)Disabled by default; escalation requires approval
Git commits (inside the workspace)Runs
git pushNeeds the network, so it triggers an approval request

When npm install fails for lack of network, approving the escalation lets it retry outside the sandbox. If answering that every time gets tedious, allow network access in config instead.

Pinning it in config.toml

approval_policy = "on-request"
sandbox_mode = "workspace-write"

[sandbox_workspace_write]
network_access = true

This gives the same behavior without the flag, with network access enabled. Enabling the network also makes outbound data transfer possible, so keep it to repositories you trust.

Where it fits

SituationVerdict
Refactoring a repository with a solid test suiteGood fit; it can iterate until tests pass
Bulk-fixing lint errorsGood fit
Exploring an unfamiliar codebase--sandbox read-only is safer
An environment holding production credentialsAvoid; the sandbox does not restrict reads
Fully automated CI runsConsider -a never in a disposable environment

Reads are not restricted

workspace-write restricts writes, but reading files inside the workspace is unrestricted. Keep .env and other secrets outside the workspace. See Stop AI coding tools from reading your API keys and secrets.

Switching mid-session

Running /approvals during a session manages approval settings interactively, so you can adjust the policy without restarting Codex. It suits starting in a read-only investigation and moving to implementation partway through.

For the config file layout in general, see The Codex config.toml file.

Summary

  • --full-auto is shorthand for approval_policy = "on-request" and sandbox_mode = "workspace-write"
  • The documentation marks it deprecated and points to codex exec --sandbox workspace-write
  • Network access is off by default under workspace-write; enable it with network_access = true
  • The sandbox does not restrict reads, so secrets belong outside the workspace
  • Use read-only for investigation, and --full-auto semantics for repositories with tests you trust

FAQ

Does --full-auto mean everything is automatic?
No. It makes reads and edits inside the workspace automatic, while writes outside the workspace and network access stay restricted by the sandbox.
Is --full-auto still the recommended flag?
No. The documentation marks it as deprecated and points to codex exec --sandbox workspace-write instead. The flag still works and is equivalent to approval_policy on-request plus sandbox_mode workspace-write.
How is it different from --dangerously-bypass-approvals-and-sandbox?
That flag, aliased --yolo, removes all sandbox enforcement and approval requirements. --full-auto keeps the sandbox on, so the blast radius stays bounded.

Primary sources

This article was drafted by AI from official documentation and reviewed by the site operator before publishing. Found a mistake? Let us know via the contact page.