Claude Code Skip Permissions: How to Run --dangerously-skip-permissions Safely (2026)
Most people who use Claude Code end up running --dangerously-skip-permissions. The prompts get annoying and the work is real. So the useful question is what you should have set up before you flip it.
The answer is better than the flag’s name suggests.
What the flag turns off
--dangerously-skip-permissions (the same as --permission-mode bypassPermissions) auto-allows every call that Claude Code’s permission system would have asked about. That system is what prints “Allow this tool call?”. It is not the only thing between the model and your files.
Still enforced with the flag on, per Claude Code’s control model:
| Still holds | Gone |
|---|---|
deny rules at every settings scope. Deny beats allow everywhere, and an org-deployed deny can’t be overridden by a CLI flag |
Every interactive prompt |
Explicit ask rules, and MCP tools flagged as requiring interaction |
Any control that depended on a human reading the command |
PreToolUse hook blocks. Hooks fire in every permission mode, and exit 2 or permissionDecision: "deny" is unconditional |
The auto-mode classifier screen, which bypass replaces |
The rm -rf circuit breaker, which catches rm -rf / and rm -rf ~ even inside $(...) |
|
The refusal to run bypass mode as root |
So a bypass session runs on your denies and your hooks, and nothing else. The flag doesn’t make a session dangerous. It makes it exactly as safe as the rules you wrote ahead of time. The December home-directory wipe ran under this flag. The circuit breaker that would catch it today was widened afterwards.
The longer version, including an error we published ourselves, is Is --dangerously-skip-permissions safe?
The hardening checklist, in order
Each step covers something the one above it can’t. The cheap ones come first.
1. Write the deny rules before you need them
Deny is the only rule tier that survives the flag, so anything non-negotiable goes there. Put it in ~/.claude/settings.json (user scope) or .claude/settings.json (project):
{
"permissions": {
"deny": [
"Bash(curl:*)",
"Bash(rm:*)",
"Read(./.env)",
"Read(~/.aws/credentials)",
"Read(~/.ssh/id_*)",
"WebFetch"
]
}
}
Two things to know when you write these:
- Deny the command family, not the arguments. Anthropic’s docs call argument-constrained Bash patterns fragile.
Bash(curl http://github.com/ *)misses the-X GETspelling, thehttps://spelling, and anything routed through an env var.Bash(curl:*)is a rule. The longer one is a hope. Write()rules are never consulted.Edit()rules govern Write and NotebookEdit. Claude Code later added a warning for this, because enough people had rules that did nothing.
A deny list is a string match inside the client. A compound command, an interpreter, or a three-line script the agent writes and runs will route around it. That’s the documented bypass class, and it’s why step 2 exists.
2. Put anything that must hold in a PreToolUse hook
Hooks are the strongest control inside the harness. PreToolUse fires on every tool call in every permission mode. The hook receives permission_mode: "bypassPermissions" in its input, which it couldn’t if it never ran. A hook that exits 2 or returns permissionDecision: "deny" blocks the call. A hook allow cannot loosen a deny or ask rule.
The catch, as of this post’s date: a Claude Code hook that times out lets the call through. If your enforcement lives in a hook, that hook has to be up for the control to work. Newer Claude Code releases add an onFailure: "block" option, so check the docs and set it if the hook guards something you can’t lose.
3. Turn the sandbox on
Run /sandbox. It uses Seatbelt on macOS and bubblewrap on Linux. It’s off by default, which is the most common gap in a yolo setup. Once it’s on, writes are confined to the workspace and $TMPDIR, network goes through a proxy with no domains pre-allowed, and a set of paths can’t be written at all: settings files, hook and skill directories, .mcp.json, credentials, shell rc files, and .git/hooks.
Two limits. Reads are not confined by default. The docs warn that ~/.ssh and ~/.aws/credentials stay readable unless you add deny-read rules, which is why they’re in the step 1 snippet. And the model can ask to disable the sandbox through the normal permission flow, which in bypass mode asks nobody. A sandbox limits the damage. It doesn’t decide anything. Sandboxes and control planes covers that trade in more detail.
4. Don’t run as root, and don’t inherit a hostile repo’s settings
Bypass mode refuses to run as root. Take the hint. The other sharp edge is headless runs: -p counts as having accepted workspace trust, so a scripted run in a repo you didn’t write picks up that repo’s project settings. --setting-sources user strips them. Add it to any cron or CI invocation, since nobody is watching those.
5. Flip the org-level switch if the answer is “never”
If some machines should never have this mode, managed settings carry two kill switches. permissions.disableBypassPermissionsMode removes the mode. allowManagedHooksOnly pins your hooks so a user or project setting can’t override them. A managed deny can’t be overridden by a CLI flag either.
This is the strongest answer that uses only Claude Code. Its limit is that managed settings are files on the endpoint, so it assumes you manage the endpoint.
6. Add a check that lives off the agent’s settings
Everything above lives on the machine running the agent, so anyone who owns that machine can edit it. disableAllHooks is a documented one-line switch that stops every hook. On your own laptop that’s fine, because you aren’t defending against yourself. Where the endpoint isn’t the trust boundary, you need a control somewhere else.
This is the part we build. Two install paths:
# Connected: policy and the record live in your ACP workspace
curl -sf https://agenticcontrolplane.com/install.sh | bash
# On-device only: no account, nothing leaves your machine
curl -sf https://agenticcontrolplane.com/install.sh | bash -s -- --local
What you get in a bypass session:
- A safety floor. Some commands are always blocked, in every mode, and no approval reaches them: a recursive delete of your home directory or the root filesystem,
mkfs,ddonto a disk, a fork bomb. Connected workspaces also always block a recursive delete of a system directory. With--localthe always-blocked list is shorter: home and root,mkfs,dd, fork bombs. Matching is on tokens, so flag order and spelling tricks likerm -r -f ~orrm -rf ~/don’t help, and the check looks one level intobash -c "..."andeval. - A hold on the next tier of risky commands. Force-push, destructive SQL through a database client,
curl | sh, and a recursive delete outside the project are held for your approval. They are not denied. In Claude Code the hold shows up inline. An owner or admin can switch this tier off on the Policies page, and the installer asks you at install time. It reads shell command text only, so MCP and other non-shell tools never reach it. - allow / ask / deny rules on every call, written once and applied across every harness you run.
- One log. Each call gets a row with tool, decision, reason and time. In a connected workspace it’s a queryable log. With
--localit’s~/.acp/audit.jsonl, a plain file on the same machine, so it’s a record and not proof.
A new workspace starts in audit mode, which records everything and holds nothing except the floor. Run /acp-enforce when you want your rules to hold calls.
Here is the part that matters for this post. ACP sorts sessions started with --dangerously-skip-permissions into the background tier, along with CI and claude -p. Nobody is there to click, so an ask in that tier becomes a block you approve from the console or the email. The plugin also keeps that tier blocked if the ACP gateway can’t be reached. Interactive sessions get a loud UNGOVERNED notice and keep going.
What the installer writes to your machine, file by file, is on the install page.
7. Re-run the installer if you installed before August 27, 2026
This one affects the local path. The on-device decision engine (~/.acp/decide.mjs) had a bypass. timeout 5 rm -rf ~ was classified as a timeout command and not as rm, because the parser skipped a wrapper’s flags but not the operands it consumes before the real command. It’s fixed. The engine now has a table of wrappers with the flags and operands each one takes, and it scans each part of a compound command separately.
Check for the fix in one line:
curl -s https://agenticcontrolplane.com/install.sh | grep 'const WRAPPERS'
You should see const WRAPPERS = new Map([. If you installed before August 27, 2026, your ~/.acp/decide.mjs predates the fix. Re-running the installer replaces it:
curl -sf https://agenticcontrolplane.com/install.sh | bash -s -- --local
Your ~/.acp/policy.json is left alone. The installer only writes it when it doesn’t exist. Connected workspaces were never affected, because the gateway classifies the command there.
What still isn’t covered
A deny list can’t constrain a programming language. The step 1 rules are a first line. python3 -c "import shutil; shutil.rmtree(...)" is what a coding agent does all day. Every layer above the sandbox reads command text. Only the kernel looks at what a command does.
The hooks can fail open. Claude Code’s hook let calls through on timeout when this was written. ACP’s Claude Code plugin fails open for interactive sessions with an UNGOVERNED banner, and closed for subagent, background and API sessions. The shared hook that Cursor, Codex and other harnesses use fails open in every tier unless you set ACP_FAIL_MODE=closed or write closed to ~/.acp/failmode. Fail open suits a laptop. It’s wrong for a machine that touches production. Pick on purpose.
ACP is a client-side hook. disableAllHooks turns it off, and so does deleting the hook entry. --local is the same: it protects you from accidents, not from the person at the keyboard. Anything that needs to survive a determined user has to sit outside the machine.
Nothing here covers what the agent reads. Bypass mode plus unconfined sandbox reads is a way to leak credentials, and a permission prompt would never have caught it. Deny-read rules and the sandbox are the controls. The flag leaves both alone, which is why step 1 includes them.
Yolo means something different in each tool. These seven steps are for Claude Code. Codex’s --yolo drops the sandbox and the approvals. On Antigravity, --dangerously-skip-permissions removes hooks entirely, ACP’s included, which we verified. Cursor’s Run Everything mode has no sandbox, no classifier and no prompts. If you run more than one agent, the table for all of them is Bypass Permissions Safely. The view by control mechanism is harness control patterns.
Where this leaves you
The flag removes the one control that never scaled, a person reading every command. What stays is the rules you wrote in advance and a check that runs outside the prompt. Write the denies, turn on the sandbox, and add one check the flag can’t reach.
The Claude Code behavior above comes from Anthropic’s docs and our control-model page, as of August 28, 2026. The ACP behavior comes from the installer, which is plain text you can read top to bottom. Tools change, and we correct these pages in public when they do.
Can you run Claude Code in yolo mode safely?
Safely enough for ordinary work, if you do three things first. Write deny rules for the command families you never want run (deny beats allow at every scope and survives bypassPermissions). Put anything that must hold in a PreToolUse hook (hooks fire in every permission mode, and a hook deny is unconditional). Turn on the sandbox with /sandbox. Without those, bypass mode does what its name says: the prompts were the only thing between the agent and the command, and you removed them.
What does --dangerously-skip-permissions actually turn off?
Only the interactive permission prompts. It sets the session to bypassPermissions, which auto-allows every call that Claude Code’s permission system would have asked about. Deny rules at every scope, explicit ask rules, PreToolUse hook blocks, MCP tools flagged as requiring interaction, and an rm -rf circuit breaker that fires even inside command substitution all still apply. The mode also refuses to run as root.
How do I disable yolo mode for my whole team?
Set permissions.disableBypassPermissionsMode in managed (org-deployed) settings and the mode is gone. Add allowManagedHooksOnly so a user or project setting cannot override your hooks. Both are files on the endpoint, so both assume you manage the endpoint. If you don’t, the control that holds has to live somewhere the endpoint cannot edit.
Do hooks still run with --dangerously-skip-permissions?
Yes, in Claude Code. PreToolUse fires on every tool call in every permission mode, and exit code 2 or permissionDecision deny blocks the call unconditionally. One caveat runs the other way: when this post was written, a Claude Code hook that timed out let the call through. Check the current docs for the onFailure setting before you rely on a hook for anything that must hold. Other harnesses differ. On Antigravity the same flag removes hooks entirely.
Running Claude Code? One command adds a hook. Each tool call is recorded, the session's model calls are priced, and a force-push, destructive SQL or curl | sh waits for your OK in the session.
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
irm https://agenticcontrolplane.com/install.ps1 | iex
What the installer writes · Claude Code guide · free up to 5 agents