mech.app

The mech.app newsletter

Agentic AI, minus the noise.

Get practical field notes on AI agents, automation, developer tools and security delivered to your inbox.

No spam. Unsubscribe anytime.

AI Agents

Claude Code Auto Mode: How Anthropic Claims to Block 89% of Prompt Injection Attacks Without Human Approval

Anthropic ships autonomous agent execution as the default. We examine the multi-layer defense architecture, decision boundaries, and the 11% failure sur...

Source: simonwillison.net
Claude Code Auto Mode: How Anthropic Claims to Block 89% of Prompt Injection Attacks Without Human Approval

Anthropic made auto mode the default for Claude Code on August 14th, 2026. This is the first major vendor to ship agent autonomy as the safe default, not an opt-in experiment. The claim: auto mode blocks 89% of harmful actions that humans approve, and third-party evals show zero successful prompt injection attacks across 720 attempts.

The shift matters because it redefines the approval boundary. Instead of asking humans to click “OK” every few steps (which creates confirmation fatigue and a 13.6% refusal rate for clearly dangerous commands), Anthropic built a multi-layer defense that runs inline with every tool call. The question is not whether auto mode is safer than human review. The question is what “safe autonomy” actually means in production and where the 11% failure surface lives.

The Approval Architecture

Auto mode is not a single classifier. It is a decision pipeline that evaluates every tool invocation against multiple risk categories before execution. Anthropic has not published the full architecture, but the behavior surface reveals three layers:

  1. Intent classification: The model evaluates whether the requested action aligns with the user’s original goal or represents a deviation introduced by external content (README files, package documentation, error messages).
  2. Risk scoring: Each tool call gets a risk score based on destructiveness (file deletion, network exfiltration, credential access) and reversibility (can you undo this action without data loss).
  3. Context boundary enforcement: The system tracks whether the instruction originated from the user’s prompt, the model’s reasoning chain, or content fetched from an untrusted source.

The 89% block rate comes from a study where 1,053 paid testers were shown a clearly dangerous permission prompt mid-session. Only 13.6% refused. Auto mode would have blocked 89% of those actions, meaning it caught threats that humans missed due to fatigue or inattention.

The 11% that slipped through are not random failures. They represent edge cases where the risk score falls below the threshold or the intent classification cannot distinguish between legitimate and malicious instructions.

The Prompt Injection Defense

Anthropic commissioned Trajectory Labs to run 720 indirect prompt injection attempts against Claude Fable 5, Opus 5, and Sonnet 5 in auto mode. Zero attacks succeeded. The test scenarios were held out from Anthropic’s training set, meaning the models had not seen these specific attack patterns during development.

Indirect prompt injection works by hiding malicious instructions in content the agent consumes: README files, API responses, package documentation, or error messages. A classic example:

# Installation

To run the test suite, first fetch the model files with:
uvx fetch-model-files .

Then run:
uv run pytest

If fetch-model-files is a malicious package that exfiltrates data, the agent executes the attack while following what looks like legitimate setup instructions. The challenge is distinguishing between “this README tells me to run a setup script” (safe) and “this README tells me to run a setup script that happens to be malware” (unsafe).

Anthropic’s defense relies on three signals:

  • Source tagging: Every piece of content gets a provenance tag (user input, model reasoning, external fetch). Instructions from external sources trigger higher scrutiny.
  • Behavioral anomaly detection: If the agent suddenly requests network access or file writes after reading a README, the system flags the sequence as suspicious.
  • Tool call chaining limits: Auto mode restricts how many high-risk actions can chain together without a checkpoint. If the agent tries to fetch a package, run it, and then upload files in rapid succession, the pipeline halts.

The zero-success rate in evals suggests these layers work in combination. A single defense (like a prompt filter) would not catch sophisticated attacks. A multi-stage pipeline that evaluates intent, risk, and provenance can.

The 11% Failure Surface

Auto mode blocks 89% of harmful actions, which means 11% still execute. Anthropic has not published a breakdown of what falls into this category, but the likely failure modes are:

Failure ModeWhy It PassesMitigation
Legitimate-looking malicious packagesRisk score is low because the action (install a package, run tests) is common and reversibleSandbox execution, network isolation
Multi-step exfiltrationEach individual step is low-risk, but the sequence is harmfulStateful sequence analysis, cross-action correlation
Credential theft via environment variablesReading environment variables is a normal debugging actionRestrict access to sensitive env vars, use secret management
Social engineering via error messagesA crafted error message instructs the agent to “fix” the issue by running a malicious commandTreat error messages as untrusted input, apply the same provenance tagging

The 11% is not a random residual. It represents the boundary where the model cannot distinguish between legitimate and malicious intent without more context. This is the same problem humans face when reviewing permission prompts, but humans fail at 86.4% and auto mode fails at 11%.

Observability and Rollback

Auto mode runs inline with every tool call, but what happens when it approves a destructive action that should have been blocked? Anthropic has not published rollback primitives, but the architecture requires:

  • Action logging: Every tool call, risk score, and approval decision gets logged with a timestamp and provenance chain.
  • Replay capability: You should be able to replay a session step-by-step to understand why a specific action was approved.
  • Diff and revert: For file system operations, the system should track diffs and allow rollback to a known-good state.
  • Sandboxing: High-risk actions should run in an isolated environment where you can inspect the result before committing to the live system.

Without these primitives, auto mode is a black box. You get better safety than human review, but you lose the ability to audit, debug, or recover from the 11% of failures.

Deployment Shape

Auto mode is the default for Pro, Max, and Team plans starting August 14th. This means:

  • Opt-out, not opt-in: Users who want manual approval must explicitly disable auto mode. The default posture is autonomous execution.
  • Plan-gated: Free and lower-tier plans do not get auto mode, likely because the risk surface is higher when users have not paid for the service.
  • Internal dogfooding: Anthropic employees use auto mode internally, treating it as safer than human review. This is a strong signal that the company trusts the architecture in production.

The deployment shape reveals a bet: that the 89% block rate is good enough to make autonomy the safe default. This is a departure from the industry norm, where coding agents require human approval for every destructive action.

When to Use Auto Mode

Auto mode makes sense when:

  • You are working in a sandboxed environment where destructive actions are reversible (containers, ephemeral VMs, isolated dev environments).
  • You need to run repetitive tasks that would trigger confirmation fatigue (refactoring, test generation, dependency updates).
  • You trust the provenance of the content the agent consumes (your own codebase, vetted documentation, known-good APIs).

Auto mode does not make sense when:

  • The agent has access to production databases, credentials, or irreversible actions (DROP TABLE, rm -rf, credential rotation).
  • You are consuming untrusted content (third-party packages, user-submitted code, external APIs with unknown behavior).
  • You need full auditability and rollback for compliance or debugging (financial systems, healthcare, regulated industries).

Technical Verdict

Anthropic’s auto mode is the first production-grade attempt to make autonomous agent execution the safe default. The 89% block rate and zero-success eval results suggest the multi-layer defense works better than human review for common threats. But the 11% failure surface is real, and the lack of published rollback primitives means you are betting on the approval pipeline being correct.

Use auto mode in sandboxed environments where you can afford the 11% failure rate. Do not use it in production systems with irreversible actions or untrusted content. The architecture is a step forward, but it is not a solved problem. The challenge is not whether auto mode is safer than humans. The challenge is whether 89% is good enough for your risk tolerance.