Auto approve and YOLO modes such as Claude Code's --dangerously-skip-permissions and Codex's --yolo remove the step where a human checks risky actions, which exposes you to destructive commands, secret exfiltration, prompt injection and runaway usage. They are acceptable in a disposable container or VM with no secrets and limited network. On your main machine, use allow rules, the sandbox and a reviewed approval step instead.
Auto approve, YOLO mode, skip permissions: the names differ, but the idea is the same. The agent runs every command and edit without asking you. It is tempting, because prompts interrupt flow and most of them are harmless. The problem is the few that are not.
This article explains what these modes actually turn off in Claude Code and Codex, the four risks that matter, when the trade is acceptable, and a middle path that removes most prompts without removing the safety net.
What do auto approve modes actually turn off?
Auto approve modes remove the permission check before tools run. In Claude Code, that is bypassPermissions, started with:
claude --dangerously-skip-permissionsThe permission modes docs say this mode disables permission prompts and safety checks, including writes to protected paths such as .git and .claude. Deny rules still apply, but allow rules have no effect. The docs also warn that bypassPermissions "offers no protection against prompt injection or unintended actions" and should only be used in isolated environments like containers or VMs.
In Codex, --dangerously-bypass-approvals-and-sandbox, aliased --yolo, means no sandbox and no approvals, per the Codex approvals and security page. That is stronger than Claude Code's bypass mode, because the OS sandbox goes away too.
Not every reduced-prompt mode is YOLO:
| Mode | Who checks risky actions |
|---|---|
Claude Code Manual (default) | You |
Claude Code acceptEdits | You, except file edits and common filesystem commands in the project |
| Claude Code auto mode | A classifier model, plus your ask and deny rules |
Claude Code bypassPermissions | Nobody, except deny rules and a few hard limits |
Codex Auto preset (workspace-write, on-request) | The sandbox, plus you for actions outside it |
Codex --yolo | Nobody, and no sandbox |
Risk 1: destructive commands
An agent with no approval step can delete or overwrite work you cannot get back. Most agent mistakes are honest ones: cleaning a build folder that turns out to contain untracked files, resetting a branch to "start fresh", or rewriting a config that something else depended on.
Git protects committed work, but not untracked files, uncommitted changes, or anything outside the repository. Commands like git reset --hard, git clean -fd and rm -rf on the wrong path are exactly the actions that Claude Code's auto mode classifier blocks by default, which tells you how often they matter. In bypass mode, nothing blocks them unless you wrote a deny rule.
Claude Code does keep some limits in every mode, including bypassPermissions: recognized rm and rmdir removals of critical paths still prompt, and explicit ask rules still prompt. These are a floor, not a plan.
Risk 2: secrets exfiltration
An unrestricted agent can read your credentials and send them somewhere. It does not need malice to do it: printing an API key into a log, pasting a token into an issue, or committing a .env file are all ways secrets leave your machine.
Your machine holds a lot: .env files, ~/.ssh, ~/.aws/credentials, tokens in your shell environment, browser profiles. With network access and no approvals, the path from "read" to "sent" has no checkpoint. Simon Willison calls this combination of private data, untrusted content and external communication the lethal trifecta, and YOLO mode on your main machine gives an agent all three.
Risk 3: prompt injection
Without approvals, instructions hidden in a file or web page can drive the agent directly. Indirect prompt injection, as defined by OWASP, arrives through external sources such as websites or files. Coding agents read those constantly: a dependency's README, an issue body, a test fixture, a search result.
With an approval step, injected instructions still have to get a suspicious command past you. In bypass mode, they only have to convince the model. The Codex docs put it directly: prompt injection "can cause the agent to fetch and follow untrusted instructions". OWASP's recommended mitigations include least privilege and human approval for privileged operations, which are exactly what YOLO modes remove.
Risk 4: runaway usage and costs
An agent that never pauses can burn through your usage window or API budget in a loop. A failing test that the agent keeps "fixing", a retry loop on a flaky command, or a task that grew far beyond its scope will run as long as nothing stops it.
On a subscription plan this means hitting your rolling or weekly limit and losing the rest of the day. On API billing it means real money. Claude Code offers --max-turns and --max-budget-usd caps, but only in print mode (claude -p), and the docs note that spend can pass the cap, so leave headroom. Check your window with /usage in Claude Code or Codex before an unattended run. The guides on Claude Code usage limits and Codex usage limits explain the windows.
When is YOLO mode acceptable?
YOLO mode is acceptable when the environment itself is the safety net. That means the worst the agent can do is destroy something you were going to throw away anyway.
Concretely, all of these should hold:
- Disposable environment. A container, a dev container or a VM you can delete and recreate, not your laptop's user account.
- No secrets inside. No production credentials, no SSH keys, no personal tokens. Use scoped, short-lived tokens if the task needs any at all.
- Limited network. Ideally no internet, or an allowlist of the hosts the task needs, such as your package registry.
- Nothing irreversible reachable. No production database, no deploy credentials, no push rights to protected branches.
- A review at the end. You still read the diff before merging.
The Claude Code docs describe the intended use the same way: containers, VMs or dev containers without internet access, where Claude Code cannot damage the host. Claude Code also refuses --dangerously-skip-permissions when running as root or with sudo on macOS and Linux.
Our guide to --dangerously-skip-permissions covers a container setup step by step.
What is the middle path for daily work?
The middle path is to remove the boring prompts and keep the dangerous ones. On your main machine, you can get most of the speed of auto approve without giving up control.
- Allow rules for safe, repetitive commands. Tests, lint, build, formatters. Write them narrowly, with the
*after the subcommand, for exampleBash(npm run test *). See how to allow commands in Claude Code. - Ask rules for what must always reach you.
Bash(git push *), dependency installs, deploy commands. Ask rules win over allow rules. - Deny rules for secrets.
Read(./.env),Read(./.env.*),Read(./secrets/**). - The sandbox. Turn on Claude Code's sandbox with
/sandbox, setallowUnsandboxedCommandstofalse, and restrict reads of~/.sshand~/.aws. In Codex, stay onworkspace-writewith network off. - Auto mode where it fits. Claude Code's auto mode uses a classifier instead of prompts for most actions and blocks many destructive and exfiltrating ones by default. It is far safer than bypass, though the docs say it does not guarantee safety.
- Fast, visible approvals. The prompts that remain should be easy to see and quick to read, so you answer them properly rather than turning prompts off.
The Allowbar vs skip permissions comparison and the security checklist go further on each step.
Fewer prompts, not zero
Most people reach for YOLO mode because a prompt sat unanswered in a background terminal while they were doing something else. Allowbar, a Mac menu bar app for Claude Code and Codex, addresses that cause instead: each permission request appears in a panel at the top of the screen with the project, the tool and the exact command, with Allow, Block, and Terminal buttons.
Allowbar is not an auto approver. It never approves anything on its own, has no rules that approve for you, and if you do not answer, the question goes back to the terminal. A missing answer is never treated as approval. It is Mac only and supports Claude Code and Codex. Allowbar is in private beta. Join the waitlist; the launch price is $9.99 instead of $29.90.
Sources:
- Claude Code permission modes
- Claude Code permissions
- Claude Code sandboxing
- Claude Code CLI reference
- Codex approvals and security
- OWASP LLM01:2025 Prompt Injection
- Simon Willison, The lethal trifecta
Frequently asked questions
What is YOLO mode in coding agents?
YOLO mode is the informal name for running a coding agent without permission prompts. In Codex it is the --yolo alias for --dangerously-bypass-approvals-and-sandbox, which also removes the sandbox. In Claude Code the equivalent is --dangerously-skip-permissions, which starts the bypassPermissions mode.
Is --dangerously-skip-permissions safe?
It is safe only in an isolated environment such as a container or VM with no secrets and limited network. The Claude Code docs state it offers no protection against prompt injection or unintended actions, so it should not be used on your main machine.
Do deny rules still work in bypassPermissions mode?
Yes. In Claude Code, deny rules block in every mode, including bypassPermissions, while allow rules have no effect there. Explicit ask rules and recognized critical-path removals also still prompt.
Is Claude Code auto mode the same as YOLO mode?
No. Auto mode sends most actions to a classifier model that blocks risky ones, such as force pushes, curl | bash and sending sensitive data externally. Bypass mode checks nothing beyond deny rules and a few hard limits. Auto mode is much safer, though the docs say it does not guarantee safety.
How can I reduce permission prompts without auto approve?
Allow your safe repeated commands such as tests and linters, keep ask rules on pushes and installs, deny reads of secrets, and turn on the sandbox. Then make the remaining prompts visible with notifications so you can answer them quickly.