Get the free coreGet core

AI agent permissions: what to let your coding agent do on its own

Updated 5 min readSection 01 / Agent permissions
SHORT ANSWER

Most coding agents split agent permissions into four levels: ask each time, follow saved rules, let a second model review, or ask nothing. Each tool has its own name for the ask-nothing switch, and the table below lists them. Give an agent the narrowest permissions that keep you working, widen them with rules you wrote, and keep the no-prompt switch for a container or VM.

Agent permissions answer one question: which actions can the agent take without waiting for you? A coding agent is a program that reads your files and runs commands for you. In Claude Code, a Bash command you approve can write anywhere your user account can. The settings below are the main thing standing between a wrong guess by the model and your files, next to version control and a sandbox.

01Four levels of agent permissions

Across the four tools you will find roughly the same four levels.

OWASP calls the underlying risk Excessive Agency: damaging actions taken in response to unexpected, ambiguous or manipulated model output. Its advice is to require a human to approve high-impact actions before they are taken. Each setting below is a different answer to that advice.

02The four agents side by side

LevelClaude CodeCursorCodexGemini CLI
Ask firstManual mode: starts read-only, asks before edits, tests and commandsTerminal commands need approval by defaultRead-only mode, and the on-request policy that asks when it must go beyond the sandboxDefault mode: most write tools need confirmation
RulesAllow, ask and deny rules, checked deny firstAn allowlist, a list of commands that run without asking, matched by prefix: git matches git status but not gitkA sandbox that limits what it can touch, plus an approval policyA policy engine that can deny a command prefix like rm -rf
Model reviewAuto mode: a second model judges each actionAuto-review, the recommended default since Cursor 3.6Auto-review of eligible approval requests—
No promptsbypassPermissions, or --dangerously-skip-permissionsRun EverythingThe never policy, or --dangerously-bypass-approvals-and-sandboxyolo

For each agent in depth: Claude Code permissions, Cursor YOLO mode, Codex full-auto and Gemini CLI YOLO mode.

03What the defaults add

The table covers the main levels. A few defaults it leaves out.

Claude Code. Since v2.1.283 the built-in starting mode is auto, so check which mode you are in. Shift+Tab switches the mode. The classifier-based modes are covered once, on the Claude Code auto mode page.

Cursor. Agents can modify workspace files without approval except configuration files, so use version control. Every MCP connection needs approval, and so does each tool call after that. MCP servers are programs that give the agent extra tools. Run modes live in Settings > Agents > Approvals & Execution.

Codex. In the Auto preset it reads, edits and runs commands in the working directory automatically, and asks for edits outside the workspace or for commands that need network access. Switch to read-only with the /permissions command.

Gemini CLI. The approval modes are default, auto_edit, yolo and plan. Plan is strict read-only.

04The switches that skip the prompts

Each tool warns about its own switch. Claude Code: bypassPermissions is for isolated containers and VMs only. Codex: avoid the bypass flag unless you are inside a dedicated sandbox VM. Gemini CLI: yolo means all tools are auto-approved, use extreme caution. Cursor: Run Everything is for when you accept the risk and want zero prompts.

Attackers know these names. The s1ngularity supply-chain attack, a poisoned package that spreads through tools you trust, prompted installed AI command-line tools with the flags that skip approval. The story is told once, on the dangerously skip permissions page. The slang is explained in Claude Code YOLO mode.

05Why one prompt layer is not enough

Prompt-based controls have limits. Cursor's docs call run modes best-effort guardrails rather than a hard security boundary, and Backslash Security found four ways to bypass the Cursor denylist, a list of commands the agent must not run. Claude Code has had published advisories where an approval prompt was bypassed; they are listed on the Claude Code security page.

The fix is layers. Pair best-effort guardrails with deterministic ones such as hooks and sandboxing. A hook is a script of yours that runs before a tool call and can veto it, and a hook deny holds even in bypassPermissions; see Claude Code hooks. A sandbox adds a boundary that the operating system enforces, compared across tools in AI agent sandbox options.

06How to give an agent access, step by step

Giving access is not one decision. You make it at the start, then again each time a prompt appears.

At the start, pick the mode. Choose the narrowest one that still lets you work, and open the agent from a project folder, not from your home directory. In Claude Code a trust dialog, a one-time question asking you to confirm the folder is trusted, appears when you start in a folder you have not trusted. When trust is accepted in the home directory it lasts only for the session, so start from a project subdirectory instead, where acceptance is saved per directory.

At each prompt, read the command. Approving it is the actual permission grant. Save a rule only after you have seen the same command several times.

07A starting policy for your Mac

08What to take away

Good agent permissions are narrow by default and widened by rules you wrote. Every no-prompt switch in the table comes with a vendor warning, and Claude Code and Codex tie theirs to an isolated container or VM. Start from the table, then read the page for your agent. The home page lists the rest of the guide.

All agent permissions guides

FAQ

How do I give access to an agent?

Start with the narrowest setting: Claude Code's manual mode starts read-only and asks first, Codex defaults to a sandbox with network off, and Cursor needs approval for terminal commands by default. Widen it with saved rules, not with a no-prompt flag.

What are the different types of permissions?

Four kinds show up across the tools: ask each time, rules that allow or deny, a model that reviews requests, and no prompts at all. The table above maps them to each agent.

What is an agent on my computer?

A coding agent is a program that reads your files and runs commands for you. In Claude Code, a Bash command you approve can write anywhere your user account can.

Which flags skip all the prompts?

Claude Code has --dangerously-skip-permissions, Codex has --dangerously-bypass-approvals-and-sandbox with the alias --yolo, and Gemini CLI has --yolo, now deprecated for --approval-mode=yolo. Cursor has the Run Everything mode instead of a flag.

Do permission prompts protect me?

They are a key safety mechanism for local agentic execution, in GitHub's words, but they are one layer. OWASP advises requiring human approval for high-impact actions.

Sources

  1. Claude Code docs, permission modes
  2. Claude Code docs, permissions
  3. Cursor docs, run modes
  4. Cursor docs, security
  5. Codex docs, approvals and security
  6. Codex docs, sandboxing
  7. Gemini CLI docs, CLI reference
  8. Gemini CLI docs, policy engine
  9. OWASP, Excessive Agency
Letting agents act on their own? Artificial Immunity watches the Mac where your agents work.Get the free core