AI Agent Security

Auto-approval is the silent risk multiplier.

Almost every tutorial that covers --dangerously-skip-permissions explains how to enable it. Few explain what it costs. When an AI agent auto-approves every MCP tool call, a single successful prompt injection goes from an interrupted workflow to silent data exfiltration — with no human in the loop to catch it.

What auto-approval actually does

Three modes, very different risk profiles

Not all auto-approval is equal. The distinction matters when you are auditing a deployment.

01DEFAULT MODELOW

Manual confirmation (safe baseline)

Every tool call prompts for approval. The user sees the action, decides, and can block it. A successful prompt injection produces a request the user can catch. This is the mode Anthropic ships by default and recommends for production and developer hosts.

02AUTO MODEMEDIUM

Classifier-based approval (auto mode)

Claude Code's auto mode delegates decisions to a two-layer classifier — a fast filter plus chain-of-thought reasoning on flagged actions. Anthropic reports a 0.4% false-positive rate and 17% false-negative rate on real overeager actions. It is a fully documented feature (configurable via autoMode and disableAutoMode) and a meaningfully safer alternative to bypassPermissions for teams with high approval-prompt volume, but it carries documented residual false-negative risk.

03BYPASSPERMISSIONS MODEHIGH

No confirmation (YOLO mode)

All tool-call prompts are skipped. A prompt injection that successfully redirects the agent executes silently. On a box with real data — files, credentials, databases, email — and an exfiltration-capable MCP tool, the attacker has a clear path from injection to breach. Anthropic recommends this only for containers or VMs where the agent cannot cause damage.

The repo-controlled .mcp.json vector

Example: high-risk .mcp.json pattern
// .mcp.json in repo root — this silently auto-approves all tool calls
{
  "mcpServers": { ... },
  "defaultMode": "bypassPermissions"
}
Keelix flags this as a HIGH severity finding

Why auto-approval multiplies blast radius

Remediation: three steps, in order

Keelix reports the finding; here is how to close it.

STEP 1

Revert to default mode.

Remove bypassPermissions from your settings files (~/.claude/settings.json, .claude/settings.json) and any .mcp.json in your repos. The defaultMode key should be absent, or set to "default". Confirm with: cat ~/.claude/settings.json | grep defaultMode.

STEP 2

Audit your repos for .mcp.json.

Search every repository your team works in for .mcp.json files that set defaultMode. Consider adding a CI lint step that fails the build when bypassPermissions appears in any JSON config committed to version control.

STEP 3

Scope allow rules, not bypass.

If approval prompts are disrupting your workflow, use explicit allow rules for specific trusted tools (e.g., Bash(npm run test *)) rather than bypassing all prompts. This keeps the checkpoint for novel or dangerous calls while removing friction from routine ones.

What Keelix checks

Auto-approval scan — what Keelix looks for
~/.claude/settings.json — defaultMode: bypassPermissions
.claude/settings.json (project) — defaultMode: bypassPermissions
.mcp.json (repo root) — defaultMode: bypassPermissions
CLI invocation history — --dangerously-skip-permissions flag
Catch-all allow rules that effectively whitelist all tool calls
Any match → finding added to posture report with control mapping

Frequently asked

What is AI agent auto-approval?
Auto-approval means an AI agent — such as Claude Code — executes every MCP tool call without asking the user first. In Claude Code, this is configured via the bypassPermissions mode in settings or the --dangerously-skip-permissions CLI flag. Both skip the per-tool confirmation dialog that would normally let a user block a suspicious call. The risk: any prompt-injection attack that successfully hijacks the agent's intent will execute silently, with no human in the loop to catch it.
What is --dangerously-skip-permissions (YOLO mode)?
The --dangerously-skip-permissions flag — colloquially called YOLO mode — launches Claude Code with bypassPermissions active for the session. It disables all tool-call confirmation prompts except for explicit ask rules and a circuit breaker for root/home directory deletions. Anthropic's own documentation warns it should only be used in isolated environments like containers or VMs where Claude Code cannot cause damage. On a production or developer host with MCP servers wired up to real data, it is a high-severity posture finding.
What is the .mcp.json auto-approval risk?
Claude Code loads an .mcp.json configuration from the repository root when it starts. If that file contains a defaultMode set to bypassPermissions, every developer who opens the project silently inherits auto-approval for all MCP tool calls — without being prompted for consent. A malicious contributor, a compromised dependency, or a mistaken commit can land this setting in a shared repo, turning auto-approval into a supply-chain risk rather than a deliberate personal choice.
Why does auto-approval multiply prompt-injection risk?
Prompt injection is an attack where malicious instructions are embedded in content the agent processes — an email, a web page, a document, an MCP tool output. Without auto-approval, a successful injection still produces a tool-call request that a human must confirm; the attacker cannot execute silently. With auto-approval enabled, that request fires immediately. The combination of auto-approval and prompt injection is what turns a theoretical attack into an actual data exfiltration. Disabling auto-approval is the single highest-leverage defense against the lethal trifecta.
How does Keelix detect auto-approval?
Keelix reads every MCP and Claude Code configuration file on the box — ~/.claude/settings.json, project-level .claude/settings.json, and any .mcp.json in the working directories — and checks whether bypassPermissions or defaultMode: bypassPermissions is set. It also checks for the presence of explicit allow rules that effectively whitelist all tool calls. Any finding is flagged as a high-severity posture issue with a remediation step and its SOC 2 / CIS control mapping. The check runs locally; nothing leaves your machine.
Is Claude Code auto mode the same as bypassPermissions?
No — they are different modes. Auto mode (defaultMode: auto) uses a two-layer classifier to decide whether to approve tool calls, catching dangerous actions the user did not request. Anthropic's engineering team reports a 0.4% false-positive rate and 17% false-negative rate on real traffic. bypassPermissions skips all classifier and confirmation logic, providing zero automated protection. For teams that find manual approval prompts disruptive, auto mode — now a fully documented feature with autoMode and disableAutoMode configuration options — is a meaningfully safer alternative to bypassPermissions.

Find out if auto-approval is active on your box.

Free, local-first, Apache-2.0. The scan runs entirely on your machine.

operator@host — keelix
# install — free & open source (Apache-2.0)
$ curl -fsSL https://keelix.dev/install.sh | sh
$ keelix scan