Claude Code --dangerously-skip-permissions: Risks and Safer Team Controls
Claude Code --dangerously-skip-permissions explained: what it skips, what it still enforces, the risks, and the managed settings and checklist a team can use instead.
This page explains what Claude Code's --dangerously-skip-permissions flag does, what it still doesn't skip, the risks of running it on a work machine, and the safer settings a team can use instead. It ends with a managed settings file to copy and a checklist for engineering and risk leads at UK regulated firms.
For a full guide to permission modes, allow and deny rules and hooks, see Claude Code permissions. This page is about the one flag people search for most.
What --dangerously-skip-permissions does
The flag starts Claude Code in bypassPermissions mode. The Claude Code docs say the flag is equivalent to --permission-mode bypassPermissions, and that this mode "disables permission prompts and safety checks so tool calls execute immediately, including writes to protected paths."
- No prompts. Shell commands, file edits, web fetches and MCP tool calls run without asking.
- Allow rules stop mattering. The docs: "Allow rules have no effect in
bypassPermissions." Everything is already allowed. - Deny rules still apply. Deny rules "block in every mode, including
bypassPermissions." This is the main lever you keep. - Protected paths open up. Writes to folders such as
.git,.claude,.vscodeand.husky, and files such as.bashrc,.zshrc,.gitconfig,.npmrcand.mcp.json, are allowed in this mode and protected in the others. - Not as root. On Linux and macOS, Claude Code refuses to start in this mode as root or under sudo. The check is skipped inside a recognised sandbox.
A related flag, --allow-dangerously-skip-permissions, adds bypass mode to the Shift+Tab cycle without turning it on at the start.
What it still doesn't skip
Bypass mode is not "anything goes". The docs list actions that no mode approves on its own.
| Still enforced in bypass mode | What happens |
|---|---|
| Deny rules | The call is blocked. |
Explicit ask rules | You are still asked. |
| Tools that need you to answer (for example a question to the user) | Still wait for you. |
Recognised rm or rmdir on critical paths (the filesystem root, your home directory, the working directory) | In the terminal you're asked to approve before a time limit runs out. In the VS Code panel and desktop app they're denied unless a hook allows them. |
Reads outside the working directories, when permissions.blockReadsOutsideWorkingDirectories is on | Still controlled. |
| The sandbox, if you turned it on | Bash commands stay inside its filesystem limits, and hosts in deniedDomains stay blocked. But hosts outside your allowed domains are allowed without a prompt unless strictAllowlist or allowManagedDomainsOnly is on. And if a command fails in the sandbox and Claude retries it outside, bypass mode approves that retry without a prompt unless you set strict sandbox mode. |
Permission modes compared
Most people reach for the flag because they are tired of prompts. There are five other modes, so the question is usually which one fits, not whether to skip everything.
| Mode | What runs without asking | Good for |
|---|---|---|
default | Reads only | Sensitive repos, first use |
acceptEdits | Reads, file edits and common file commands in the working directory | Day-to-day coding where you review the diff |
plan | Reads; edits wait until you approve a plan | Exploring a change before making it |
auto | Everything, with background safety checks by a classifier | Fewer prompts with some protection left |
dontAsk | Reads in the working directories and pre-approved tools; anything else is denied | Locked-down CI |
bypassPermissions | Everything | The docs say: "Isolated containers and VMs only" |
Shift+Tab cycles default, acceptEdits and plan. Start in another mode with claude --permission-mode <mode>, or set permissions.defaultMode in a settings file. A project's .claude/settings.json can't switch on auto or bypassPermissions, so a cloned repo can't put you in bypass mode by itself.
The risks of skipping permissions
Prompt injection
The docs are direct: "bypassPermissions offers no protection against prompt injection or unintended actions." Anything Claude reads (a README, an issue, a web page, an MCP tool result) can carry instructions. With prompts off, nothing stops Claude acting on them. Our post on MCP limitations and challenges covers how this has played out with real MCP servers.
Credentials leave with the agent
Claude Code runs with your user's access. The dev container docs warn that, with this flag, a dev container doesn't stop "a malicious project from exfiltrating anything accessible inside the container, including the Claude Code credentials stored in ~/.claude." They also say to avoid mounting ~/.ssh or cloud credential files into the container. On a laptop, that's every key in your home directory.
Changes that outlive the session
Protected paths are writable in bypass mode. A write to .git hooks, .bashrc or .mcp.json can run code or add a tool long after the session ends.
MCP tools act on company systems
Every MCP tool call also runs without a prompt. If Claude Code is connected to GitHub, Gmail or a database, bypass mode lets it merge, send or delete there too. Our guide to Claude Code MCP servers covers how to scope those connections.
The sandbox doesn't cover everything
Claude Code's sandbox limits Bash commands. Read, Edit, Write, WebFetch and WebSearch run outside it and follow permission rules instead, and so do local MCP servers and hooks. The sandbox runs on macOS, Linux and WSL2; on native Windows, commands run unsandboxed. It is off by default.
When it is reasonable to use
The docs give one answer: "Only use this mode in isolated environments like containers, VMs, or dev containers without internet access, where Claude Code cannot damage your host system." In practice:
- A disposable container or VM, running as a non-root user, with no host secrets mounted.
- Outbound network limited to the domains the job needs (the reference dev container ships a firewall script for this).
- A clean git branch, so every change can be reviewed and thrown away.
- A headless CI job such as
claude -p "<prompt>" --dangerously-skip-permissions, inside that container.
It is not reasonable on a developer laptop with production credentials, a signed-in browser and company MCP servers connected.
Safer options for teams
- Use auto mode for fewer prompts with background safety checks. The docs point to it as the alternative to bypass mode.
- Use acceptEdits plus allow rules for the commands your team runs all day, such as
Bash(npm run *). Rules are checked in the order deny, then ask, then allow. - Use dontAsk in CI, with an explicit list of allowed tools. Anything else is denied, not asked.
- Turn on the sandbox with
/sandbox. Network access goes through a proxy that checks each host against an allowed-domains list, which starts empty. - Write deny rules for secrets and irreversible commands. They hold in every mode.
- Add hooks. A
PreToolUsehook runs before a tool call and can block it (exit code 2). Test that your hooks fire the way you expect in each mode you allow. - Turn bypass mode off centrally with managed settings, below.
Managed settings to copy
Managed settings apply "above every other level, so no user, project, local, or --settings value overrides them" (managed settings docs). Put this file at:
- macOS:
/Library/Application Support/ClaudeCode/managed-settings.json - Linux and WSL:
/etc/claude-code/managed-settings.json - Windows:
C:\Program Files\ClaudeCode\managed-settings.json
You can also push it through MDM or as server-managed settings from the Claude admin console.
{
"permissions": {
"disableBypassPermissionsMode": "disable",
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Read(~/.ssh/**)",
"Read(~/.aws/**)"
],
"ask": [
"Bash(git push *)"
]
},
"sandbox": {
"enabled": true,
"failIfUnavailable": true
}
}disableBypassPermissionsMode: "disable"rejects the--dangerously-skip-permissionsflag across the machine.- The deny rules keep Claude's Read tool away from local secrets. They don't stop a subprocess reading those files: that needs the sandbox.
failIfUnavailablemakes Claude Code exit at startup if the sandbox can't start, instead of running commands unsandboxed.- Add
"allowManagedPermissionRulesOnly": trueat the top level if you want managed rules to be the only permission rules. Claude Code then ignores allow, ask and deny rules in user and project files.
Start small. Pin the settings in a test group, check developers can still work, then roll out.
What a UK regulated firm should be able to show
The FCA has said "We do not plan to introduce extra regulations for AI" (AI and the FCA: our approach). Its October 2026 page on AI in financial services: good practice and areas for improvement shows what supervisors look for. Its examples are "illustrative, non-exhaustive" and "do not create new requirements" (section 1.2), but they map closely to coding agents:
- Governance first (3.1): "Before deploying more autonomous agentic systems, firms designed a suitable governance structure." Decide where bypass mode is allowed before anyone uses it.
- Logging (3.2): good practice includes "Logging and audit trails of AI interactions". With prompts off, the log is the only record of what the agent did.
- Human oversight (3.4): "Firms did clear risk assessments to see where they needed human oversight, and what it should look like." Bypass mode removes the human step, so your risk assessment should say where that is acceptable.
- Inventory (3.5): firms "registered their agents in a central inventory", giving a view of "which agents are live, who owns them, what systems and data they can access".
- Third parties (4.2): "Firms can outsource AI services, but remain responsible for them."
For logging, Claude Code can export OpenTelemetry events when CLAUDE_CODE_ENABLE_TELEMETRY=1 is set with an exporter (monitoring docs). The claude_code.tool_decision event records the tool, the decision, its source and the permission mode. Our AI audit trail guide has a schema to copy.
Checklist to copy
- Bypass mode is disabled in managed settings on every staff machine.
- Where bypass mode is allowed (named containers or CI jobs) is written down, with an owner.
- Those environments run as a non-root user, with no host secrets mounted and outbound network limited.
- Deny rules cover
.envfiles, SSH keys and cloud credentials. - The sandbox is on, with
failIfUnavailableset. - CI uses
dontAskwith an explicit tool list, or bypass mode inside a disposable container. - MCP servers are on an allowlist, and each one's tools are scoped to what the job needs.
- Telemetry or another log records every tool call, with the user and permission mode.
- Each coding agent setup is in the firm's AI inventory: owner, systems, data, controls.
- The risk assessment says where a person must approve actions, and someone reviews it.
Common mistakes
- Aliasing the flag. A shell alias makes bypass mode the default on a laptop that was never meant to run it.
- Copying an allow list with
Write(*)orBash(curl *). These open far more than the task needs. - Trusting a container that mounts the home directory. If
~/.sshor~/.awsis inside, so is the risk. - Relying on Bash deny rules alone. The docs call Bash patterns that try to constrain arguments "fragile". Use the sandbox for real limits.
- Forgetting MCP. Bypass mode skips prompts on MCP tools as well as the shell.
How ContextGate helps
Bypass mode turns off Claude Code's prompts. It doesn't turn off controls that sit outside Claude Code. ContextGate is one governed MCP connection for Claude Code and your other AI apps, so the rules for company tools hold whatever mode a developer runs in.
- Tool switches. Switch off any tool on a connection. Tools you switch off are hidden from Claude Code and refused if called. In approval mode, new tools arrive switched off.
- Policies. Block, warn on or log tool calls, and redact personal data such as UK sort codes and National Insurance numbers before results reach the model.
- Activity log. Each call is recorded with the AI app, user, tool, arguments, redacted result and policy outcome.
- Claude Code's own tools. With the ContextGate desktop app, workspace policies can also cover Claude Code's own tools, such as Bash and file edits.
- Reports. The AI security review pack and the SM&CR reasonable-steps pack are available now and are built from the activity log.
What ContextGate doesn't cover: it doesn't change Claude Code's permission mode, replace the sandbox or a container, or stop a shell command reaching the network on its own. Keep managed settings and isolation in place; ContextGate adds the policy and the record.
Setup is one command: see ContextGate for Claude Code, and AI agent governance for the wider picture.
Sign up free and connect Claude Code in a few minutes.
Questions people ask
What does dangerously skip permissions do in Claude Code?
It starts Claude Code in bypassPermissions mode: tool calls run without prompts, allow rules stop mattering and protected paths become writable. Deny rules, explicit ask rules and a few critical deletes are still enforced.
How do I stop Claude Code asking for permission?
Without skipping everything: use acceptEdits with allow rules for the commands you trust, auto mode for background safety checks, or the sandbox, which lets sandboxed commands run without a prompt each time.
Can an admin stop people using --dangerously-skip-permissions?
Yes. Set permissions.disableBypassPermissionsMode to "disable" in managed settings. Claude Code then rejects the flag, and no user or project setting can override it.
Is --dangerously-skip-permissions safe in a dev container?
Safer, not safe. The docs say a dev container doesn't stop a malicious project exfiltrating what's inside it, including Claude Code's own credentials. Run as a non-root user, mount no host secrets and limit the network.
Does --dangerously-skip-permissions ignore deny rules?
No. Deny rules block in every mode, including bypass mode.
Why does Claude Code refuse the flag as root?
On Linux and macOS it won't start in bypass mode as root or under sudo, for security reasons. The check is skipped inside a recognised sandbox.
A summary, not legal advice. Claude Code changes often: check the current docs before you roll out settings. FCA material is quoted from the pages linked above, read 23 November 2026.