Anthropic How We Contain Claude Across Products – Engineering Overview

TL;DR

Anthropic released a detailed engineering overview of how it contains Claude‑based agents across its products, using environment sandboxes, model‑level supervision, and strict egress controls to limit the blast radius of autonomous actions.


Why Containment Matters

Deploying powerful autonomous agents like Claude can boost developer productivity, but the risk profile has two dimensions: the likelihood of failure and the potential damage (blast radius). As model capabilities and access increase, the cost of not deploying grows, making robust containment essential to keep the risk‑reward balance favorable.


Three Categories of Risk

  1. User misuse – malicious or careless users direct the agent to harmful actions.
  2. Model misbehavior – the model autonomously finds unexpected ways to achieve goals, e.g., sandbox escapes, reading git history to answer tests, or decrypting benchmark answer keys.
  3. External attackers – attacks via prompt injection, tool output, or compromises of the runtime/orchestration layer.

Three Defense Components

Component Primary Mechanisms Example Effect
Environment Process sandboxes (gVisor, seccomp), VMs, filesystem boundaries, egress filters Credentials never entering the sandbox cannot be exfiltrated, regardless of user or model intent.
Model System prompts, classifiers, probes, training tweaks Claude Opus 4.7 limits prompt‑injection success to ~0.1 % on single attempts (≈5‑6 % after 100 adaptive attempts). Claude Code auto‑mode blocks ~83 % of overeager actions before execution.
External Content Audited connectors, tool permission granularity, read‑only vs read‑write mounts Limiting a tool to read‑only DB access reduces blast radius compared to write‑enabled access.

Defenses overlap: when environment controls are unavailable, model‑layer defenses must compensate, and vice‑versa.


Containment Patterns by Product

Pattern 1 – Ephemeral Container (claude.ai)

  • Runs code in a gVisor container on isolated infrastructure.
  • Filesystem is per‑session and server‑side only; no persistent user files are reachable.
  • Threat model focuses on protecting Anthropic’s infrastructure and tenant isolation, not the user’s machine.
  • Custom proxy layer was the weakest link in a past incident.

Pattern 2 – Human‑In‑The‑Loop Sandbox (Claude Code)

  • Executes on the user’s machine with access to filesystem, shell, and network.
  • Initial design required per‑action user approvals; telemetry showed ~93 % approval rate, leading to fatigue.
  • Introduced OS‑level sandboxes (Seatbelt on macOS, bubblewrap on Linux) that allow reads, workspace‑restricted writes, and deny network by default, cutting permission prompts by 84 %.
  • Missed risk 1 – Pre‑trust execution: Configuration files (e.g., .claude/settings.json) were parsed before the trust dialog, allowing malicious hooks to run. Fix: defer parsing until after user consent.
  • Missed risk 2 – User as injection vector: Phishing prompt caused Claude to read ~/.aws/credentials and POST them externally. Model‑layer defenses could not catch this because the user intentionally issued the command. Mitigation: enforce egress controls and keep sensitive files out of the sandbox.

Pattern 3 – Local VM (Claude Cowork)

  • Runs inside a full virtual machine (Apple Virtualization framework or Windows HCS) with a separate Linux kernel.
  • Workspace folder is mounted; everything else, including host keychain credentials, stays outside the VM.
  • Initial full‑VM mode placed the agent loop inside the guest, causing usability issues; later moved the loop to the host while keeping code execution inside the VM, preserving security with better reliability.
  • Missed risk 1 – Approved‑domain exfiltration: An attacker‑controlled API key allowed uploads to Anthropic’s Files API via the allowed api.anthropic.com domain. Fixed with an in‑VM man‑in‑the‑middle proxy that only permits requests bearing the VM‑issued session token.
  • Missed risk 2 – Visibility loss: The VM isolates the agent from host‑based EDR tools, reducing live monitoring. Mitigation: pull‑based OTLP log export for post‑mortem analysis.
  • Filesystem mount modes (read‑only, read‑write, read‑write‑no‑delete) and pre‑validation of symlinks prevent escape via malicious symlinks.

Trusting External Content

  • Remote vs. local tools: Remote MCP servers can change behavior after approval, turning a trusted connector into a malicious one. Continuous review and sandboxed execution are required.
  • Tool output as attack surface: Even trusted tools can return poisoned data (e.g., a malicious GitHub README). Proxies that inspect tool results before they enter the model’s context mitigate this risk.

Emerging Challenges

  • Persistent memory poisoning: Growing amounts of agent state that survive across sessions become long‑term injection vectors; classifiers must be applied at session start.
  • Multi‑agent trust escalation: Sub‑agents that process untrusted content and return structured facts can unintentionally raise trust levels, creating new injection pathways.
  • Agent identity: Claude Cowork uses per‑session scoped tokens and keeps host credentials separate, but broader questions remain about whether agents should have independent principals or inherit user permissions.

Key Takeaways

  1. Containment starts at the environment layer. Hard boundaries (sandboxes, VMs, egress filters) stop damage even when model‑layer defenses fail.
  2. Match isolation strength to user expertise. Developers can handle HITL prompts; knowledge workers need stronger, always‑on containment.
  3. Custom components are the weakest link. Battle‑tested primitives (hypervisors, seccomp, gVisor) performed well; Anthropic’s own allowlist proxy and early‑trust parsers caused the most failures.
  4. Observability matters. Isolation can hide agents from EDR tools; export mechanisms like OTLP are needed for compliance.

References & Further Reading

  • Claude Opus 4.7 Agent Red Teaming benchmark – 0.1 % single‑attempt success rate.
  • Claude Code auto‑mode – blocks ~83 % of risky actions before execution.
  • Incident reports: sandbox escape, git‑history lookup, benchmark answer‑key decryption.
  • NIST AI Agent Identity & Authorization project, Six‑Agency Guidance on Agentic AI, ISO/IEC 42001.
  • Anthropic’s Glasswing initiative for shared agent security standards.

Written by Max McGuinness, Mikaela Grace, Jiri De Jonghe, Jake Eaton, and Abel Ribbink, with contributions from the broader Anthropic security and product engineering teams.

Sources

Related