Claude's Next-Gen Agent Architecture: Decoupling Brain and Hands for Scalable Agents
Anthropic introduces Managed Agents, a hosted service that virtualizes AI agent components—session, harness, and sandbox—into stable interfaces, enabling decoupled brain and hands architecture that improves fault tolerance, security, and reduces time-to-first-token by 60-90% while supporting many brains and hands.
Reading font

Anthropic's engineering blog details the design of Managed Agents , a hosted platform for long-horizon AI agent work. The core problem: traditional agent harnesses encode assumptions about model limitations that become stale as models improve. For example, Claude Sonnet 4.5 exhibited "context anxiety" — prematurely ending tasks as its context window filled — so the team added context resets to the harness. When Claude Opus 4.5 arrived, that behavior vanished, leaving the reset logic as dead weight.
OS-Level Abstractions for Agent Components
Managed Agents applies the operating-system principle of stable abstractions over changing implementations. Just as read() works identically on 1970s disk packs and modern SSDs, Managed Agents virtualizes three components behind stable interfaces:
Session — an append-only log of every event in the agent run.
Harness — the loop that calls Claude and routes its tool calls to infrastructure.
Sandbox — the execution environment where Claude runs code and edits files.
Each component can be swapped independently; the system is opinionated about interface shape, not implementation.
From Pets to Cattle: Decoupling the Brain from the Hands
Initially all components shared one container. This created a pet — a unique, hand-tended server that couldn't fail without losing the session. Debugging was nearly impossible: the only visibility was a WebSocket event stream that couldn't distinguish a harness bug, a network drop, or a container crash. Engineers had to shell into the container (which also held user data) to diagnose.
A second coupling assumption: the harness believed every resource Claude needed lived in the same container. Connecting to a customer's VPC required either VPC peering or deploying the harness into the customer's environment — an architectural assumption that became a blocker.
The Harness Leaves the Container
Decoupling moves the harness out of the container. The harness now calls the sandbox like any other tool via execute(name, input) → string. The container becomes cattle : if it dies, the harness treats it as a tool-call error and returns the failure to Claude. On retry, a fresh container is provisioned via provision({resources}). No more nursing failed containers.
Recovering from Harness Failure
The harness itself becomes stateless cattle. Because the session log lives outside the harness, a crashed harness can be replaced by a new one that calls wake(sessionId), retrieves the event log with getSession(id), and resumes from the last event. During execution the harness durably records events via emitEvent(id, event).
Security Boundary: Tokens Never Reach the Sandbox
In the coupled design, untrusted code generated by Claude ran alongside credentials in the same container. A prompt injection could read the environment and steal tokens, enabling unrestricted sessions. Narrow token scoping still assumes limited tokens are safe — an assumption that weakens as models get smarter. The structural fix: ensure tokens are never reachable from the sandbox.
Two patterns achieve this:
Resource-bound auth — for Git, the repo's access token clones the repo during sandbox init and configures the local git remote. git push and git pull work inside the sandbox without the agent ever handling the token.
Vault-backed proxy for custom tools — OAuth tokens are stored in a secure vault. Claude calls MCP tools via a dedicated proxy that receives a session-associated token, fetches the real credentials from the vault, and calls the external service. The harness never sees any credentials.
Session as a Context Object Outside the Context Window
Long-horizon tasks exceed the context window. Standard techniques (compaction, memory tool, context trimming) make irreversible keep/discard decisions. The session provides a durable, queryable context object via getEvents(), allowing the brain to:
Resume from where it last stopped reading.
Rewind a few events before a critical moment to see the lead-up.
Reread context before a specific action.
Fetched events can be transformed in the harness before entering the context window — reorganizing structure, boosting prompt-cache hit rates, applying any context-engineering strategy. The session guarantees durable, interrogable storage; the harness owns context management, because future models' needs are unpredictable.
Many Brains, Many Hands
Many Brains
Decoupling solved the VPC connectivity problem: with the harness outside the container, the assumption that all resources are local disappears. It also slashed latency. In the old design every session paid full container startup (clone repo, boot process, fetch events) before any inference. Time-to-first-token (TTFT) — the latency users feel most — dropped ~60% at p50 and >90% at p95 . Sessions that don't need a sandbox start inference immediately after the orchestration layer pulls pending events from the session log. Scaling to many brains means starting many stateless harnesses, connecting to hands only when needed.
Many Hands
Each hand becomes a tool via execute(name, input) → string. This interface supports any custom tool, any MCP server, and Anthropic's own tools. The harness doesn't know whether the sandbox is a container, a phone, or a Pokémon emulator. Because hands aren't bound to a specific brain, brains can pass hands to one another.
Meta-Harness Design
Managed Agents is a meta-harness : it provides general interfaces that accommodate many harnesses (e.g., Claude Code for general tasks, task-specific harnesses for vertical domains). The design is opinionated about the interfaces around Claude — session for state, sandbox for computation, support for many brains and many hands — but makes no assumptions about the number, location, or specific implementation of those brains and hands. The goal: a system that reliably and securely runs long-horizon agent work as models continue to evolve.
For questions about attribution, corrections or content rights, please contactand we will review it promptly.