---
description: "Claude dangerously skip permissions guide: what the flag disables, which checks still apply, and how to run it in containers with budgets and audit trails."
title: "Claude Dangerously Skip Permissions: A Practical Guide"
image: https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/10/claude-dangerously-skip-permissions-a-practical-guide-bifrost-isometric.png
---

Try Bifrost Enterprise free for 14 days. [Request access](https://www.getmaxim.ai/#enterprise-trial)

**TL;DR**

- The `--dangerously-skip-permissions` flag starts Claude Code in `bypassPermissions` mode, which runs file edits, shell commands, and tool calls without asking for approval.
- Deny rules, explicit ask rules, and `rm` protections on critical paths still apply in bypass mode, but allow rules and protected-path prompts do not.
- Claude Code refuses the flag under root or `sudo` on Linux and macOS, and Anthropic recommends it only inside containers or VMs.
- A safe setup combines a disposable non-root container, an egress allowlist, scoped credentials, and deny rules for the commands that matter most.
- Routing the session through Bifrost adds what the container cannot: per-key budgets, MCP tool allow-lists, guardrails, and a log of every model and tool request.

The `claude --dangerously-skip-permissions` flag starts Claude Code in a mode that executes file edits, shell commands, and MCP tool calls without asking a human first. Teams reach for it when they want Claude Code to finish long tasks, CI jobs, or batch refactors without a human approving each step. [Bifrost](https://www.getmaxim.ai), the [open-source AI gateway built in Go](https://github.com/maximhq/bifrost) by Maxim AI, provides the budget, tool, and audit controls that an unattended agent session needs. This guide explains what the flag disables, what still applies, how to run it safely, and when [Claude Code routed through Bifrost](https://docs.getbifrost.ai/cli-agents/claude-code) is the right control layer.

## What Does claude --dangerously-skip-permissions Do?

The `--dangerously-skip-permissions` flag launches Claude Code in `bypassPermissions` mode. In this mode, Claude Code skips permission prompts and runs tool calls immediately, including writes to protected paths such as `.git`, `.claude`, and `.vscode`. It is equivalent to `claude --permission-mode bypassPermissions`. It does not create a sandbox, restrict network access, or revoke credentials.

That last point is the one most answers get wrong. The flag changes how Claude Code asks for approval. It does not change what the operating system lets the process do. If the shell running Claude Code can delete a directory, push to a remote, or read `~/.aws/credentials`, an agent in bypass mode can do the same without stopping.

The behavior has a few specifics worth knowing, all documented in the [Claude Code permission modes reference](https://code.claude.com/docs/en/permission-modes):

- **First-run dialog.** The first interactive session in this mode shows a warning that you must accept. Accepting writes `skipDangerousModePermissionPrompt: true` to `~/.claude/settings.json`, so later sessions skip the dialog.
- **Headless runs.** With `-p` (non-interactive mode), no dialog appears, and any call that would still need a prompt is denied instead.
- **Launch-time only.** You cannot switch into bypass mode from a session that started without it. The `--allow-dangerously-skip-permissions` variant adds the mode to the `Shift+Tab` cycle without activating it.
- **Root refusal.** On Linux and macOS, Claude Code refuses to start in this mode as root or under `sudo`, unless it detects a recognized sandbox.

![A Claude Code tool call passes deny rules, ask rules, and critical path checks that still apply, while the permission prompt and allow rules are skipped before execution](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2026/10/claude-dangerously-skip-permissions-what-still-applies.png)

***Figure 1: Bypass permissions mode removes the prompt, not the deny rules, so deny rules become the main in-agent guardrail you control.***

For teams already running Claude Code against a central gateway, the [Claude Code gateway guide](https://www.getmaxim.ai/articles/claude-code-gateway-explained-routing-governance-and-cost-control/) covers how model traffic is routed before any of these permission decisions matter.

## What Still Applies in Claude Code Bypass Permissions Mode

Bypass permissions mode removes routine prompts, but Claude Code keeps a short list of checks that no mode auto-approves. Deny rules still block matching calls. Explicit ask rules still prompt. `rm` and `rmdir` against critical paths such as the filesystem root, home directory, or working directory are never auto-approved. Allow rules have no effect, because nothing is being asked.

| Control | Manual mode | Bypass permissions mode |
| --- | --- | --- |
| Permission prompt for edits and Bash | Shown | Skipped |
| `permissions.allow` rules | Pre-approve calls | No effect |
| `permissions.deny` rules | Block | Block |
| Explicit `ask` rules | Prompt | Prompt (denied in `-p` runs) |
| Writes to `.git`, `.claude`, `.vscode` | Prompted | Allowed |
| `rm` on critical paths | Prompted | Not auto-approved |
| Running as root or `sudo` | Allowed | Refused outside a sandbox |

The practical consequence is that **deny rules become the main in-agent policy you control.** Explicit ask rules, PreToolUse hooks that block a call, and critical-path `rm` checks also still apply, but allow rules do not. A deny rule such as `Bash(git push *)` or `Read(./.env)` blocks the call even in bypass mode. Deny rules match the command text Claude writes, though, so they are not a security boundary around a program that can be invoked another way. Pair them with OS-level isolation.

Deny rules inside Claude Code govern one machine. Bifrost adds a complementary policy layer for model and MCP traffic, through [governance controls](https://www.getmaxim.ai/resources/governance) that hold regardless of which flags a developer launched with.

## Claude Code Permission Modes Compared

Claude Code supports six permission modes: Manual (`default`), `acceptEdits`, `plan`, `auto`, `dontAsk`, and `bypassPermissions`. They differ in who approves an action: a human, a background classifier, a fixed allowlist, or nobody. Bypass mode is the only one where nobody reviews the action, which is why it is reserved for isolated environments.

| Mode | Who approves actions | Typical use |
| --- | --- | --- |
| Manual (`default`) | You, per action | Sensitive work, unfamiliar code |
| `acceptEdits` | Auto for file edits in the working directory | Iterating on code you will review |
| `plan` | Read-only exploration until a plan is approved | Scoping a change before editing |
| `auto` | A background classifier checks each action | Hands-off interactive sessions |
| `dontAsk` | Only pre-approved tools run, the rest are denied | CI with an exact `--allowedTools` list |
| `bypassPermissions` | No one | Fully unattended runs in a container or VM |

Two of these modes reduce the need for bypass. **Claude Code auto mode** removes routine prompts while a classifier reviews shell commands and network requests against your request, and it is the built-in starting mode in recent releases on supported models. `**dontAsk**` suits CI jobs where the needed tools are known in advance, for example `claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"`.

![Decision flow for Claude Code permission modes: interactive work uses manual or auto mode, CI uses dontAsk, and isolated unattended runs use bypass permissions](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2026/10/claude-dangerously-skip-permissions-mode-decision.png)

***Figure 2: Bypass permissions mode is the last branch, reached only when the run is unattended and the environment is disposable.***

The same permission choices apply to every coding agent a team runs. The overview of [governing Claude Code, Cursor, and Codex at scale](https://www.getmaxim.ai/articles/governing-ai-coding-agents-at-scale-claude-code-cursor-and-codex/) compares how each agent exposes them.

## The Risks of Running Claude Code with Bypass Permissions

Running Claude Code with bypass permissions exposes three classes of failure: destructive local actions, data exfiltration through prompt injection, and unbounded spend. Each one is a consequence of removing the human checkpoint, not of a defect in the model, and each needs a different containment layer.

- **Destructive local actions.** A misread instruction can produce `git reset --hard`, a recursive delete outside the target directory, or an overwrite of uncommitted work. Bypass mode also allows writes to `.git` and `.claude`, so the agent can change repository state and its own configuration.
- **Prompt injection and exfiltration.** Content the agent reads, such as a README, an issue comment, or a fetched web page, can carry instructions. Without a prompt, an injected `curl` that posts environment variables to an external host runs immediately. The [OWASP Top 10 for LLM Applications](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/) lists this pattern under excessive agency.
- **Runaway spend.** An agent stuck in a retry or test-fix loop keeps calling the model. With nobody watching, token usage grows until someone notices the invoice.

![Three failure paths in an unattended Claude Code session, destructive commands, data exfiltration, and runaway spend, each contained by a container, egress firewall, or gateway budget](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2026/10/claude-dangerously-skip-permissions-failure-paths.png)

***Figure 3: Each failure mode needs its own containment layer, because no single control covers files, network, and spend together.***

The first two risks are contained by isolation. The third is a cost and governance problem, which the [budget and rate limit controls](https://docs.getbifrost.ai/features/governance/budget-and-limits) in Bifrost address at the gateway. A broader treatment of these threats appears in the guide to [AI coding agent security](https://www.getmaxim.ai/articles/ai-coding-agent-security-governing-cursor-claude-code-and-copilot/).

## How to Run claude --dangerously-skip-permissions Safely

Running the claude dangerously skip permissions command safely means removing what the agent can damage before removing the prompts. The working pattern is a disposable container running as a non-root user, a network egress allowlist, credentials scoped to the task, a clean git checkpoint, and deny rules for high-impact commands.

### Step 1: Run inside a Claude Code sandbox or dev container

Use a container, VM, or dev container as the boundary. Anthropic publishes a [reference dev container](https://github.com/anthropics/claude-code/tree/main/.devcontainer) that runs Claude Code as a non-root user and includes an `init-firewall.sh` script limiting outbound traffic to allowed destinations. Mount only the repository the task needs, never your home directory.

```bash
docker run --rm -it \
  --user 1000:1000 \
  --cap-add=NET_ADMIN --cap-add=NET_RAW \
  -v "$PWD":/workspace -w /workspace \
  claude-sandbox:latest \
  claude --dangerously-skip-permissions
```

### Step 2: Restrict network egress

An egress allowlist is the control that stops exfiltration. Allow the model endpoint, your package registry, and your git host, and block everything else. If Claude Code reaches models through Bifrost, the allowlist shrinks to a single gateway host for inference.

### Step 3: Scope credentials to the task

Do not pass production cloud keys, deploy tokens, or personal SSH keys into the container. Give the agent a short-lived token with write access to one repository. For model access, a [Bifrost virtual key](https://docs.getbifrost.ai/features/governance/virtual-keys) set as `ANTHROPIC_AUTH_TOKEN` replaces a raw provider API key, so a leaked token exposes only that key's budget and model scope.

### Step 4: Add deny rules for high-impact commands

Deny rules still enforce in bypass mode, so put the actions you never want unattended in `.claude/settings.json`:

```json
{
  "permissions": {
    "deny": [
      "Bash(git push *)",
      "Bash(curl *)",
      "Bash(wget *)",
      "Read(./.env)",
      "Read(./secrets/**)"
    ]
  }
}
```

### Step 5: Checkpoint and review

Commit or stash before the run and work on a branch, so every change is reviewable as a diff. For CI, prefer `claude -p "<task>" --dangerously-skip-permissions` in a fresh runner container that is discarded after the job.

Teams that standardize this setup across many developers usually pair it with the [Bifrost CLI for coding agents](https://www.getmaxim.ai/articles/how-to-use-bifrost-cli-with-coding-agents-like-claude-code/), which launches Claude Code with gateway settings applied.

## Disabling Bypass Permissions Across an Organization

Administrators can block bypass mode entirely by setting `permissions.disableBypassPermissionsMode` to `"disable"` in managed settings, which developers cannot override. Claude Code also ignores `defaultMode: "bypassPermissions"` in a project's checked-in `.claude/settings.json`, so a repository cannot start sessions in bypass mode on its own.

A typical managed policy looks like this:

```json
{
  "permissions": {
    "disableBypassPermissionsMode": "disable",
    "deny": ["Read(./.env)", "Bash(curl *)"]
  }
}
```

Organizations that need unattended agents, but only in sanctioned places, can disable bypass mode on developer laptops and allow it only in CI images they control. Sessions started with `--restricted` (Claude Code v2.1.248 and later) also refuse bypass mode.

Managed settings stop a flag from being used. They do not record what an agent did when it ran. That record belongs at the gateway, which is the subject of the [Claude Code governance with an AI gateway](https://www.getmaxim.ai/articles/claude-code-governance-securing-agent-access-with-an-ai-gateway/) guide.

## Governing Unattended Claude Code Sessions with Bifrost

[The Bifrost AI gateway](https://www.getmaxim.ai) sits between Claude Code and the model providers and MCP servers it calls. When Claude Code runs with bypass permissions inside a container, Bifrost enforces budgets, rate limits, MCP tool allow-lists, and guardrails on every request, and logs each call. These controls hold regardless of the permission mode the agent was launched in.

![Claude Code in bypass permissions mode runs in a non-root container and sends model and MCP traffic through Bifrost, which applies budgets, tool filtering, and guardrails](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2026/10/claude-dangerously-skip-permissions-bifrost-architecture.png)

***Figure 4: The container limits what the agent can touch locally, and Bifrost limits what it can spend, call, and send upstream.***

Pointing Claude Code at Bifrost takes two environment variables in `settings.json`:

```json
"env": {
  "ANTHROPIC_BASE_URL": "http://localhost:8080/anthropic",
  "ANTHROPIC_AUTH_TOKEN": "your-virtual-key"
}
```

With that in place, each control in Figure 4 maps to a specific risk:

- **Spend limits.** Virtual keys carry their own budgets and rate limits, checked alongside team and customer budgets in a [hierarchical budget structure](https://docs.getbifrost.ai/features/governance/budget-and-limits). A runaway loop stops at the cap.
- **Tool restriction.** [MCP tool filtering](https://docs.getbifrost.ai/features/governance/mcp-tools) is deny-by-default per virtual key, so an unattended session can reach only the tools explicitly allowed for it, unless an MCP client is marked Allow by Default.
- **Content checks.** Bifrost Enterprise [guardrails](https://docs.getbifrost.ai/enterprise/guardrails) include a [secrets detection provider](https://docs.getbifrost.ai/enterprise/guardrails/secrets-detection) that scans requests and responses for API keys and tokens, so secrets in a prompt can be caught before they leave the network.
- **Request history.** [Built-in observability](https://docs.getbifrost.ai/features/observability/default) records every model request, which supports the review workflow described in the [Claude Code monitoring guide](https://www.getmaxim.ai/articles/claude-code-monitoring-how-to-track-coding-agents/).

Bifrost can also act as an [MCP gateway](https://www.getmaxim.ai/resources/mcp-gateway) for Claude Code, so one `claude mcp add` entry replaces per-server configuration. The walkthrough on [using an MCP gateway with Claude Code](https://www.getmaxim.ai/articles/using-an-mcp-gateway-with-claude-code-how-bifrost-centralizes-tool-access-for-agentic-coding/) covers the setup.

## Why Gateway Controls Matter for Enterprise Teams

Container isolation protects the host, but it is configured per run and leaves no central record. Enterprise teams running many agents need policy that is set once, enforced on every session, and auditable afterward. A gateway provides that because all model traffic and gateway-routed MCP tool calls pass through it, whatever flags each developer used.

Bifrost adds about 11 microseconds of overhead per request at 5,000 requests per second in sustained [performance benchmarks](https://www.getmaxim.ai/resources/benchmarks), so routing coding agent traffic through it does not slow interactive work. It supports [25+ providers and 10,000+ models](https://docs.getbifrost.ai/providers/supported-providers/overview) behind one API, which lets a platform team pin Claude Code to Anthropic, Bedrock, or Vertex without changing developer setups.

For regulated environments, [in-VPC deployments](https://docs.getbifrost.ai/enterprise/invpc-deployments) keep traffic inside the network, and [access profiles](https://docs.getbifrost.ai/enterprise/access-profiles) apply consistent budget and MCP policies to new virtual keys at scale. The [Bifrost Enterprise](https://www.getmaxim.ai/enterprise) page covers clustering, RBAC, and audit logs for administrative activity.

Teams working on agent identity and lifecycle more broadly can use the guide to [AI agent governance in production](https://www.getmaxim.ai/articles/ai-agent-governance-identity-permissions-budgets-and-lifecycle-in-production/), and the [governance resource hub](https://www.getmaxim.ai/resources/governance) collects the related patterns.

## Frequently Asked Questions

### Is claude --dangerously-skip-permissions safe?

The flag is safe only inside an isolated environment. On its own it removes approval prompts without adding any sandbox, network restriction, or credential scoping. Anthropic recommends using it only in containers, VMs, or dev containers where Claude Code cannot damage the host. Combined with a non-root container, an egress allowlist, scoped credentials, and gateway budgets, it is a reasonable choice for unattended tasks.

### How do I enable bypass permissions in Claude Code?

Start Claude Code with `claude --dangerously-skip-permissions` or the equivalent `claude --permission-mode bypassPermissions`. You can also set `permissions.defaultMode` to `bypassPermissions` in user settings, a `--settings` file, or managed settings. Project-level `.claude/settings.json` cannot start a session in bypass mode. You cannot switch into it mid-session unless you launched with `--allow-dangerously-skip-permissions`.

### Why does Claude Code keep asking for permission?

In Manual mode, Claude Code prompts before file edits and most shell commands. To reduce prompts without removing review entirely, add `permissions.allow` rules for trusted commands, switch to `acceptEdits` for file edits, or use auto mode, where a classifier reviews actions instead of you. Explicit ask rules still prompt in every mode, including bypass.

### Can I use dangerously-skip-permissions as root?

No. On Linux and macOS, Claude Code refuses to start in bypass mode when running as root or under `sudo`, and prints an error that the flag cannot be used with root privileges. The check is skipped inside a recognized sandbox. To run unattended in a container, use a dev container configuration that runs Claude Code as a non-root user.

### What is Claude Code YOLO mode?

"YOLO mode" is the informal name developers use for running Claude Code with `--dangerously-skip-permissions`. It is not an official mode name. The official name is `bypassPermissions`, shown in the status bar as "bypass permissions on." Everything in this guide about bypass mode applies to what people call YOLO mode.

### How do I disable dangerously-skip-permissions for my organization?

Set `permissions.disableBypassPermissionsMode` to `"disable"` in managed settings, which individual developers cannot override. Auto mode can be blocked the same way with `permissions.disableAutoMode`. For agents that still need unattended runs, route their traffic through an [AI gateway](https://www.getmaxim.ai/articles/top-5-llm-gateways-in-2026-a-production-ready-comparison/) such as Bifrost, using [virtual keys with per-key budgets](https://docs.getbifrost.ai/features/governance/virtual-keys), so budgets, tool access, and logging apply centrally.

## Getting Started with Bifrost

The claude dangerously skip permissions flag is useful for unattended work, and it is safe only when the environment around it carries the controls the prompt used to provide. A container handles files and network. Bifrost handles spend, tool access, content checks, and request history across every Claude Code session. To see how Bifrost governs coding agents across your organization, [book a demo](https://www.getmaxim.ai/book-a-demo) with the Bifrost team.

## Read next

[![SAML vs OIDC: Which SSO Protocol for Enterprise AI Tools](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/saml-vs-oidc-which-sso-protocol-for-enterprise-ai-tools-bifrost-1920x1080.png) SAML and OIDC are the two dominant single sign-on protocols, and they suit different clients. This guide compares SAML vs OIDC on tokens, flows, and API support, explains where SCIM fits, and shows why AI tools called from code and agents favor OIDC.](https://www.getmaxim.ai/articles/saml-vs-oidc/)

[![Claude Managed Agents vs the Claude Agent SDK: Which to Use in 2026](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/claude-managed-agents-vs-the-claude-agent-sdk-which-to-use-i-bifrost-1920x1080.png) Claude Managed Agents and the Claude Agent SDK give you the same agent engine in two forms: a hosted service or a library you run. This guide compares architecture, tools, data handling, and control, and shows how to govern model and tool traffic for both with Bifrost.](https://www.getmaxim.ai/articles/claude-managed-agents/)

[![ Claude Code Subagents and Workflows: A Practical Guide for 2026](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/claude-code-subagents-and-workflows-a-practical-guide-for-20-bifrost-1920x1080.png) Claude Code subagents let one session delegate work to focused agents with their own context, tools, and model. This guide covers built-in and custom subagents, frontmatter fields, agent teams, dynamic workflows, and how to keep fan-out costs under control with a gateway.](https://www.getmaxim.ai/articles/claude-code-subagents/)

## More in Claude Code

[![Bring Your Own Model to Claude Code: A Setup Guide for Engineering Teams](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/07/bring-your-own-model-to-claude-code-a-setup-guide-for-engine-maxim-strata.optimized.png) Bring your own model to Claude Code with Bifrost. A complete setup guide covering routing, governance, observability, and team rollout patterns. Engineering teams adopting Claude Code want the agentic coding workflow without the constraint of a single provider. The phrase "bring your own model to Claude Code" captures](https://www.getmaxim.ai/articles/bring-your-own-model-to-claude-code-a-setup-guide-for-engineering-teams/)

[![11 Best Claude Code Alternatives](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/11-best-claude-code-alternatives-bifrost-1920x1080.png) Claude Code alternatives are terminal coding agents that edit code, run commands, and call a model on a developer's behalf. This guide compares 11 of them, including Codex CLI, Gemini CLI, OpenCode, and GitHub Copilot CLI, on license, models, pricing, and team controls.](https://www.getmaxim.ai/articles/11-best-claude-code-alternatives/)

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "Maxim Articles",
        "url": "https://www.getmaxim.ai/articles/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w256h256/2025/08/thumbnail.png",
            "width": 60,
            "height": 60
        }
    },
    "author": {
        "@type": "Person",
        "name": "Swapnoneel Saha",
        "image": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2026/10/pfp.jpg",
            "width": 400,
            "height": 400
        },
        "url": "https://www.getmaxim.ai/articles/author/swapnoneel/",
        "sameAs": []
    },
    "headline": "Claude Dangerously Skip Permissions: A Practical Guide",
    "url": "https://www.getmaxim.ai/articles/claude-dangerously-skip-permissions/",
    "datePublished": "2026-10-07T12:52:04.000Z",
    "dateModified": "2026-10-13T11:00:51.000Z",
    "image": {
        "@type": "ImageObject",
        "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/10/claude-dangerously-skip-permissions-a-practical-guide-bifrost-isometric.png",
        "width": 1200,
        "height": 675
    },
    "keywords": "Claude Code, AI Governance",
    "description": "The claude dangerously skip permissions flag starts Claude Code in bypassPermissions mode, which removes approval prompts for edits and shell commands. This guide covers what still applies, the real risks, safe container setups, and gateway-level controls for teams.",
    "mainEntityOfPage": "https://www.getmaxim.ai/articles/claude-dangerously-skip-permissions/"
}
```
