With Claude Code --dangerously-skip-permissions, the agent stops asking before it edits a file, runs a shell command or calls an MCP tool. People call it YOLO mode. Anthropic’s docs say to use it only in a container or VM without internet access, and few coding tasks fit that: the agent has to reach a model API, a git host and a package registry at the very least.
We already run Formal Endpoint on our own laptops to monitor and control coding agents, so we care about what gets checked once Claude Code permissions stop asking. Inside Claude Code, the list is short.
What does Claude Code --dangerously-skip-permissions do?
Claude Code --dangerously-skip-permissions is a shortcut for claude --permission-mode bypassPermissions. According to Anthropic’s permission modes documentation, that mode runs tool calls immediately, with no prompt and no safety checks, including writes to the protected paths that hold repository state and Claude’s own configuration. The session keeps your user’s full access to files, credentials and the network.
Three things survive. Deny rules still block, in this mode as in every other, while allow rules go quiet because nothing is left to allow. A short list of actions keeps stopping for a prompt or a denial; the one people run into is rm or rmdir aimed at a critical path such as your home directory, and bypass mode even lets you switch that prompt off. Anthropic notes that the check only recognizes those two commands, so in this mode a find ~ -delete runs like anything else. Finally, on Linux and macOS, the mode won’t start as root or under sudo.
None of these checks look at intent. The same docs page says the mode “offers no protection against prompt injection or unintended actions,” and that matters most when the agent spends its day reading issues, web pages and dependencies that strangers wrote.
Turning on bypass permissions
You pick the mode when the session starts. A session launched without it can’t switch into it later. These are the flag and its equivalents, as Anthropic’s docs list them:
claude --dangerously-skip-permissions
claude --permission-mode bypassPermissions
# non-interactive: prompt in, result out
claude -p "<prompt>" --dangerously-skip-permissions
There are two quieter routes. --allow-dangerously-skip-permissions adds bypass permissions to the Shift+Tab cycle without entering it, and permissions.defaultMode: "bypassPermissions" in user or managed settings opens every session there. A cloned repository can’t opt you in: the same value in a project’s .claude/settings.json or .claude/settings.local.json is ignored, and the session starts in Manual mode.
The first interactive bypass session shows a warning you have to accept. Accepting it writes skipDangerousModePermissionPrompt: true to ~/.claude/settings.json, and that machine never shows the dialog again. Bake that file into a VM or container image and every machine started from the image skips the warning too.
For an organization, one managed setting removes the mode:
{
"permissions": {
"disableBypassPermissionsMode": "disable"
}
}
We’d put it on every laptop with production credentials on it. It covers the flag, the Shift+Tab route and the settings default in one place. Network controls only see a session once it’s running, and this key stops it from starting.
Auto mode vs dangerously-skip-permissions
Since Claude Code v2.1.283, interactive terminal and VS Code sessions start in auto mode, so on a current version the flag mostly trades one reviewer for none. In auto mode, a classifier model looks at each action that isn’t a plain read or an edit in your working directory, and approves or blocks it. Anthropic is direct about it: auto mode “does not guarantee safety.” It also needs a supported model (Sonnet 4.5 and older don’t qualify), and an administrator can turn it off with permissions.disableAutoMode.
| Auto mode | dontAsk | bypassPermissions | |
|---|---|---|---|
| Who approves an action | A classifier model | Your pre-approved list; everything else is denied | Nobody |
| Deny rules | Apply | Apply | Apply |
| Anthropic’s suggested use | Long tasks, fewer prompts | Locked-down CI and scripts | Isolated containers and VMs only |
One classifier rule is easy to miss. Among the actions auto mode blocks is launching an autonomous agent loop with no human approval and no sandbox, and Anthropic’s example is a command started with --dangerously-skip-permissions. An auto-mode session that tries to spawn a bypass-mode child should get stopped.
The Bash sandbox in auto-allow mode is the other way to cut prompts. Sandboxed commands run without asking inside an OS boundary on writes and destinations, but by default they can read ~/.ssh and ~/.aws/credentials, and the sandbox proxy checks hostnames without opening TLS. Our Claude Code sandbox post covers that boundary in detail. On a laptop, we’d run auto mode and the sandbox together and save bypass for machines we’re willing to delete.
What can go wrong in Claude Code YOLO mode?
Claude Code YOLO mode gives the agent no capability it lacked with prompts on. It removes the step where you read a command before it runs, so the outcome depends on what the session can reach: the files and data your user can read, the domains your network allows, and credentials that work beyond the machine.
Picture an agent working through an issue whose body carries instructions planted for it. Two tool calls would do: copy .env into a package directory, then npm publish. The npm registry is on nearly every allowlist because installs need it. With prompts on, the publish would have stopped in front of you. Drew Gregory listed that route, along with a GitHub gist and a connection to any IP on port 22, when he took apart Anthropic’s devcontainer firewall.
Allowlisting commands doesn’t close this either. In November 2025 Drew showed that once go test, eslint or make run without a prompt and the agent can edit files, it can run any command through them. Deny rules have the mirror problem. A deny rule on git push stops the agent typing git push, and does nothing about make release when the Makefile pushes.
The highest-risk outcomes leave the machine. A push to a repository you care about, auto-merge on a pull request, a DELETE against a production API: deleting the VM afterwards undoes none of them. OWASP’s AI Agent Security Cheat Sheet asks for explicit approval before high-impact or irreversible actions, with authorization enforced in the component that executes them, outside the agent’s context. In bypass mode Claude Code has no such component, so that check has to run somewhere the agent can’t edit.
How to run Claude Code YOLO mode safely
Our setup keeps Anthropic’s isolation advice and drops the no-internet part. It has four pieces, and Claude Code helps with the first one only.
A machine you can throw away
Run the session in a VM or dev container that holds the repository and little else, as a user without sudo. The root refusal enforces part of this; the rest is image hygiene, including that warning flag in ~/.claude/settings.json.
Egress inspected per request
Transparent Mode intercepts connections in the operating system’s network stack and terminates TLS with a local Formal CA, for the flows a network rule selects. Flows no rule selects pass through untouched and unlogged, so your rules are the list of destinations you’ve decided to care about. The agent itself needs no CA setup: the Endpoint adds the CA variables to ~/.claude/settings.json.
VMs get a headless Linux package that runs as a systemd user service. Containers are less tidy. Transparent interception needs the NET_ADMIN capability, which platforms like AWS Fargate don’t grant, and the fallback is explicit proxy mode on a loopback port with HTTPS_PROXY set. The docs are clear that a client ignoring those variables connects directly and isn’t inspected. For an agent with no prompts, we’d pick a VM over a container that can’t get NET_ADMIN.
To confirm a rule matches, run curl -v against the destination from inside the VM. The cloud agents guide shows what an intercepted flow prints:
subject: O=Formal; CN=Formal Desktop Certificate
issuer: C=US; ST=New York; L=New York; O=Formal; CN=Formal Desktop Local CA
SSL certificate verify ok.
If you see the destination’s own certificate instead, no rule matched and the request went straight out.
Keys the session never holds
An API key the agent can read is one it can publish. So the key lives on a Formal Connector instead: the Endpoint forwards selected requests there, and the Connector, which stores the real key as a Native User, adds it on the way upstream. In our Stripe guide the client keeps calling https://api.stripe.com with no credential at all. Drew’s proxies post does the same for Anthropic, with the agent running on ANTHROPIC_API_KEY=sk-ant-dummy and every response coming back as if that key were real.
Telling the agent’s git push from yours
A push is the action we’d least want an unattended agent to take, and Claude Code can’t block it well on its own. Git has three ways to reach GitHub (plain SSH, SSH tunneled through ssh.github.com on 443, and HTTPS), and a script can push on the agent’s behalf. Our guide to blocking agent git pushes does it in two parts. First, a network rule selects git traffic to GitHub from a known agent and every process it spawns:
{
"condition": {
"pre_tcp": process.has_agent_ancestor,
"pre_tls": hostname in ["github.com", "ssh.github.com"],
"post_tls": technology in ["http", "ssh"]
}
}
process.has_agent_ancestor uses code-signed process identity, which macOS has. A git or ssh that the agent started matches; the same command typed in your own terminal doesn’t. The policy half keys on git-receive-pack. Every push runs it on GitHub’s side, whether it arrives as an SSH command or as a POST to <repository>/git-receive-pack, and the policy refuses it for the repositories you name. A clone or fetch runs git-upload-pack instead, so the agent can keep pulling code.
A few details from the guide matter once it’s live. Repository names are matched as substrings: protect acme/payments and you’ve protected acme/payments-legacy along with it. The documented policy works per repository and has no branch condition. And an mfa action can take the block’s place, so the agent waits until you confirm the push on your device. Dry-run records what the policy would have blocked without blocking anything, which is the state to leave it in until you’ve read those matches.
On Linux there’s no signing identity, so agent flags match the process name instead. The cloud agents guide scopes its GitHub rule to the agents’ machine users for that reason.
Detecting sessions that skipped their prompts
Formal policies can see how Claude Code was launched. When the Endpoint recognizes an agent, the policy input gets an input.agent object: the agent type (claude-cli for Claude Code), its version, the LLM provider, the provider’s session ID, and yolo_mode, which is true when the session was started with --dangerously-skip-permissions. This example from the policy evaluation docs refuses every such session:
package formal.v2
import future.keywords.if
default session := {"action": "allow"}
session := {"action": "block", "type": "block_with_formal_message"} if {
input.agent.yolo_mode == true
}
Blocking all of them suits laptops with production access. On a disposable VM, we’d add a condition on input.resource, so those sessions keep working against test systems and get refused at the databases and APIs that matter. The block reaches the agent as an ordinary error. When Drew tested a request policy against the Anthropic API, the agent printed:
API Error: 403 {"error":"Connection blocked by policy policy_01k8vrfkefm4vnjyv024fhakp: "} · Please run /login
After an incident, the provider session ID is the useful field: it ties a blocked request to the Claude conversation that sent it.
We don’t let this policy carry the whole load, for two reasons. yolo_mode is documented for the launch flag, so a session that reached bypass through --permission-mode bypassPermissions, Shift+Tab or a settings default isn’t covered by what the docs promise. And input.agent is empty for traffic that didn’t go through the Endpoint, which in practice means any flow no network rule intercepted. We treat it as a backstop and an audit trail; disableBypassPermissionsMode is what keeps the mode off.
Unattended runs in CI and cloud agents
CI is where the flag turns up most, since nobody is around to answer a prompt. In a -p run, the few calls that would still prompt under bypass are denied instead.
Anthropic’s setup table offers a narrower option for CI, --permission-mode dontAsk with an exact --allowedTools list such as Bash(npm test), and we’d use it. Drew’s research applies to it, though: npm test runs whatever package.json says, and the agent can edit package.json, so the runner needs the egress rules you’d give a bypass VM.
Cloud agent VMs add a question about identity. Our cloud agents guide installs the headless Endpoint in each Cursor or Devin VM and signs it in with an OIDC token the platform mints, so no Formal API key sits on the machine. The integration maps each run to the person behind it (claims.owner_email on Cursor, claims.requesting_user_email on Devin), and the Endpoint config keeps Transparent Mode locked on:
auth_mode = "oidc"
[oidc]
provider = "cursor"
integration_id = "integrationoidc_<INTEGRATION_ID>"
[transparent_proxy]
enable = true
enforce = true
fail = "closed"
For an agent with no prompts we’d always set fail = "closed", so an Endpoint error stops traffic rather than letting it out unchecked (OWASP’s cheat sheet asks for the same when a policy lookup or audit log fails).
Merging on GitHub goes through one of three GraphQL mutations (enablePullRequestAutoMerge, enqueuePullRequest, mergePullRequest) or a REST PUT on /pulls/<number>/merge, and the guide’s policy refuses all four. The agent can open a pull request. A person merges it. Aditya Saligrama wrote about how we use the same OIDC integrations to give our own cloud agents short-lived, approval-gated access to production data.
Cursor runs its Cloud Agents through Formal with a dedicated identity, and end-user identity propagation adds the employee who started each task:
“We’ve limited the amount of data that those cloud agents can access and we’re able to tie that back to the specific user who is using that cloud agent, which is a feature that I’m only aware of Formal having.”
— Roy Xu, Software Engineer, Security @ Cursor
The Cursor case study covers the wider deployment: 1,000+ resources across 10+ technologies, with 40M+ logs and 600K+ sessions a week.
Where this stops
Formal doesn’t make a model resistant to prompt injection. It decides which requests an injected session gets to make on the flows your rules select, and logs them; flows no rule selects leave as if Formal weren’t there. Agent detection by signing identity is macOS only. And none of it replaces the VM, which bounds what a bad command can touch locally while the network layer bounds what leaves.
The prompts were a check that runs inside the agent’s own process, and the flag switches that process’s checks off. That’s a reasonable trade once the checks you depend on run somewhere the agent can’t edit: on the network path, and on the Connector that holds the keys. For what else Formal governs around the agent, such as skills, MCP servers and spend, see Claude Code security.
Frequently asked questions
How do I give Claude Code all permissions?
There’s no separate switch for all permissions; bypass mode is the closest thing. Launch with claude --dangerously-skip-permissions, or set permissions.defaultMode to "bypassPermissions" in your user settings to skip permissions in every session. A few setups refuse it: sessions started with --restricted (Claude Code v2.1.248 or later), machines whose managed settings disable the mode, and cloud sessions, which ignore the setting without saying so. A --bg background session is refused until you’ve accepted the bypass warning once in an interactive session.
Can I use dangerously-skip-permissions in VS Code?
Yes, after you turn on the “Allow dangerously skip permissions” toggle in the extension settings; until then, bypass permissions doesn’t appear in the mode indicator. To start every conversation in it, set claudeCode.initialPermissionMode to bypassPermissions in your VS Code user settings. The extension doesn’t read a project’s .claude/settings.json for its starting mode, and without the toggle a bypass default falls back to Manual.
Why does Claude Code refuse dangerously-skip-permissions as root?
On Linux and macOS it exits with --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons, unless it detects a recognized sandbox. Docker is the usual trigger, because a container runs as root unless the image or docker run --user sets another user. Anthropic’s dev container configuration already uses a non-root user.
Does plan mode still work when bypass is available?
Not in an interactive terminal session. Claude is still told to plan without editing, but a file edit or shell command it attempts while planning runs without a prompt; explicit ask rules and the rm critical-path check keep prompting. Non-interactive -p runs, Agent SDK sessions and the VS Code chat panel keep plan mode’s blocks.
Is Claude Code YOLO mode safe?
On a laptop with SSH keys, cloud credentials and open egress, no: one bad command runs with everything you have. In a disposable VM, as a non-root user, behind egress rules, with keys injected by a Connector and agent pushes blocked, YOLO mode is a trade we’d make for long, well-scoped tasks.
How do I stop Claude Code from pushing to main when prompts are off?
Not with Claude Code settings alone, because a deny rule on git push never sees a push that a script makes. The network rule and policy that catch it are in telling the agent’s git push from yours.
If you’d like to see the push block and the launch-flag policy on your own coding agents: