Claude Code --dangerously-skip-permissions: what it skips and what still applies
--dangerously-skip-permissions is equivalent to Claude Code's bypassPermissions mode: tool calls run without permission prompts, including writes to protected paths such as .git and .claude. Deny rules, explicit ask rules and a short list of built-in checks still apply, and on Linux and macOS Claude Code refuses to start this way as root. Anthropic says to use the mode only in an isolated container or VM, and points to auto mode for fewer prompts.
For a security leader, the useful question is not whether the flag is acceptable but what boundary replaces the human who used to approve each action. In our assessment, Anthropic's documentation answers that consistently: isolation, a non-root user, restricted network access and deny rules for anything that must never happen. This guide describes behavior as documented for Claude Code v2.1.332, the latest release on npm (published 25 November 2026). The stable channel is 2.1.326, and several controls below need a minimum version, which we note. Sources were checked on 25 November 2026. For the identity side of agent permissions, see how agent identity options compare.
What --dangerously-skip-permissions skips
The CLI reference describes the flag in two sentences: "Skip permission prompts. Equivalent to --permission-mode bypassPermissions." The permission modes page is more direct: the mode "disables permission prompts and safety checks so tool calls execute immediately, including writes to protected paths." Protected paths include directories such as .git, .vscode, .devcontainer and .claude, and files such as .bashrc, .zshrc, .npmrc and .mcp.json. In other modes writes there get special handling. In bypass mode they are allowed.
Three side effects matter for anyone writing policy:
- Allow rules stop mattering. The docs say "Allow rules have no effect in
bypassPermissions", because everything not otherwise blocked already runs. - Subagents inherit the mode. The subagents page says that when the main conversation is in
bypassPermissions, the subagent "runs in that same mode and Claude Code ignores thepermissionModeyou set." - Plan mode is advisory. "In interactive terminal sessions with bypass permissions available, don't rely on plan mode's blocks. A file edit or shell command Claude attempts during planning can run without prompting."
Searchers often call this "Claude Code YOLO mode". That nickname is not Anthropic's and does not appear in its docs. What Anthropic does say is the most important sentence on the page: "bypassPermissions offers no protection against prompt injection or unintended actions." That matters because prompt injection cannot be fully prevented. Removing human approval for every action also removes one of the main controls for excessive agency, so the remaining limits have to come from somewhere else.
What still applies in Claude Code bypass permissions mode
The flag does not switch everything off. Anthropic's permissions page says rules "are evaluated in order: deny, then ask, then allow", and the permission modes page says "Deny rules block in every mode, including bypassPermissions." It also lists actions that Claude Code "doesn't auto-approve" in any mode. The table summarizes what remains.
| Control | Behavior in bypass mode | Limits and versions |
|---|---|---|
| Deny rules | Still block | A deny at any settings level cannot be allowed by another level |
| Explicit ask rules | Still prompt | Includes connector tools an organization set to ask |
AskUserQuestion and MCP tools marked requiresUserInteraction | Still need the user | None documented |
Critical-path rm and rmdir | In the terminal, prompt with a two-minute countdown, then deny; in VS Code, the desktop app and -p runs, deny instead | Countdown from v2.1.281; the check "can miss some commands" |
blockReadsOutsideWorkingDirectories, blockWritesOutsideWorkingDirectories | File tools refuse paths outside the working directories | v2.1.257 and v2.1.314 or later; file tools only |
| Root and sudo check | Refuses to start | Linux and macOS |
| PreToolUse hooks | Receive the current mode and can deny a call | Only as reliable as the hook itself |
| Built-in Bash sandbox | Still limits shell commands, if enabled | Off by default; shell commands only |
Two limits stand out. First, the critical-path check is a convenience, not a boundary. Anthropic says it "doesn't replace an operating-system control such as sandboxing", and a command the check misses can run with no prompt in bypass mode. It can also be switched off entirely with an environment variable, CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1, from v2.1.311. Second, the set of remaining checks keeps moving. The changelog for 2.1.326, published 16 November 2026, reads "Changed some tool calls in bypass permissions mode to ask for approval, or be denied where no one can be asked", and 2.1.223 fixed a gap where an agent definition's bypassPermissions mode "ignored the org bypass-permissions disable policy". Older clients lack these fixes, so version control is part of the control set.
How bypass mode is turned on, and why it sometimes will not start
Most "not working" reports trace back to documented guardrails on how the mode starts:
- Launch only. "You can't enter
bypassPermissionsfrom a session you started without it enabled." Use the flag,--permission-mode bypassPermissions, or--allow-dangerously-skip-permissions, which adds the mode to theShift+Tabcycle without starting in it. - Not from project settings. The settings reference says "
autoandbypassPermissionsdon't take effect from project or local settings, so set them in~/.claude/settings.jsoninstead." Before v2.1.257,bypassPermissionstook effect from any file, including a repository's checked-in settings. Cloud sessions do not honor it from settings files at all. - Not as root. On Linux and macOS, Claude Code "refuses to start in
bypassPermissionsmode when running as root or undersudo". The docs say the check is skipped inside "a recognized sandbox" without defining one, and point to the dev container, which runs as a non-root user. - Not in restricted sessions. Claude Code refuses the mode in a session started with
--restricted(v2.1.248 or later). - Not when disabled by policy. See the section on blocking it below.
The first interactive start shows a warning dialog asking the user to accept responsibility. Accepting sets skipDangerousModePermissionPrompt in the user's settings. In non-interactive mode, the docs say, "no dialog is shown."
Containing a bypassed session: container, Claude Code sandbox and egress
Anthropic's sandbox environments page sets the baseline: "Always run --dangerously-skip-permissions sessions inside a container, a VM, or the sandbox runtime, so that file tools, MCP servers, and hooks are also inside the boundary." The wording matters, because the built-in sandbox is narrower than many teams assume.
The built-in sandbox covers the shell only. The sandboxing page says "The sandbox covers shell commands only. Claude's file tools, MCP servers, and hooks run outside it", and "The sandbox is off by default." Its default read access includes "credential files such as ~/.ssh and ~/.aws/credentials". Local MCP servers run with the user's full access, which is why MCP tool poisoning is a bigger concern when nothing prompts.
Close the unsandboxed retry. When a sandboxed command fails, Claude may retry it with dangerouslyDisableSandbox, and in bypass mode "the retry runs without a prompt". Setting "allowUnsandboxedCommands": false makes Claude Code ignore that parameter, and failIfUnavailable stops commands running unsandboxed when the sandbox cannot start. An ask rule for Bash(dangerouslyDisableSandbox:true) is the documented alternative.
Restrict egress. In bypass mode, connections to hosts outside the allowed domains are "Allowed without a prompt" unless strictAllowlist or allowManagedDomainsOnly is on, in which case the sandbox proxy "refuses the connection in every permission mode." Anthropic also warns that "Allowing broad domains such as github.com can create paths for data exfiltration." For network control outside the client, put an egress proxy in front of the agent.
Know what a container does not stop. The dev container page says that with this flag, "dev containers do not prevent a malicious project from exfiltrating anything accessible inside the container, including the Claude Code credentials stored in ~/.claude." It advises against mounting host secrets such as ~/.ssh, and notes that Claude "can still modify any file in the bind-mounted workspace". Config files are a persistence path too: a sandboxed session that can write them "can persist hooks, permission rules, or MCP servers that run unsandboxed the next time you launch Claude Code." Anthropic adds that its sandbox "is not a complete isolation boundary."
Blocking bypass mode for a team
The control is one setting. With permissions.disableBypassPermissionsMode set to "disable", Claude Code "rejects the --dangerously-skip-permissions flag, and ignores an agent definition's permissionMode: bypassPermissions". It works from any scope, so individuals can lock themselves out too, and the managed settings page lists it among locks that apply "the strictest value any source sets".
Delivery matters as much as the value. Anthropic says server-managed settings "operate as a client-side control, not a security boundary", and that "On unmanaged devices, a user doesn't need admin or sudo access to bypass them." For stronger guarantees, it points to endpoint-managed settings on devices enrolled in MDM. Its own advisory CVE-2026-103012 describes sessions that "started without the organization's server-managed policy (such as permission deny rules, model restrictions and managed-only locks)" in affected versions, fixed in 2.1.260. The advisory says endpoint-managed settings were not affected. A dev container's firewall has a similar weakness: because the Dockerfile lives in the repository, "anyone with write access can change or remove this step."
Bypass permissions vs auto mode vs dontAsk
Anthropic presents bypass mode as one option among several, not the default route to fewer prompts:
- Auto mode is "the built-in starting permission mode for interactive terminal and VS Code sessions" from v2.1.283. A classifier reviews actions in the background. Anthropic calls it "a per-action control, not an isolation boundary", so isolation still adds defense in depth but "is not required the way it is for
--dangerously-skip-permissions." - dontAsk with an exact allowlist is the documented CI pattern, for example
--permission-mode dontAsk --allowedTools "Bash(npm test)" "Read". - Bypass mode in a container is the documented fully unattended setup. It requires "a container, VM, or the sandbox runtime" and, on Linux and macOS, a non-root user. In a
-prun, calls that would still prompt are denied instead.
Unattended -p runs need one more check: the security page says such a session shows neither the workspace trust dialog nor the .mcp.json approval prompt. For untrusted repositories, the permissions page lists options such as --setting-sources user and --bare.
Anthropic advisories where the boundary failed
None of these advisories is specific to bypass mode. Four are failures of the sandbox or workspace boundary that bypass mode depends on; CVE-2026-103012 is a failure to apply server-managed policy. Anthropic's advisories say auto-update delivers each fix, and none states exploitation in the wild.
| Record | What the advisory describes | Fixed in |
|---|---|---|
| CVE-2026-25725 | Code inside the bubblewrap sandbox could create a missing .claude/settings.json and inject hooks that run with host privileges on restart | 2.1.2 |
| CVE-2026-39861 | Sandbox escape via symlink following, combining the sandboxed command and the unsandboxed app | 2.1.64 |
| CVE-2026-55607 | Git worktree path confusion let an attacker overwrite home directory files such as .zshenv, when the user ran Claude Code against a malicious repository containing prompt injection content | 2.1.163 |
| CVE-2026-88968 | On macOS, a sandboxed process could swap a directory for a symlink so the unsandboxed Edit tool overwrote a file outside the workspace | 2.1.251 |
| CVE-2026-103012 | Sessions could start without server-managed policy | 2.1.260 |
The pattern is the strategic point. Several of these combine a sandboxed process with a component outside the sandbox, or write a config file that runs later. That is exactly the gap the sandbox environments page closes by putting the whole process, not just the shell, inside the boundary.
Claude Code dangerously skip permissions: a settings checklist
- Run bypassed sessions only inside a container, VM, dev container or the sandbox runtime, as a non-root user, so file tools, MCP servers and hooks are inside the boundary.
- Restrict egress with the reference container's
init-firewall.sh, or withallowedDomainsplusstrictAllowlistorallowManagedDomainsOnly. Avoid broad domains. - Keep secrets out: no
~/.sshor cloud credential mounts, and repository-scoped or short-lived tokens instead. - If the built-in sandbox is on, set
allowUnsandboxedCommands: falseandfailIfUnavailable: true. - Write deny rules for what must never happen. They hold in bypass mode, while allow rules do nothing there.
- Consider
blockWritesOutsideWorkingDirectoriesandblockReadsOutsideWorkingDirectories, remembering they cover file tools only. - If your organization does not want the mode, set
permissions.disableBypassPermissionsModeto"disable"in managed settings, delivered through MDM where possible. - For
-pruns on untrusted repositories, use--setting-sources useror--bare. - Keep Claude Code updated. Several 2026 releases tightened the checks that remain in bypass mode.
- If the goal is fewer prompts rather than no checks, evaluate auto mode or dontAsk with an allowlist first.
The bottom line for decision makers: --dangerously-skip-permissions moves responsibility from a person approving actions to the environment around the agent. In our assessment, treat a request to use it as a request to fund and verify that environment.
Frequently asked questions
Why does Claude Code still ask for permission with --dangerously-skip-permissions?
Anthropic documents a short list of actions that no mode auto-approves, including bypassPermissions: tools matched by an explicit ask rule, connector tools your organization set to ask, the AskUserQuestion tool, MCP tools marked requiresUserInteraction, recognized rm and rmdir removals of critical paths, the cross-session messaging safeguards, and reads or writes outside the working directories when the matching block setting is on. Recent releases also changed some tool calls in bypass mode to ask for approval.
Can I run --dangerously-skip-permissions as root?
Not on Linux or macOS. Anthropic's docs say Claude Code "refuses to start in bypassPermissions mode when running as root or under sudo". The check is skipped inside what the docs call a recognized sandbox. For autonomous runs in a container, Anthropic points to its dev container configuration, which runs Claude Code as a non-root user.
Can I turn on bypass permissions mode in the middle of a session?
No. The docs say you can't enter bypassPermissions from a session you started without it enabled. Start with the flag, with --permission-mode bypassPermissions, with permissions.defaultMode set in your user settings, or with --allow-dangerously-skip-permissions, which adds the mode to the Shift+Tab cycle without starting in it.
What is the difference between bypass permissions and auto mode?
Bypass permissions runs tool calls without prompts or safety checks, and Anthropic says it "offers no protection against prompt injection or unintended actions". Auto mode keeps background safety checks through a classifier and is the built-in starting mode for interactive terminal and VS Code sessions from v2.1.283. Anthropic calls that classifier a per-action control, not an isolation boundary.
Can an organization block --dangerously-skip-permissions?
Yes. Setting permissions.disableBypassPermissionsMode to "disable" makes Claude Code reject the flag and ignore an agent definition's bypassPermissions mode. It is typically set in managed settings. Anthropic says server-managed settings are a client-side control, not a security boundary, and recommends endpoint-managed settings through MDM for stronger enforcement.
Is there a Claude Code YOLO mode?
"YOLO mode" is a nickname searchers use for --dangerously-skip-permissions. Anthropic's docs do not use that term. The documented name is bypassPermissions mode, which the CLI reference calls equivalent to the flag.
What does allowUnsandboxedCommands do in Claude Code?
When the built-in sandbox is on and a sandboxed command fails, Claude may retry it unsandboxed with the dangerouslyDisableSandbox parameter, and in bypassPermissions mode that retry runs without a prompt. Setting "allowUnsandboxedCommands": false in the sandbox settings disables the retry, and Claude Code then ignores the parameter. Anthropic says to also set failIfUnavailable so commands do not run unsandboxed when the sandbox cannot start.
Sources
- Claude Code docs: Permission modes
- Claude Code docs: Configure permissions
- Claude Code docs: CLI reference
- Claude Code docs: Sandboxing
- Claude Code docs: Sandbox environments
- Claude Code docs: Development containers
- Claude Code docs: Settings reference
- Claude Code docs: Managed settings
- Claude Code docs: Server-managed settings
- Claude Code docs: Security
- Claude Code docs: Subagents
- Claude Code docs: Hooks reference
- Claude Code CHANGELOG (GitHub)
- npm registry: @anthropic-ai/claude-code (versions and publish times)
- Anthropic advisory GHSA-ff64-7w26-62rf (CVE-2026-25725)
- Anthropic advisory GHSA-vp62-r36r-9xqp (CVE-2026-39861)
- Anthropic advisory GHSA-7835-87q9-rgvv (CVE-2026-55607)
- Anthropic advisory GHSA-5xjx-9qx6-jcrv (CVE-2026-88968)
- Anthropic advisory GHSA-gfvf-j8jh-jxxw (CVE-2026-103012)
This article is analysis. Bylines on AIAgentThreats are disclosed pen names of our editorial team. Spotted an error? Email info@aiagentthreats.com. See our Editorial Standards.