skip to content

In Gemini CLI 0.62.0, what does each --approval-mode value - default, auto_edit, yolo and plan - let the agent do without asking?

level: juniorimportance: should knowfreq 10%

answer

  1. four modes, one per session
  2. reads free, edits and shell ask
  3. auto_edit still asks before shell
  4. yolo only from the command line
  5. plan writes nothing but its plan

basics

~10 s

Gemini CLI's default mode runs reads and searches but asks before edits and shell commands; auto_edit also approves file edits; yolo approves tool calls wholesale; plan is read-only apart from writing its Markdown plan.

solid answer

~40 s

`--approval-mode` picks which built-in policy rules Gemini CLI applies to tool calls. In `default`, read-only tools such as `read_file`, `glob` and `grep_search` run, while `write_file`, `replace`, `run_shell_command` and `web_fetch` ask. `auto_edit` also auto-approves `write_file`, `replace` (behind a path check) and `web_fetch`, but shell commands still ask. `yolo` approves every tool call that no user or admin policy rule denies. `plan` is read-only: the agent researches and may only write Markdown plan files into its plans directory, and `/plan` enters it. Shift+Tab cycles default, auto_edit and plan; yolo comes from `--approval-mode=yolo` (the CLI reference marks `--yolo` deprecated) or Ctrl+Y, and `general.defaultApprovalMode` cannot be set to yolo. In an untrusted folder the mode is forced back to `default`.

go deeper

for a junior

Recall the four values and the one-line rule for each: default asks before edits and commands, auto_edit approves edits, yolo approves nearly everything, plan only reads.

for a middle

Explain that the modes select policy-engine rules, that auto_edit still asks before shell commands, and why yolo cannot be a settings default.

for a senior

Show the judgment calls: plan for unfamiliar code, auto_edit for reviewed refactors, yolo only with -s, and why an untrusted folder silently drops you back to default.

for a principal

Weigh session-wide modes against fine-grained policy rules for a team, and when to forbid yolo outright with security.disableYoloMode.

## What an approval mode decides Every tool call Gemini CLI's agent wants to make - reading a file, editing one, running a shell command, calling an MCP server - goes through its **policy engine**, which returns one of three decisions: `allow`, `deny` or `ask_user`. The **approval mode** selects which of the built-in rules are active for the session. It answers "may the agent do this without asking me?"; it does not decide *where* commands run, which is the separate sandbox switch `-s` / `--sandbox`. ## The four values at 0.62.0 | Mode | Runs without asking | Asks or is blocked | How you enter it | |---|---|---|---| | `default` | Read and search tools: `read_file`, `glob`, `grep_search`, `list_directory`, `google_web_search` | `write_file`, `replace`, `run_shell_command` and `web_fetch` ask; MCP tools ask unless that server has `trust: true` | The starting mode; Shift+Tab | | `auto_edit` | Everything above plus `write_file`, `replace` (behind an allowed-path check) and `web_fetch` | `run_shell_command` still asks | `--approval-mode=auto_edit`; Shift+Tab | | `yolo` | Every tool call no higher-priority policy rule denies | Questions from `ask_user` are still shown; the plan tools are denied | `--approval-mode=yolo`, or Ctrl+Y in a session | | `plan` | Read-only tools | Edits, shell commands and scripts are denied, except Markdown plan files in the plans directory | `--approval-mode=plan`, `/plan`, Shift+Tab | A few details matter in practice: - **Plan mode** writes its plan to `~/.gemini/tmp/<project>/<session-id>/plans/` by default, and leaving it goes through `exit_plan_mode`, which presents the plan and asks you to approve it before implementation starts. `/plan implement authentication` switches to plan mode with a goal; `general.plan.directory` moves the plans into the project, but a custom directory needs a policy rule that allows writing there; and `general.plan.enabled` (default `true`) can switch the mode off, in which case a request for `plan` falls back to `default`. - **Read-only MCP tools** still ask in plan mode by default; a policy rule can approve them. - **Shift+Tab** cycles `default` -> `auto_edit` -> `plan` (plan is skipped while the agent is busy). It never lands on yolo; **Ctrl+Y** toggles yolo. - `--yolo` / `-y` still parses, but the CLI reference marks it **deprecated** in favour of `--approval-mode=yolo`, and passing both is rejected with "Use --approval-mode=yolo instead." ## Where the default comes from The setting `general.defaultApprovalMode` sets the starting mode, but its schema accepts only `default`, `auto_edit` and `plan`. A `"yolo"` written there is reported as an invalid setting and ignored, so the session starts in `default`: yolo can only be switched on deliberately, from the command line or the keyboard. Administrators can go further with `security.disableYoloMode`, which turns a yolo request into a startup error. Two things override whatever you ask for: 1. **An untrusted folder.** When folder trust says the workspace is not trusted, the CLI logs that the approval mode was overridden and runs in `default`, even if you passed `--approval-mode=yolo`. 2. **Headless runs.** With `-p` nobody can answer a prompt, so calls that would ask are denied instead; the mode then decides which calls are allowed outright. ## Approval is not isolation An approved shell command runs with your user's permissions unless you also start the CLI with `-s` (or `GEMINI_SANDBOX`), which uses Seatbelt (`sandbox-exec`) on macOS or a Docker or Podman container. The configuration reference says yolo turns the sandbox on by default, but the 0.62.0 configuration loader chooses the sandbox only from `-s`, `GEMINI_SANDBOX` and `tools.sandbox`, so pass `-s` yourself when you run yolo rather than rely on it. ## Picking one - Exploring an unfamiliar codebase or designing a change: `plan`. - Day-to-day work where you want to review each command: `default`. - A refactor you will review as a diff afterwards: `auto_edit`, which still stops at each shell command. - Throwaway environments only: `yolo`, together with `-s`. Finer control than four modes - always allow `npm test`, always deny `rm -rf` - belongs in policy rules (`~/.gemini/policies/*.toml`), which the CLI reference recommends over the deprecated `--allowed-tools` flag. A policy rule can also name the modes it applies to, so a team can, for example, allow one test command only in `auto_edit` (spelled `autoEdit` in a rule's `modes` list) and leave `default` untouched.

  • Why can't a teammate make yolo the default for everyone by committing it to .gemini/settings.json?
    `general.defaultApprovalMode` only accepts `default`, `auto_edit` and `plan`; a `"yolo"` value is flagged as invalid and the CLI starts in `default`. Yolo has to be requested per run with `--approval-mode=yolo` or toggled with Ctrl+Y, and `security.disableYoloMode` can forbid even that.
  • In auto_edit, the agent wants to run the test suite. What happens, and how would you let `npm test` through without yolo?
    `run_shell_command` still asks in auto_edit, so you get a confirmation. To pre-approve just that command, add a policy rule in `~/.gemini/policies/` with `toolName = "run_shell_command"`, `commandPrefix = "npm test"` and `decision = "allow"`, which leaves every other shell command asking.

  • auto_edit lets the agent run shell commands without asking.
  • Putting yolo in general.defaultApprovalMode makes every session start in yolo.
  • Plan mode lets the agent edit files as long as it explains why.
  • Shift+Tab cycles through all four modes, including yolo.
  • An approval mode decides where commands run, so yolo needs no sandbox.
  • Passing --approval-mode=yolo always wins, even in an untrusted folder.

Assumes Gemini CLI 0.62.0: the plan mode, the deprecated --yolo flag and the yolo-only-from-the-command-line rule are as that release defines them.