How we contain Claude across products

An Anthropic engineering post describing how claude.ai, Claude Code and Claude Cowork limit what an agent can reach (a server-side container, an operating-system sandbox with human approval, and a local virtual machine), with four security failures found after launch; it argues for containment at the environment layer first, isolation matched to how well the user can judge the agent's actions, and caution with custom components.

Max McGuinness, Mikaela Grace, Jiri De Jonghe, Jake Eaton, Abel Ribbink (Anthropic) · 2026-05-25 · original

An agent with a shell, files, credentials and a network connection can do more damage the more it is trusted to do. "How we contain Claude across products" (anthropic.com, Engineering, 25 May 2026) splits the risk of such a deployment into how likely a failure is and how much damage one could do, the "blast radius". It says safeguards and training have reduced the first while the second "only grows as capabilities and access expand", and frames the engineering task as capping the blast radius so that useful agents can be deployed. The post cites Claude Mythos Preview as a model "whose blast radius was deemed too high to ship in April 2026".

The post is the version of record for its own account (about 4,000 words, with five diagrams and a comparison table). It reports no new experiment. Its numbers come from Anthropic's product telemetry, an internal red-team exercise, and earlier publications it links; this note gives each number's source and, where the linked document was read, what that document measured. The authors are Max McGuinness, Mikaela Grace, Jiri De Jonghe, Jake Eaton and Abel Ribbink ("Authors & acknowledgements").

The framework: three risks, three places to defend

The post sorts risks to agents into three kinds ("Three types of risk, three components of defense"):

  • User misuse: a user, deliberately or carelessly, directs the agent to do harm.
  • Model misbehavior: the agent takes a harmful action nobody asked for. The post says more capable models make fewer obvious errors but are "better at finding unexpected paths to a goal", citing a model that escaped a sandbox "helpfully" to finish a task, one that read git history to find a coding test's answers, and one that identified a benchmark and decrypted its answer key.
  • External attackers: attacks through tools, files or the network, including prompt injection (instructions hidden in content the agent reads) and attacks on the agent's runtime.

It defends three components:

  • The environment: process sandboxes, virtual machines, filesystem boundaries and egress controls (limits on outbound network traffic). The aim is "a hard boundary on what an agent can reach"; credentials that never enter the sandbox cannot leak.
  • The model: system prompts, classifiers, probes and training, which "shape only what the agent tends to do".
  • External content: MCP servers, plugins and web search, sources the developer does not control. Narrow tool permissions (read-only database access, for example) limit what injected content can achieve.

The post's two strategies for capping the blast radius are human supervision of each action and containment, which limits what the agent is able to do. It reports that Claude Code users approved "roughly 93%" of permission prompts and that attention falls as approvals accumulate, and calls per-action approval "fallible". The 93% matches the Claude Code auto mode engineering post (25 March 2026), which says users "accept 93% of them".

The model-layer numbers

The post calls model-layer defenses "strong" and gives two figures, then says such protection "will never be 100% effective":

  • Prompt injection. On Gray Swan's Agent Red Teaming benchmark, the post says Claude Opus 4.7 holds attack success to "roughly 0.1% on single attempts, and around 5–6% after 100 adaptive attempts". The Claude Opus 4.7 system card (Section 5.2.1, Figure 5.2.1.A, page 83 of the 232-page edition of 16 April 2026) gives 0.1% at one attempt and 4.8% and 6.0% at 100 attempts; its text assigns 6.0% to the model without thinking and 4.8% to adaptive thinking, while the figure's bar labels put them the other way round. The card describes indirect prompt injection only, over 19 scenarios, with attacks that Gray Swan selected from its arena for high transfer across models, scored by Gray Swan after a grading correction, and says Claude models "have now saturated this benchmark".
  • Overeager actions. The post says Claude Code auto mode, which hands approval decisions to a model-based classifier, catches "roughly 83%" of overeager behaviors, and its footnote gives about 0.4% of benign commands blocked and about 17% of overeager actions let through. The auto mode post measured the 17% miss rate on 52 real overeager actions curated from Anthropic employees' sessions and the 0.4% block rate on 10,000 real tool calls by employees. The post says auto mode is "one layer of defense-in-depth inside a sandbox, not a substitute for one".

Three containment patterns

The post describes one pattern per product, each tuned to its users ("Patterns for containing agents"). Its comparison table lists the overhead, the reliance on the user and the blast radius of each.

  • claude.ai code execution: an ephemeral container. Code runs server-side in a gVisor container (a sandboxed kernel for containers) on isolated infrastructure, with a per-session filesystem. The blast radius is small, but so is what Claude can do. The post says pre-launch work was mostly conventional security (network configuration, service authentication, orchestration) and draws its first lesson: "the weakest layer is the one you built yourself".
  • Claude Code: a sandbox with a human in the loop. Claude Code runs on the user's machine. It launched allowing reads and requiring approval for writes, shell commands and network access, on the grounds that its users are developers who can judge a bash command. After approval fatigue appeared "within weeks", Anthropic added an operating-system sandbox (Seatbelt on macOS, bubblewrap on Linux) that allows writes only in the workspace and denies network access by default, and open-sourced the runtime. The post reports "an 84% reduction in permission prompts"; Anthropic's October 2025 sandboxing post gives the same figure for "our internal usage". Citing Measuring AI agent autonomy in practice, the post adds that experienced users auto-approve about twice as often as new ones but interrupt more, and argues that this form of oversight weakens as commands get more complex and as users run several agents.
  • Claude Cowork: a local virtual machine. Cowork serves knowledge workers who mostly cannot read bash, so the post argues the boundary must be "absolute and always-on". The first version ran the whole agent inside a virtual machine using the operating system's hypervisor, with only the chosen workspace mounted and credentials kept in the host keychain. A diagram lists six isolation mechanisms: two enforced by the hypervisor, which survive the agent gaining root inside the VM (memory isolation and vsock, a host transport with no network stack), and four enforced inside the guest, which root could defeat (a seccomp filter, mount namespaces, the egress proxy's domain allowlist, and a per-session user). Anthropic later moved the agent loop, and local MCP servers, out of the VM to the host for reliability and auditability, keeping code execution inside; the post says this "caused minimal security impact". File mounts can be read-only, read-write or read-write without delete, and symlinks must be resolved before paths are checked.

