Codex CLI Auto Mode: Set Approvals and Task Boundaries

Codex CLI approval policies control how much the agent does without pausing for your review. This guide covers the available approval controls, how to set the right level for each task, and how to keep explicit task limits in a record every session can read.

Updated 6 min read

Codex CLI approval policies determine how much the agent does before pausing to ask for your review. At one end, the agent proposes every change and waits for your approval. At the other, it works through the task autonomously from start to finish. The right level depends on how well-defined the task is and how much you trust the scope you have set.

Keeping explicit task limits in a shared record, rather than restating them each session, means the boundaries stay consistent. A tool like fenbs stores those limits as Decisions and rules that every connected session reads before it starts work.

The available approval policies

Codex CLI offers three approval policies, set with the --approval-policy flag. Check the OpenAI Codex documentation (opens in a new tab) to confirm the current names; these have evolved between CLI versions and the exact flag values may differ from what you have seen in older guides.

  • suggest: the default. The agent proposes changes and waits for your approval at each step. No file is written and no command is run without your explicit confirmation.
  • auto-edit: file writes are approved automatically; shell commands still pause for review. Use this when you trust the agent's file changes but want to confirm anything it runs.
  • full-auto: the agent works autonomously through the task. No approvals are requested. Best for well-scoped, reversible tasks in a sandbox or on a branch you can discard.

Pass the policy at the command line:

Set an approval policy
codex --approval-policy full-auto "Rename all instances of getUser to fetchUser in src/"

Choose the right level for the task

Suggest mode is the right starting point for a new kind of task. You see each proposed change and can stop the session if it goes in the wrong direction. The overhead is real, but so is the ability to catch a misunderstanding before it propagates through ten files.

Auto-edit mode suits tasks where the pattern is clear and you have already verified it in a suggest session. The agent writes files without asking, but shell commands still get a confirmation step. For a task like updating import paths across a codebase, auto-edit gives speed without removing the checkpoint on any commands.

Full-auto mode is for tasks with a clear goal, explicit scope, and a restore point. Always run full-auto tasks on a branch or with a Git checkpoint. The codex cli undo guide covers how to recover if the session produces unexpected changes.

Set a default policy in your config

You can set a default approval policy in your Codex CLI configuration file so you do not have to pass the flag each time:

Set a default in .codex/config.json
{
  "approvalPolicy": "auto-edit"
}

A flag passed at the command line overrides the config file. Set the config default to the level you use most often, and override it for specific tasks.

Define task boundaries before enabling automation

A higher approval level is only safe if the task boundaries are defined precisely. What files may the agent change? What commands may it run? What does done look like? These questions must be answered before you remove the approval step that would catch a wrong answer.

Write the answers down before you start. For standing rules that apply across many sessions, put them in a shared Decisions and rules record. For task-specific limits, include them in the task description or plan. A connected assistant reads both before it starts.

The codex cli best practices guide covers a full framework for setting task scope before an automated run.

Automation and reversibility

The useful question is not "how autonomous can the agent be?" but "how easily can I undo this?" A rename across fifty files is easy to undo with git revert. A form submission is not. Match the approval policy to the reversibility of the actions, not to how confident you feel about the task.

For tasks that involve irreversible actions, stick with suggest mode regardless of how clear the goal seems. Adding a confirm step for actions that cannot be undone costs a few seconds and has prevented many mistakes.

Record decisions about automation level

If you have decided that a specific type of task is safe to run at full-auto, record that decision. The next session does not have to re-evaluate the reasoning, and a new team member can see the rationale instead of guessing.

If you later discover a reason to change the level, update the decision and record why. A history of what was decided and what changed it is more useful than a current policy with no context.

How fenbs helps

Record task limits where every session reads them

Add automation level decisions to fenbs as Decisions and rules: "Rename-only tasks use auto-edit; tasks involving shell commands use suggest until reviewed." Every connected session reads the rules before it starts, so the right boundaries apply without having to remember to set them. Create a free account and add your project.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

How to do this with fenbs

  1. Create a free account and add your project. Record task categories and their approved approval levels as Decisions and rules.
  2. Connect Codex CLI to fenbs from Integrations. At the start of each session, ask it to read the project rules, which include any standing automation policies.
  3. For a new type of task, run it in suggest mode first. After reviewing the result, decide whether auto-edit or full-auto is appropriate and record that decision.
  4. Pass --approval-policy at the command line for the current session, or set a default in .codex/config.json for tasks you run frequently.
  5. After any full-auto session, review the diff before committing and update the task record with what was done and confirmed.

For tasks where you want to review the plan before any action is taken, see codex cli plan mode, which shows the agent's planned steps before it executes them.

Questions people ask.

What is full-auto mode in Codex CLI?

Full-auto is an approval policy where the agent works through the task without pausing for your confirmation. File writes and shell commands both proceed automatically. Use it for well-scoped, reversible tasks on a branch you can recover from, always with a Git checkpoint in place.

How do I enable auto mode in Codex CLI?

Pass --approval-policy full-auto when you run the CLI. To set it as a default, add an approvalPolicy field set to full-auto in your .codex/config.json file. A command-line flag overrides the config default.

What is the difference between auto-edit and full-auto?

Auto-edit approves file writes automatically but still pauses for confirmation before running shell commands. Full-auto approves both. Auto-edit is a useful middle ground: the agent writes files freely, but you keep a checkpoint on commands that can affect systems outside the repository.

How do I keep the right approval level across sessions?

Record the approved level for each task type as a decision in a shared record. A connected assistant reads that record before starting, so the right policy is applied consistently even when you do not set the flag explicitly. Update the record if experience shows a task needs a different level.

More in Agent harness (for developers)

All Agent harness (for developers) articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.