AgentCop

Guide · Coding agents · Read in the Claude Code docs on 19 November 2026

Claude Code --dangerously-skip-permissions, without losing a server.

Short answer. --dangerously-skip-permissions starts Claude Code in bypassPermissions mode: it edits files, runs shell commands and reaches the network without asking you first. Deny rules still block, and a short list of actions still prompts, but allow rules stop mattering. Anthropic's documentation says to use it only in an isolated container or VM. If what you want is fewer prompts on your own machine, acceptEdits, the sandbox in auto-allow mode or auto mode remove most of them and keep a check in place.

What does --dangerously-skip-permissions do?

The flag is a shortcut for --permission-mode bypassPermissions. In that mode Claude Code skips its permission prompts, including the ones for writes to protected paths such as .git and .claude. It is one of six permission modes, and the only one the documentation reserves for "isolated containers and VMs only".

terminalthree ways to reach the mode
claude --dangerously-skip-permissions
claude --permission-mode bypassPermissions
claude --permission-mode plan --allow-dangerously-skip-permissions   # adds it to Shift+Tab, starts in plan

Two details catch people out. Allow rules have no effect in this mode, because nothing is waiting for approval. And a project's .claude/settings.json cannot switch a session into it: a defaultMode of bypassPermissions there is ignored, so a cloned repository cannot turn your prompts off for you.

What does bypassPermissions still block?

The mode removes prompts, not every control. According to the permission modes page, these still apply:

Still activeWhat happens
Deny rulesA rule in permissions.deny blocks the call in every mode, bypassPermissions included. Allow rules, by contrast, have no effect in this mode.
Explicit ask rulesA tool matched by an ask rule still prompts. Use one for the few commands you want to see every time.
Critical-path removalsRecognized rm and rmdir commands on a critical path still go through the permission flow; no allow rule or hook approves them.
Tools that need a personAskUserQuestion and MCP tools marked as requiring user interaction.
Organization connector rulesConnector tools your organization set to ask still prompt, when that setting reaches your session.
Reads and writes outside the projectOnly when you turn on blockReadsOutsideWorkingDirectories or blockWritesOutsideWorkingDirectories. Off by default.

A PreToolUse hook also keeps running and can deny a call; the hook receives the current mode in its input. So deny rules and hooks are the two levers you keep. Everything you did not deny runs.

What can go wrong without prompts?

The damage often comes from an ordinary request, with no attacker involved. We lived through one: a coding agent driving a server from PowerShell was asked to move a folder and sent ssh root@vps "mv $SRC/* $DST/". PowerShell expanded both variables locally, they were empty, and the server received a mv from the root. It did not come back.

Each command below answers a reasonable request and destroys something on the way. A permission prompt is the moment a person reads the target; without it, the command runs.

What was askedWhat the agent runsWhat happens
Move the old release on the serverssh vps "mv $SRC/* $DST/"Run from PowerShell, the variables expand empty on the local side: the mv starts from the root.
Delete the build folderrm -rf /$DIR$DIR is empty, so the command becomes rm -rf /.
Deploy the buildrsync -a --delete ./build/ vps:/--delete to the root: everything not in the build is wiped.
Get the repo cleangit reset --hard && git clean -fdxUncommitted work and ignored files, your .env included, are gone.
Free up some disk spacedocker system prune -af --volumesVolumes go with the images, and the containers' databases with them.
Tear down the test environmentterraform destroy -auto-approveIn the wrong workspace, production goes, with no confirmation.

The full list of 15 commands, with what a guard should do for each, is in the free agent shell guard kit. When we replayed 12 of them against detection rules that look for patterns such as rm -rf, only one fired: the risk sits in the target and in variables that can be empty, more than in the command name.

The other risk is content. With prompts off, an instruction hidden in a README, an issue or a web page the agent reads goes straight to execution. Our prompt injection examples show what a current model did with 13 of them.

What are the safer alternatives?

Most people who reach for the flag want one specific prompt gone. Pick the narrowest option that removes it.

