---
title: "How coding agents ask permission: approval modes by agent"
type: guide
url: https://agentsfordevs.com/guides/coding-agent-permissions
markdown: https://agentsfordevs.com/guides/coding-agent-permissions.md
publisher: Agents for Devs
author: Agents for Devs desk
reviewed_by: Agents for Devs desk
published: 2026-12-06
updated: 2026-12-06
license: https://agentsfordevs.com/reuse
citation: 'Agents for Devs. "How coding agents ask permission: approval modes by agent." Published Dec 6, 2026. https://agentsfordevs.com/guides/coding-agent-permissions'
attribution: Credit Agents for Devs and link to https://agentsfordevs.com/guides/coding-agent-permissions
format: Guide
topics:
  - coding-agents
description: "Approval and permission modes in Claude Code, Codex CLI, Gemini CLI, Grok Build and VS Code Copilot: names, defaults, rules, MCP approvals and admin locks."
---

# How coding agents ask permission: approval modes by agent

Mode names, starting defaults, rule files, MCP approvals and admin locks for Claude Code, Codex CLI, Gemini CLI, Grok Build and VS Code Copilot, from each vendor's docs.

## Short answer

Each coding agent has named modes that set when it stops to ask. Claude Code has `default`, `acceptEdits`, `plan`, `auto`, `dontAsk` and `bypassPermissions`. Codex CLI pairs a sandbox mode with an approval policy such as `on-request` or `never`. Gemini CLI takes `--approval-mode` with `default`, `auto_edit`, `plan` or `yolo`. Grok Build (formerly Cursor) has Auto-review, Allowlist and Run Everything. VS Code Copilot sessions offer Manual, Assisted and Allow all.

