AI

Codex CLI approval modes and safety (2025)

Understand Codex CLI approval modes — Auto, Read Only, Full Access — and when to use each. Learn config tips, sandbox practices, and real workflow examples.

Vladimir Siedykh

Codex CLI approval modes and safety

Codex CLI is more than a wrapper around GPT—it’s a developer agent that can read files, propose diffs, run commands, and even connect to the network. That power makes approval modes critical. They decide how much control Codex has inside your repo.

In this guide, we’ll break down the three modes, show you how to configure them, and share best practices for safe daily use.


Why approval modes exist

Unlike a chat window, Codex works directly in your environment. Without guardrails, it could:

  • Modify files you didn’t intend.
  • Run commands with side effects.
  • Access the network or external APIs.

Approval modes put consent checkpoints in place. You decide how much autonomy Codex has, balancing productivity with security.


The three approval modes

1. Auto (default)

  • What it does:
    • Can read and edit local files in your repo.
    • Can run local commands (like npm test).
    • Prompts before touching the network or external resources.
  • Best for: everyday development. It’s fast but still asks before stepping outside your repo.

2. Read Only

  • What it does:
    • Codex can analyze code, generate plans, and discuss ideas.
    • It cannot edit files or run commands.
  • Best for: design sessions, code reviews, or when you want Codex as an advisor without risk.

3. Full Access

  • What it does:
    • Removes most prompts.
    • Codex edits, runs commands, and makes network calls freely.
  • Best for: disposable sandboxes, experiments, or throwaway branches.
  • Warning: not recommended for production repos.

Switching modes inside the CLI

Change approval levels on the fly with the /approvals command:

/approvals auto
/approvals readonly
/approvals full

You’ll see confirmation in the terminal showing the active mode.


Persistent configuration

Codex stores settings in a config file:

~/.codex/config.toml

You can:

  • Set a default approval mode.
  • Apply project-specific overrides.
  • Audit and reset configs if behavior feels off.

Pro tip: check this file into onboarding docs so your team shares the same defaults.


Sandbox practices

  • Use Auto by default. It balances speed and safety.
  • Switch to Read Only when planning or running design reviews.
  • Restrict Full Access to Docker containers, throwaway VMs, or experimental branches.

Think of Full Access like sudo—powerful, but only safe in the right context.


Workflow examples

Bug triage

  1. Start in Read Only.
  2. Ask Codex to analyze failing tests.
  3. Switch to Auto for a proposed fix.
  4. Run your test suite.
  5. Approve if green.

CI script fix

codex exec "fix the failing build step in .github/workflows/ci.yml"

Runs in Auto mode by default, applying minimal safe changes.

Experiment in sandbox

  1. Create a new branch.
  2. Switch approval mode to Full Access.
  3. Let Codex explore broader changes.
  4. Merge nothing without review.

Troubleshooting approval issues

  • Prompts keep resetting: check ~/.codex/config.toml for default mode conflicts.
  • Codex asks too often: switch from Read Only to Auto.
  • Unwanted edits: tighten back to Read Only and review diffs manually.

Security best practices

  • Treat approval prompts as a second layer of code review.
  • Never use Full Access on repos with production credentials.
  • Use environment variables instead of pasting secrets.
  • Audit config regularly like you would .gitignore or CI scripts.

How this connects to the bigger picture

Approval modes are the safety valves in the Codex workflow. Pair them with:

Together, these articles give you both the why and the how of safe AI-assisted development.


Conclusion

Codex CLI is powerful enough to change how teams work—but only if you manage permissions wisely. Approval modes let you:

  • Move fast with Auto
  • Stay safe with Read Only
  • Explore freely with Full Access

Set defaults that match your workflow, sandbox when needed, and always review diffs. With that discipline, Codex becomes a reliable teammate instead of a risky experiment.

Codex CLI approvals — developer FAQs

Auto. It allows local edits with approval prompts before external calls.

For planning sessions where you don’t want Codex to touch files at all.

Only in controlled sandboxes. It removes approval prompts for edits and network requests.

In the config file at ~/.codex/config.toml, which can be customized per project.

Yes. Use the /approvals command in the CLI to switch modes instantly.

Stay ahead with expert insights

Get practical tips on web design, business growth, SEO strategies, and development best practices delivered to your inbox.