Anthropic Managed Agents: Decoupling the Brain from the Hands
TL;DR
Anthropic has launched Managed Agents, a hosted service designed to run long-horizon agents by decoupling the reasoning engine (the "brain") from the execution environment (the "hands") and the session log. This architecture prevents infrastructure failures from destroying agent state and allows the system to evolve as model capabilities improve without requiring a complete redesign of the agent harness.
The Architecture of Managed Agents
Managed Agents virtualize the core components of an AI agent into three independent interfaces to ensure that the implementation of one can be swapped without affecting the others:
- The Session: An append-only log of every event that occurs during the agent's operation.
- The Harness: The orchestration loop that calls the model and routes tool calls to the appropriate infrastructure.
- The Sandbox: The execution environment where the model runs code and edits files.
By treating these as virtualized abstractions rather than a single coupled unit, Anthropic ensures the system remains stable even as the underlying models and hardware change.
Decoupling the "Brain" from the "Hands"
Previously, Anthropic placed all agent components in a single container. This created a "pet" infrastructure problem where a single container failure resulted in the loss of the entire session and made debugging difficult because user data and system logs were co-located.
Transitioning to "Cattle" Infrastructure
To solve this, Anthropic decoupled the harness (the brain) from the sandbox (the hands) and the session log. This shift provides several key benefits:
- Resilience to Sandbox Failure: The harness now calls the sandbox as a tool (
execute(name, input) → string). If a sandbox fails, the harness catches the error and can reinitialize a new container using a standard recipe (provision({resources})). - Harness Recovery: Because the session log is external, the harness is now stateless. If a harness crashes, a new one can be rebooted via
wake(sessionId), retrieve the event log viagetSession(id), and resume from the last recorded event. - Enhanced Security: By separating the brain from the hands, credentials (tokens) are kept out of the sandbox where untrusted model-generated code runs. For Git operations, tokens are wired into the local git remote during initialization; for custom tools, OAuth tokens are stored in a secure vault and accessed via a dedicated proxy, ensuring the harness and sandbox never handle raw credentials.
Managing Long-Horizon Context
Long-horizon tasks often exceed the context window of the model. While techniques like compaction (summarization) and trimming (removing old tokens) are common, they involve irreversible decisions about what to discard.
Managed Agents treat the session log as a durable context object that lives outside the model's context window. The getEvents() interface allows the model to programmatically interrogate the event stream, selecting positional slices or rewinding to specific moments to regain context. This separates the durable storage of context (the session) from the active management of that context (the harness), allowing the harness to apply context engineering or prompt caching strategies without losing the original data.
Performance and Scalability Gains
Decoupling the brain from the hands has led to significant improvements in latency and flexibility:
Reduced Latency (TTFT)
In the coupled design, every session required a container to be provisioned before inference could begin, regardless of whether a sandbox was actually needed. By moving the harness out of the container, inference can start as soon as the orchestration layer pulls events from the session log. This resulted in:
- p50 Time-to-First-Token (TTFT): Dropped by approximately 60%.
- p95 TTFT: Dropped by over 90%.
Support for "Many Brains, Many Hands"
The decoupled architecture allows a single brain to interact with multiple execution environments (hands) simultaneously. Because each hand is treated as a tool (execute(name, input) → string), the harness is agnostic to whether the sandbox is a container, a mobile device, or an emulator. This flexibility also allows brains to pass "hands" to one another, enabling more complex multi-agent coordination.
Sources
Related
- Dispatch
- Project
- Dispatch
- Dispatch
- Dispatch