Four failures the post reports

Each is described in the post at the level of design, without exploit detail.

  • Code that ran before the trust prompt (Claude Code). Between mid-2025 and January 2026, outside reporters disclosed vulnerabilities, three of which ran before the user had agreed to anything. In the clearest case, a cloned repository's project settings defined a hook that ran at startup, before the "Do you trust this folder?" prompt. The fix deferred reading project configuration until after the prompt.
  • The user as the injection channel (Claude Code). In an internal red-team exercise in February 2026, a researcher phished an employee into starting Claude Code with a prompt that, among routine setup steps, asked Claude to read a cloud credentials file and send it to an outside server. "Across 25 retries of that prompt, Claude completed the exfiltration 24 times." The post says model-layer defenses "anchor on user intent", so an instruction typed by the user gives a classifier "nothing anomalous" to catch, and that only egress controls and filesystem boundaries hold here. When the prompt was shared in internal Slack, which some internal agents read, the team added a canary string to detect any agent picking it up.
  • Exfiltration through an allowed domain (Cowork). A third-party disclosure showed that a file in the workspace could carry hidden instructions and an attacker's API key, leading Claude to upload workspace files to the attacker's account through Anthropic's own API, which the egress allowlist had to permit. "The sandbox worked perfectly, and yet the data was exfiltrated." The post now treats an allowlist entry as "a capability grant" rather than a destination filter. The fix is a proxy inside the VM that passes only requests carrying the VM's own session token and blocks headers that enable server-side fetches. The post calls this a second case of a custom component failing while gVisor, seccomp and the hypervisor held.
  • Isolation that also blinded security tools (Cowork). Enterprise endpoint detection and response (EDR) software could not see inside the VM. The current mitigation is logs that administrators pull afterward, which the post says "is not the same as live monitoring".

Content the agent reads, and what comes next

The post argues that every external resource is both a supply-chain risk and a prompt-injection channel ("Trusting what the agent reads"). Remote tools can change after approval, so tools outside Anthropic's reviewed connector directory should be "treated as untrusted"; output from trusted tools still needs inspection before it enters the model's context, which Claude Code and Cowork do through proxies that can use "a small, fast model". It names three open problems ("Looking ahead"): injections that persist in memory files, CLAUDE.md files and other state reloaded each session; sub-agent output being trusted more than raw tool output; and whether an agent should have its own identity or inherit the user's.

Its summary gives three principles: contain at the environment layer first and steer at the model layer second; "Match isolation strength to the user's capacity for oversight"; and "Be wary of custom components".

Written principles

The post mentions system prompts and training as model-layer defenses but describes none of their text and tests none. Its argument concerns where such defenses stop working: when the harmful instruction comes from the user, it says, there is nothing for a model-layer check to catch.

Limitations

  • Evidence type. The post is a design account. The failures are cases, not rates, apart from the 24-of-25 exercise, which is one prompt on one setup; the post does not name the model used. The telemetry figures (93%, 84%) come from Anthropic's internal measurements.
  • Selection. The post presents failures as lessons. It does not say how many reports or red-team exercises there were in total, or how the four were chosen.
  • Borrowed numbers. The 0.1% and 5 to 6% figures are an outside tester's benchmark of a fixed attack set as reported in Anthropic's system card; the post's "adaptive attempts" are, in the card, repeated attempts drawn from that fixed set (the card's "adaptive" refers to the model's thinking mode). The auto mode recall rests on 52 examples of over-eager, not adversarial, behavior.
  • Later testing. Red-Teaming Auto Mode (October 2026) found that an attacker model told how the monitor works got past the September 2026 production configuration of auto mode in 65% of trials on average. That paper tests a deliberately adversarial agent, a threat the 83% figure does not cover. This connection is the note's.

Research questions

  1. How often does each layer stop a real incident? Counts of incidents by the layer that caught them (environment, model, user) across products would test the post's ordering of defenses.
  2. Does the sandbox's 84% cut in prompts change approval behavior? Approval rates and interruption rates before and after the sandbox, by user experience, would show whether fewer prompts restore attention.
  3. Which model completed the phishing prompt, and do other models refuse it? Running the same exercise across models and with auto mode enabled would separate model behavior from the absence of an environment boundary.
  4. How often are guest-enforced controls defeated? The diagram marks the egress proxy as defeatable by root in the guest. Red-team results on privilege escalation inside the Cowork VM would show how much rests on the two hypervisor-enforced layers.
  5. Can memory and configuration files be screened at startup without breaking legitimate use? The post expects startup classifiers to become common; false-positive and miss rates on poisoned and benign CLAUDE.md files would answer whether that is practical.

How it connects

References