Original URL: https://getagenttools.com/blog/gemini-cli-yolo-mode/

# Gemini CLI YOLO mode: --approval-mode=yolo, Ctrl+Y, and why it still asks

28 Oct 2026Marek.

- gemini-cli
- coding-agents
- agent-security

Gemini CLI YOLO mode is `--approval-mode=yolo` at launch, or Ctrl+Y inside a session. It auto-approves tool calls. The old `--yolo` and `-y` still work. The docs mark them deprecated. You cannot switch it on from `settings.json`. And it does not approve everything. Your deny rules still win.

 

```bash
# The documented flag
gemini --approval-mode=yolo

# Older form, still accepted, marked deprecated in the docs
gemini --yolo

# Inside a session: press Ctrl+Y to toggle
```

  

- **Two ways in.** A launch flag, or Ctrl+Y in a running session.
- **Not from settings.json.** `general.defaultApprovalMode` has no `yolo` value.
- **It still asks sometimes.** Since v0.63.0 some shell commands get a security prompt even in YOLO.
- **It still blocks.** Your own deny policies outrank the YOLO allow rule.
- **How I know.** I do not use Gemini CLI. This reads the docs and the v0.65.0 source on 25 October 2026.

 

What the Claude Code flag skips, and what still stops Claude, is in my [--dangerously-skip-permissions](https://getagenttools.com/blog/dangerously-skip-permissions/) post. This one is the Gemini side.

 

## How do I turn on YOLO mode in Gemini CLI?

 

Pass `--approval-mode=yolo`. The [CLI reference](https://geminicli.com/docs/cli/cli-reference/) lists four values for it. They are `default`, `auto_edit`, `yolo` and `plan`. The same table says `--yolo` is "Deprecated. Auto-approve all actions. Use `--approval-mode=yolo` instead."

 

Deprecated does not mean removed. In v0.65.0, from 20 October 2026, the source still declares `--yolo` with the alias `-y`. It maps to the same mode.

 

Do not pass both. The argument check rejects the pair with this line:

 

```text
Cannot use both --yolo (-y) and --approval-mode together. Use --approval-mode=yolo instead.
```

 

## What is the Gemini CLI YOLO mode shortcut?

 

Ctrl+Y. The [keyboard shortcuts page](https://geminicli.com/docs/reference/keyboard-shortcuts/) lists it as `app.toggleYolo`, "Toggle YOLO (auto-approval) mode for tool calls." Press it again and you are back in `default`. The prompt area shows a YOLO marker while it is on.

 

Shift+Tab cycles `default`, `auto_edit` and `plan`. Pressed in YOLO, it drops you to `auto_edit`.

 

If Ctrl+Y clashes with something, rebind it in `~/.gemini/keybindings.json`. The docs example unbinds it with `"command": "-app.toggleYolo"`.

 

## Can I enable YOLO mode in settings.json?

 

No. The [configuration reference](https://geminicli.com/docs/reference/configuration/) says `general.defaultApprovalMode` takes `default`, `auto_edit` or `plan`. It adds that YOLO "can only be enabled via command line". The source enforces it. A `yolo` value in that key is dropped. The session starts in `default`. The flag has to come from the command line. I would not alias it.

 

## Why is Gemini CLI YOLO mode not working?

 

I found five causes in the docs, source and issues. I have not reproduced any.

 

**The folder is not trusted.** In v0.65.0 the source forces the mode back to `default` in an untrusted folder. It only logs a debug warning. Ctrl+Y fails there too, with "Cannot enable privileged approval modes in an untrusted folder." The schema turns folder trust on by default. The [trusted folders page](https://geminicli.com/docs/cli/trusted-folders/) still calls it "disabled by default". Trust the folder, or pass `--skip-trust` for one session.

 

**YOLO is disabled.** `security.disableYoloMode` disables it "even if enabled by a flag". So does the admin setting `admin.secureModeEnabled`. At launch the CLI then stops with a fatal error. In the source, the text says "YOLO mode is disabled by your administrator", even when the switch is your own. Without admin settings, Ctrl+Y shows "You cannot enter YOLO mode since it is disabled in your settings."

 

**The untrusted flags warning.** Issue [\#29579](https://github.com/google-gemini/gemini-cli/issues/29579) reports a "CRITICAL SECURITY WARNING: Untrusted Command Flags Detected" on commands like `ls -la` and `git diff`. Pull request [\#29672](https://github.com/google-gemini/gemini-cli/pull/29672) was merged on 8 October 2026 to cut the false positives. Issue [\#29682](https://github.com/google-gemini/gemini-cli/issues/29682), "Gemini CLI v0.63.0 - breaks yolo mode", is still open. One commenter says it "continues in v0.65.0" under WSL. In the v0.65.0 scheduler, an allowed shell command turns back into a prompt if it carries flags from untrusted content. So does a build or test command after the session edited a build file. Headless, both become a deny.

 

**A hook asked.** If a `BeforeTool` hook returns `ask`, the scheduler prompts. YOLO does not override it. How those hooks work is in [Gemini CLI hooks](https://getagenttools.com/blog/gemini-cli-hooks/).

 

**Plan mode.** The built-in YOLO policy denies `enter_plan_mode` and `exit_plan_mode`. The `ask_user` tool keeps asking in interactive YOLO, by design per `yolo.toml`.

 

## What still stops Gemini CLI in YOLO mode?

 

Your deny rules. YOLO is one rule in the default tier. `yolo.toml` sets allow `*` at priority 998, which its comment turns into 1.998. User policies sit in tier 4 on the [policy engine page](https://geminicli.com/docs/reference/policy-engine/). So by the priority bands, a deny in `~/.gemini/policies/` beats YOLO. This rule shape comes from the docs quick start:

 

```toml
[[rule]]
toolName = "run_shell_command"
commandPrefix = "rm -rf"
decision = "deny"
priority = 100
```

 

Two warnings from the same page. Workspace policies in `.gemini/policies` are "currently non-functional", per issue [\#18186](https://github.com/google-gemini/gemini-cli/issues/18186). Put rules in your home folder. Headless runs turn an `ask_user` decision into deny. Without YOLO, write tools in a `-p` run just fail.

 

The sandbox is murkier. The configuration page says "Sandbox is enabled when using `--yolo` or `--approval-mode=yolo` by default." In the v0.65.0 source I could not find that link. The launch code reads `--sandbox`, `tools.sandbox` and `GEMINI_SANDBOX`. I found no YOLO check there. Want the box? Pass `--sandbox` yourself and check the Sandbox line in `/about`.

 

## How does Gemini CLI compare with Claude Code, Codex and Copilot CLI?

 

I use Claude Code and Codex every day. Gemini CLI and Copilot CLI I only read.

 

| Agent | Switch | What still stops it |
| --- | --- | --- |
| Claude Code | `--dangerously-skip-permissions` | Deny rules, explicit ask rules, hook denies, the critical-path breaker |
| Codex CLI | `--dangerously-bypass-approvals-and-sandbox`, or `-a never` with a sandbox | With `-a never`, the sandbox you chose |
| Copilot CLI | `--allow-all-tools`, `--allow-all` (`--yolo`) | Deny rules, per its docs |
| Gemini CLI | `--approval-mode=yolo`, Ctrl+Y | User and admin deny policies, untrusted folder, tainted-command prompts |

 

Codex details are in my [Codex post](https://getagenttools.com/blog/codex-dangerously-skip-permissions/). Copilot has [Copilot CLI --allow-all-tools](https://getagenttools.com/blog/copilot-cli-allow-all-tools/). opencode hides `--dangerously-skip-permissions` as an alias, see [opencode --dangerously-skip-permissions](https://getagenttools.com/blog/opencode-dangerously-skip-permissions/).

 

The toggle key is the part I like. Flip YOLO for one dull step, then flip back.

 

## When would I use Gemini CLI YOLO mode?

 

In a container or a throwaway checkout. Write deny policies for pushes and deletes first. Pass `--sandbox` on purpose. Do not rely on the docs line about the default.

 

For scripts, use the long flag. `--yolo` is deprecated. Deprecated flags tend to go.

 

## Frequently asked questions

 

### Is --yolo deprecated in Gemini CLI?

 

Yes, per the CLI reference. Use `--approval-mode=yolo`. In v0.65.0 `--yolo` and `-y` still work. Passing them with `--approval-mode` is an error.

 

### What is the Gemini CLI YOLO mode shortcut?

 

Ctrl+Y toggles YOLO on and off in a session. Shift+Tab cycles the other modes. Rebind keys in `~/.gemini/keybindings.json`.

 

### Does Gemini CLI have a dangerously skip permissions flag?

 

Not by that name. The match is `--approval-mode=yolo`. Deny policies still apply under it.

 

### Does YOLO mode turn on the sandbox?

 

The docs say yes. I could not confirm it in the v0.65.0 source. Pass `--sandbox` and check `/about`.

 

### Did you test this?

 

No. I do not run Gemini CLI. This reads the docs and the v0.65.0 source on 25 October 2026. The Claude Code and Codex rows come from my own posts.

 

Sources, read on 25 October 2026: Gemini CLI [CLI reference](https://geminicli.com/docs/cli/cli-reference/), [configuration](https://geminicli.com/docs/reference/configuration/), [policy engine](https://geminicli.com/docs/reference/policy-engine/), [keyboard shortcuts](https://geminicli.com/docs/reference/keyboard-shortcuts/) and [trusted folders](https://geminicli.com/docs/cli/trusted-folders/) pages. Code from the [google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli) repository at tag v0.65.0: `packages/cli/src/config/config.ts`, `packages/core/src/scheduler/scheduler.ts`, `packages/core/src/policy/policies/yolo.toml` and `packages/cli/src/config/sandboxConfig.ts`. Issues \#29579, \#29682 and \#18186, pull request \#29672.

Put this into practice

[See the tool list](https://getagenttools.com/tools/)[Train your team](https://getagenttools.com/#training)