**Checked against:** Anthropic's [permission modes](https://code.claude.com/docs/en/permission-modes) and [permissions](https://code.claude.com/docs/en/permissions) pages; OpenAI's [approvals and security](https://learn.chatgpt.com/docs/agent-approvals-security), [rules](https://learn.chatgpt.com/docs/agent-configuration/rules) and [managed configuration](https://learn.chatgpt.com/docs/enterprise/managed-configuration) pages; Gemini CLI's [configuration](https://geminicli.com/docs/reference/configuration) and [policy engine](https://geminicli.com/docs/reference/policy-engine) references; Grok Build's [run modes](https://docs.grok.com/build/agents-window/agent/security/run-modes) and [permissions.json](https://docs.grok.com/build/agents-window/reference/permissions) pages; and VS Code's [approvals](https://code.visualstudio.com/docs/agents/run/approvals) and [enterprise AI settings](https://code.visualstudio.com/docs/enterprise/manage-ai-settings) pages, December 6, 2026.

**Run by us:** no. Commands and mode names are copied from each vendor's docs.

## What approval modes does each coding agent have?

All five agents name their modes, but Codex sets two values, a sandbox mode and an approval policy, where the other four expose a single mode.

| Agent | Modes, as named in the docs | Starting mode | How to switch |
|---|---|---|---|
| Claude Code | `default` (Manual), `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions` | `auto` in a terminal or the VS Code extension on v2.1.283 or later; `default` for `claude -p` and the Agent SDK | `Shift+Tab`, or `claude --permission-mode <mode>` |
| Codex CLI | Sandbox `read-only`, `workspace-write` or `danger-full-access`, plus approval policy `on-request`, `never` or `granular` | Recommends `Auto` (`workspace-write` with `on-request`) in version-controlled folders and `read-only` elsewhere | `/permissions`, or `--sandbox` and `--ask-for-approval` (`-a`) |
| Gemini CLI | `default`, `auto_edit`, `plan`, `yolo` | `default` | `Shift+Tab` cycles `default`, `auto_edit` and `plan`; `Ctrl+Y` toggles YOLO; `--approval-mode <mode>` |
| Grok Build (Agents Window) | Auto-review, Allowlist, Run Everything | Auto-review, the recommended default since 3.6 (May 29, 2026) | **Settings > Agents > Approvals & Execution** |
| VS Code, Copilot harness | Manual permissions, Assisted permissions, Allow all | Manual permissions | Permissions picker in the chat input, or `chat.defaultConfiguration` |

This is a feature reference, not a ranking. Defaults and names are as of December 6, 2026.

A few details the table can't hold:

- **Codex** no longer supports `approval_policy = "untrusted"`; OpenAI says the retired value can stop the client from starting. Beta permission profiles (`:read-only`, `:workspace`, `:danger-full-access`, set with `default_permissions`) are an alternative to `sandbox_mode`; the two don't combine.
- **Gemini CLI** accepts only `default`, `auto_edit` and `plan` in `general.defaultApprovalMode`. YOLO "can only be enabled via command line." `auto_edit` approves edit tools (`replace`, `write_file`) and prompts for others.
- **VS Code** treats Autopilot as a separate mode that keeps the agent working across turns, "not a fourth permission level." The Claude and Codex harnesses in VS Code have their own modes (Ask Before Edits through Bypass Permissions; Default Permissions, Auto-Review, Full Access). The deprecated Local harness has Default permissions, Allow all and Autopilot (Preview).

## Which modes skip approval prompts entirely?

Every agent has one, and every vendor attaches a warning to it.

| Agent | No-prompt setting | What still applies, per the docs |
|---|---|---|
| Claude Code | `bypassPermissions`, or `--dangerously-skip-permissions` | Deny rules, explicit ask rules and a short list of actions no mode auto-approves. Anthropic lists it for "Isolated containers and VMs only" |
| Codex CLI | `--ask-for-approval never`; `--dangerously-bypass-approvals-and-sandbox` (alias `--yolo`) also removes the sandbox | With `never`, the chosen sandbox still applies. OpenAI marks the bypass flag "not recommended" |
| Gemini CLI | `--approval-mode=yolo` (the `--yolo` flag is deprecated) | Sandboxing turns on by default with YOLO |
| Grok Build | Run Everything | "Every tool call runs automatically," with no sandbox |
| VS Code Copilot | **Allow all** for one session; `chat.tools.global.autoApprove` across workspaces | Organization policy and an enabled sandbox still apply |

## Which modes let a model review actions instead of you?

Four agents document a model-based reviewer that decides which actions need you.

| Agent | Reviewer mode | Notes from the docs |
|---|---|---|
| Claude Code | `auto`: a classifier reviews actions | Auto mode "does not guarantee safety." Admins can remove it with `permissions.disableAutoMode` |
| Codex CLI | `approvals_reviewer = "auto_review"` with `on-request` or a granular policy | Uses extra model calls |
| Grok Build | Auto-review | "Auto-review is not a security boundary." "The classifier can make mistakes." |
| VS Code Copilot | Assisted permissions, steered by `chat.permissions.assisted.instructions` | "The reviewer can make mistakes." |
| Gemini CLI | Not documented | |

"Not documented" means the Gemini CLI pages cited here don't describe a reviewer mode; it doesn't prove there isn't one.

## How do I pre-approve or block specific commands?

Each agent keeps rules in its own file and syntax.

| Agent | Where rules live | Syntax and order |
|---|---|---|
| Claude Code | `permissions.allow`, `ask`, `deny` in settings files | `Tool(specifier)`, such as `Bash(npm run test *)`. Evaluated deny, then ask, then allow |
| Codex CLI | Starlark `.rules` files, such as `~/.codex/rules/default.rules` | `prefix_rule` with `allow`, `prompt` or `forbidden`. Most restrictive match wins. Experimental |
| Gemini CLI | TOML policies in `~/.gemini/policies/*.toml` | `decision` of `allow`, `deny` or `ask_user`. Highest priority wins |
| Grok Build | `permissions.json`: `terminalAllowlist`, `mcpAllowlist`, `autoRun` | Allowlists only. `autoRun` instructions steer the classifier and aren't enforced |
| VS Code Copilot | `chat.tools.terminal.autoApprove` in User settings; managed `permissions.deny`, `ask`, `allow` | `true` runs, `false` asks. Managed rules evaluate deny, then ask, then allow |

Gemini CLI's quick-start rule blocks a command prefix:

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

Two traps from the docs: Codex checks each part of a chained command, so allowing `git add` doesn't allow `git add . && rm -rf /`. And Gemini CLI's workspace policy tier (`.gemini/policies` in a repo) "is currently non-functional," so put rules in user or admin policies.

## How are MCP tool calls approved?

Every agent lets you approve or hide MCP tools per server, with different keys.

| Agent | MCP controls |
|---|---|
| Claude Code | Rules name tools as `mcp__<server>__<tool>` or `mcp__<server>__*`. Tools marked `requiresUserInteraction` are never auto-approved, in any mode |
| Codex CLI | Per server in `config.toml`: `default_tools_approval_mode` (`auto`, `prompt`, `writes`, `approve`), per-tool `approval_mode`, `enabled_tools`, `disabled_tools`. Tools with a destructive annotation always need approval |
| Gemini CLI | `"trust": true` on a server "bypasses all tool call confirmations." `includeTools` and `excludeTools` filter tools; policy rules use `mcpName` |
| Grok Build | `mcpAllowlist` entries as `server:tool`. MCP follows the run mode |
| VS Code Copilot | A server's `tools` list limits availability but "doesn't bypass tool approvals." Review with **Chat: Manage Tool Approval** |

Setup for each agent's MCP servers is in the [Claude Code](/guides/claude-code-mcp), [Codex CLI](/guides/codex-cli-mcp), [Gemini CLI](/guides/gemini-cli-mcp), [Grok Build](/guides/cursor-mcp) and [VS Code](/guides/vscode-mcp) guides.

## Can an admin lock the mode?

Yes, in all five, through each vendor's managed configuration.

| Agent | Admin control |
|---|---|
| Claude Code | Managed settings: `permissions.disableBypassPermissionsMode` and `permissions.disableAutoMode` set to `"disable"`; `permissions.defaultMode` sets the start |
| Codex CLI | `requirements.toml`: `allowed_approval_policies`, plus `allowed_permission_profiles` (or `allowed_sandbox_modes` for legacy `sandbox_mode` setups) |
| Gemini CLI | System `settings.json`, such as `/etc/gemini-cli/settings.json` on Linux: `security.disableYoloMode`, `admin.secureModeEnabled`. Admin policies go in `/etc/gemini-cli/policies` |
| Grok Build | Team admins choose which run modes are available; team settings beat individual and project config |
| VS Code Copilot | Enterprise-managed `permissions.disableBypassPermissionsMode` (`"disable"`), `permissions.disableAssistedPermissionsMode`, `permissions.defaultMode`; the `ChatToolsAutoApprove` device policy |

In OpenAI's example, leaving `never` out of `allowed_approval_policies` and `danger-full-access` out of `allowed_sandbox_modes` blocks `-a never` and `--yolo`. Gemini CLI's `admin.secureModeEnabled` disallows both YOLO and "Always allow" options. On macOS and Windows, Gemini CLI's system paths are `/Library/Application Support/GeminiCli/` and `C:\ProgramData\gemini-cli\`.

## What doesn't an approval mode protect against?

A mode decides when the agent asks; it doesn't limit what an approved action can reach.

- **Sandboxes are separate.** Claude Code's Bash sandbox covers macOS, Linux and WSL2. Codex runs commands in an OS-enforced sandbox with network off by default. VS Code has a **Sandboxing for terminal** toggle. Gemini CLI's sandbox is off by default except in YOLO.
- **Allowlists match strings.** Grok Build calls `permissions.json` "Not a security boundary," and VS Code says command matching "is best effort."
- **Approved tools can still be misused.** [Prompt injection](/glossary/prompt-injection) in a file or tool result can steer an agent toward a call you'd approve without reading.

Keep a [human in the loop](/glossary/human-in-the-loop) for actions you can't undo, and give agents [least-privilege](/glossary/least-privilege-agents) credentials so an approved mistake stays small.

## What to read next

- [Prompt injection against coding agents: attack paths and defenses](/guides/prompt-injection-coding-agents)
- [Claude Code MCP config: commands, scopes and managed settings](/guides/claude-code-mcp)
- [VS Code MCP config: mcp.json, Copilot agents and policies](/guides/vscode-mcp)
- [Human in the loop](/glossary/human-in-the-loop)

## Sources

1. [Choose a permission mode, Anthropic](https://code.claude.com/docs/en/permission-modes)
2. [Configure permissions, Anthropic](https://code.claude.com/docs/en/permissions)
3. [Agent approvals & security, OpenAI](https://learn.chatgpt.com/docs/agent-approvals-security)
4. [Rules, OpenAI](https://learn.chatgpt.com/docs/agent-configuration/rules)
5. [Permissions, OpenAI](https://learn.chatgpt.com/docs/permissions)
6. [Managed configuration, OpenAI](https://learn.chatgpt.com/docs/enterprise/managed-configuration)
7. [Model Context Protocol, OpenAI](https://learn.chatgpt.com/docs/extend/mcp)
8. [Gemini CLI configuration, Google (Gemini CLI docs)](https://geminicli.com/docs/reference/configuration)
9. [Policy engine, Google (Gemini CLI docs)](https://geminicli.com/docs/reference/policy-engine)
10. [Keyboard shortcuts, Google (Gemini CLI docs)](https://geminicli.com/docs/reference/keyboard-shortcuts)
11. [MCP servers with Gemini CLI, Google (Gemini CLI docs)](https://geminicli.com/docs/tools/mcp-server)
12. [Run modes, Grok Build docs](https://docs.grok.com/build/agents-window/agent/security/run-modes)
13. [permissions.json reference, Grok Build docs](https://docs.grok.com/build/agents-window/reference/permissions)
14. [Agent security, Grok Build docs](https://docs.grok.com/build/agents-window/agent/security)
15. [Manage approvals and permissions, Microsoft (VS Code docs)](https://code.visualstudio.com/docs/agents/run/approvals)
16. [Manage AI settings in enterprise environments, Microsoft (VS Code docs)](https://code.visualstudio.com/docs/enterprise/manage-ai-settings)
17. [MCP configuration reference, Microsoft (VS Code docs)](https://code.visualstudio.com/docs/agents/reference/mcp-configuration)

## Changelog

- 2026-12-06: First published.

## Cite this page

Agents for Devs. "How coding agents ask permission: approval modes by agent." Published Dec 6, 2026. https://agentsfordevs.com/guides/coding-agent-permissions

- Page: https://agentsfordevs.com/guides/coding-agent-permissions
- Markdown: https://agentsfordevs.com/guides/coding-agent-permissions.md
- Reuse: quote or summarize with a link to the page. Terms: https://agentsfordevs.com/reuse