You wantUseWhat runs without asking
Fewer prompts while you watch--permission-mode acceptEditsFile edits and common filesystem commands in the project run without asking; other commands still prompt.
Long tasks with a safety check--permission-mode autoNo routine prompts; a background classifier checks shell commands and network requests against your request before they run.
Shell commands without prompts, inside a boundary/sandbox, then auto-allowSandboxed commands run without asking; writes stay in the project and temp folders, network goes through an allowlist. macOS, Linux and WSL2.
Specific commands pre-approved--allowedTools "Bash(npm test *)"Only the commands you list skip the prompt; everything else asks.
Unattended CI that never waits--permission-mode dontAskAnything that would prompt is denied instead; pre-approved tools and project reads still run.
No prompts at all--dangerously-skip-permissionsSame as --permission-mode bypassPermissions. For isolated containers and VMs only.

The sandbox row is the one most teams overlook. It removes prompts for shell commands and adds an operating-system boundary at the same time: commands can write to the project and temp folders only, and outbound connections go through a proxy that checks each host against an allowlist that starts empty. It runs on macOS, Linux and WSL2; on native Windows, commands run unsandboxed. Our Claude Code security guide covers strict sandbox settings for a team.

How do you run --dangerously-skip-permissions safely?

If you need fully unattended runs, put the flag inside a boundary that limits what a bad command can reach. In order:

.claude/settings.jsona starting point inside the container
{
  "permissions": {
    "deny": [
      "Bash(git push *)",
      "Bash(terraform destroy *)",
      "Bash(kubectl delete *)",
      "Read(./.env)",
      "Read(./secrets/**)"
    ],
    "blockReadsOutsideWorkingDirectories": true
  },
  "sandbox": {
    "enabled": true,
    "allowUnsandboxedCommands": false,
    "failIfUnavailable": true
  }
}

failIfUnavailable makes Claude Code exit at startup when the sandbox cannot start, instead of silently running commands without it. Add a PreToolUse hook for checks a pattern cannot express, such as refusing any command whose target resolves to /.

How do you turn it off for a team?

Set permissions.disableBypassPermissionsMode to "disable" in managed settings. Managed settings cannot be overridden by users, so the flag, the mode and its place in the Shift+Tab cycle stop working on every managed machine. permissions.disableAutoMode does the same for auto mode. A developer can also set the key in their own settings to lock themselves out of the mode.

In the desktop app, the mode only appears once "Allow bypass permissions mode" is on in its settings, and on Team and Enterprise plans organization policy controls that toggle.

Skip-permissions questions.

What does --dangerously-skip-permissions do in Claude Code?

It starts Claude Code in bypassPermissions mode, the same as --permission-mode bypassPermissions. Claude runs file edits, shell commands and network calls without asking, including writes to protected paths such as .git and .claude. Deny rules, explicit ask rules and a few critical actions still stop or prompt.

Is --dangerously-skip-permissions safe?

Only inside an isolated container or VM, which is what Anthropic's documentation says. On your own machine, one wrong command runs with your account's rights. Even in a container, a malicious repository can send out anything the container holds, including the Claude Code credentials in ~/.claude, unless outbound traffic is restricted.

How do I stop Claude Code from asking for permission?

Pick the narrowest option that removes the prompts you mind: acceptEdits for file edits, an allow rule such as Bash(npm test *) for specific commands, the sandbox in auto-allow mode for shell commands, or auto mode for long tasks. Keep --dangerously-skip-permissions for containers.

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

No. The CLI rejects the flag when launched as root. In a dev container, set remoteUser to a non-root account before you rely on it.

What is the difference between bypassPermissions and auto mode?

bypassPermissions runs everything without a check, apart from deny rules and a short list of exceptions. Auto mode also runs without routine prompts, but a background classifier reviews shell commands and network requests against your request before they run, and it prompts or blocks the ones that do not fit.

How do I disable --dangerously-skip-permissions for my team?

Set permissions.disableBypassPermissionsMode to "disable" in managed settings. Users cannot override managed settings, so the flag, the mode and the Shift+Tab option all stop working on those machines. permissions.disableAutoMode does the same for auto mode.

Sources