PTS security notes / Questions

Is it safe to let Claude Code run without approvals?

By PTS · Published December 5, 2026 · Docs checked December 5, 2026

Short answer

Not if you mean bypass mode: Anthropic's docs say bypassPermissions belongs in isolated containers and VMs only, and that it offers no protection against prompt injection or unintended actions. Auto mode is the middle path, because a separate classifier reviews actions before they run, but the docs say it reduces prompts and does not guarantee safety.

What "without approvals" can mean

Claude Code has six permission modes. Here is what runs without asking in each, from Anthropic's table (permission modes):

ModeWhat runs without askingAnthropic's suggested use
default (Manual)File reads inside your working directories, plus actions that need no approvalSensitive work, unfamiliar code
acceptEditsReads, file edits, and common filesystem commands such as mkdir, touch, mv and cpIterating on code you are reviewing
planReads, plus classifier-approved commands when auto mode is availableExploring a codebase before changing it
autoEverything, with background safety checksLong tasks, reducing prompt fatigue
dontAskFile reads in your working directories and pre-approved tools. Anything that would prompt is deniedLocked-down CI and scripts
bypassPermissionsEverythingIsolated containers and VMs only

So "no approvals" is two different things. auto swaps you for a reviewer. bypassPermissions removes the review.

Auto mode: fewer prompts, still a check

In auto mode a separate classifier model reviews actions before they run and blocks the ones it judges risky. The docs say it looks for actions that go beyond your request, target unrecognized infrastructure, or follow hostile content Claude read. From Claude Code v2.1.283 it is the built-in starting mode for interactive terminal and VS Code sessions.

Anthropic is direct about the limit: auto mode "reduces permission prompts but does not guarantee safety," and is for tasks where you trust the general direction, not for sensitive operations. If the classifier blocks an action 3 times in a row or 20 times in total, Claude Code pauses auto mode and goes back to prompting.

Bypass mode: what it still blocks, and what it does not

You start it with claude --permission-mode bypassPermissions or the older --dangerously-skip-permissions flag. It disables permission prompts and safety checks, including for writes to protected paths such as .git and .claude. The docs warn that it "offers no protection against prompt injection or unintended actions." Prompt injection means text the agent reads, such as a web page, an issue or a cloned repo's files, carries instructions the agent then follows.

What still applies in bypass mode:

Where it is reasonable

Inside a container or VM that holds nothing you would mind losing, on a repo you trust. Anthropic's dev container docs allow --dangerously-skip-permissions for unattended work there, run as a non-root user, and then add a warning: a malicious project can still exfiltrate anything reachable inside the container, including the Claude Code credentials in ~/.claude (dev containers). So:

On your everyday laptop, with your cloud logins and keys in reach, skip it.

A safer starting setup

Put this in ~/.claude/settings.json, then test it on a throwaway project first:

json
{
  "permissions": {
    "deny": ["Read(./.env)", "Read(./.env.*)"],
    "disableBypassPermissionsMode": "disable"
  },
  "sandbox": {
    "enabled": true,
    "allowUnsandboxedCommands": false
  }
}

disableBypassPermissionsMode stops anyone from entering bypass mode, and a session started with the flag opens in another mode. Admins normally set it in managed settings. In your own user file it is a seatbelt for you, not a policy. The sandbox is off by default, sandbox.enabled turns it on, and allowUnsandboxedCommands: false removes the retry-outside-the-sandbox escape hatch.

To check a settings file you already have, paste it into the free Claude Code settings scanner. It runs in your browser and flags wide allow rules, saved secrets and missing guardrails.

Fewer prompts without bypass

  1. Use auto mode, or acceptEdits when you are reviewing the diff anyway.
  2. Turn on the sandbox with /sandbox. In auto-allow mode, sandboxed commands run without a prompt, while deny rules and ask rules like Bash(git push *) still apply.
  3. Add narrow allow rules for commands you run all day, such as Bash(npm run test *), instead of allowing everything.
  4. For a session nobody is watching, set permissions.denyInsteadOfPrompting to true in your user or managed settings, or use dontAsk mode. Calls that would have prompted are denied and the session keeps going.

The sandbox wraps shell commands only. Claude's file tools, local MCP servers and hooks run outside it, so keep deny rules and an MCP review in place too.

Quick follow-ups

Does --dangerously-skip-permissions turn off my deny rules?

No. Anthropic's docs say deny rules block in every mode, including bypassPermissions. Allow rules have no effect in that mode, because everything is already allowed.

Can I use it inside Docker?

Anthropic's dev container setup is built for it, with a non-root user. The docs still warn that a malicious project can exfiltrate anything reachable inside the container, so keep host secrets out of it and limit network access.

Can a repo I clone switch bypass mode on?

No. If bypassPermissions is set as defaultMode in a project's .claude/settings.json or .claude/settings.local.json, it does not take effect and the session starts in Manual mode.

Sources

See also the glossary and the other questions.

Get the free checklist

A 9-page worksheet plus starter files for Claude Code and Codex. Download it on Gumroad. This site does not collect email.

Get the free checklist

Wallet side of things? Get Don't Get Drained, also free. Or get both in one checkout.

Related guides

More questions