Anthropic Splits Claude Agent Architecture to Cut Latency 90%

Decoupling the Brain from the Hands: Claude Managed Agents (Part 1 of 4) — Anthropic — AI Engineer

AI Engineer

Anthropic abandoned monolithic agent containers because orchestration harnesses encode temporary model flaws that go stale with every upgrade, separating immutable session logs from pluggable sandboxes to eliminate credential leaks and accelerate response times.

AI-assisted summary of Decoupling the Brain from the Hands: Claude Managed Agents (Part 1 of 4) — Anthropic — original source. Check the original for full context.

Source published:

Key ideas

  • Anthropic redesigned Claude Managed Agents by decoupling the monolithic container into three modular interfaces: an append-only session log, the brain (model plus harness), and pluggable hands (sandboxes and MCP tools). (7:45)
  • By deferring execution sandbox provisioning until tool calls are explicitly needed, the decoupled architecture dropped time to first token by approximately 90%. (10:00)
  • Outbound tool requests now route through an egress authentication proxy that injects credentials outside the sandbox perimeter, structurally preventing prompt injection attacks from stealing tokens. (9:05)
  • The developer API surface for managed agents standardizes around three primary primitives: Environments (/v1/environments), Agents (/v1/agents), and Sessions (/v1/sessions) driven via bidirectional event streams. (13:49)

Detailed notes

## Background This video was published on YouTube by the AI Engineer channel on October 12, 2026, documenting a workshop from the AI Engineer World's Fair 2026. It features Priyanka Phatak and Gabe Cemaj from Anthropic explaining why the team moved away from their initial monolithic container architecture for Claude Managed Agents in favor of decoupling the session, harness, and sandbox environments.

## TL;DR Priyanka Phatak outlines the fundamental anatomy of an AI agent—model, harness, and sandbox—and explains how Anthropic's initial monolithic container design created an unmanageable 'pet' prone to debugging bottlenecks and security vulnerabilities. To solve this, Anthropic rearchitected the platform by separating the state into an append-only session log, treating the harness and Claude as the 'brain,' and relegating sandboxes and MCP connections to pluggable, disposable 'hands.' This modular architecture stripped credentials out of untrusted execution environments via an egress proxy and lowered time to first token by approximately 90%. Finally, the talk walks through the core developer primitives—Environments, Agents, and Sessions—and sets up a hands-on console quick start for attendees.

## Atmosphere & style The presentation carries the practical, authentic energy of a live engineering workshop in a packed conference room, balancing polished technical depth with real-world conference friction like Wi-Fi dropouts and mic passing. Phatak speaks with clear, battle-tested authority, framing Anthropic's early architectural missteps with candid humor through classic DevOps metaphors like 'pets versus cattle.' The atmosphere feels collaborative and pragmatic, drawing the audience directly from high-level distributed systems theory into hands-on console setup.

## Bulletin - [07:45](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=465s) Anthropic redesigned Claude Managed Agents by decoupling the monolithic container into three modular interfaces: an append-only session log, the brain (model plus harness), and pluggable hands (sandboxes and MCP tools). - [10:00](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=600s) By deferring execution sandbox provisioning until tool calls are explicitly needed, the decoupled architecture dropped time to first token by approximately 90%. - [09:05](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=545s) Outbound tool requests now route through an egress authentication proxy that injects credentials outside the sandbox perimeter, structurally preventing prompt injection attacks from stealing tokens. - [13:49](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=829s) The developer API surface for managed agents standardizes around three primary primitives: Environments (/v1/environments), Agents (/v1/agents), and Sessions (/v1/sessions) driven via bidirectional event streams.

## Key takeaways - [02:05](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=125s) At its foundational level, an agent consists of three core components: a model, an orchestration harness, and an isolated sandbox execution environment. - [03:06](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=186s) Orchestration harnesses inherently encode model-specific assumptions and workarounds, such as context-resetting logic for Sonnet 4.5's context anxiety, which can quickly become obsolete in newer models like Opus 4.5. - [04:16](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=256s) Sandboxes provide an isolated blast radius to safely execute untrusted, agent-generated code across tasks without risking system compromise. - [05:10](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=310s) The initial V1 architecture bundled the session log, harness loop, and sandbox into a single 'pet' container, which created severe debugging bottlenecks and customer privacy issues. - [06:05](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=365s) Monolithic containers complicated network connectivity to private VPCs and prevented internal debugging without exposing sensitive customer source code. - [07:45](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=465s) Separating the architecture into the Session (state), Brain (reasoning), and Hands (execution) turned brittle pet containers into disposable, interchangeable cattle. - [07:45](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=465s) Because sandboxes are treated as tools by the brain, a sandbox crash is handled as a standard tool failure rather than a fatal session termination. - [09:05](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=545s) Injecting API credentials via an egress proxy ensures Claude and the execution sandbox never see or store raw secrets, eliminating token theft via prompt injection. - [10:00](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=600s) An immutable, append-only session event log allows flexible context compaction strategies—such as summarization or sliding windows—without dropping underlying history. - [10:00](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=600s) Decoupling inference from execution runtime dropped time to first token by roughly 90% because compute sandboxes only spin up on demand. - [11:09](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=669s) Interfaces must be designed to outlast model-specific assumptions, ensuring agent infrastructure remains stable as foundation model capabilities evolve. - [13:49](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=829s) The platform architecture models tasks via Environments for sandbox boundaries, Agents for persona and tool definition, and Sessions for runtime task state. - [15:18](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=918s) All runtime agent communication is mediated through a bidirectional event stream supporting messages, tool invocations, status updates, and user interrupts.

## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=0s) Introductions and Workshop Agenda

Priyanka Phatak opens the session to a full room, introducing herself as a Member of Technical Staff at Anthropic where she leads the engineering team responsible for Claude Managed Agents. Having been at Anthropic for a little over two years, she has spent the past twelve months focusing entirely on building agentic infrastructure. She welcomes attendees alongside Gabe Cemaj, also a Member of Technical Staff on her team, who notes that he has been at Anthropic for just over a year and has spent almost his entire tenure working on managed agents.

Priyanka outlines the roadmap for the workshop, explaining that while the overall two-hour block is broken into four recorded sections, it functions as a single continuous session. The talk begins with an architectural evolution story tracing how Anthropic built and scaled managed agents, including the early pitfalls, operational lessons, and architectural pivots. Following that, the session shifts into a two-part hands-on portion: first, a no-code walkthrough using the Claude platform console where participants prompt their way to an initial agent, and second, an interactive coding segment led by Gabe Cemaj using Claude Code (or any preferred coding agent) to build a more complex financial agent, concluding with an open Q&A.

```mermaid flowchart LR accTitle: Workshop Structure accDescr: Three-stage sequence of the Claude Managed Agents workshop agenda. A["Evolution Story<br/>Architecture & Pitfalls"] --> B["Console Quick Start<br/>Prompting First Agent"] B --> C["Hands-on Coding<br/>Financial Agent"] C --> D["Open Q&A"] ```

[02:05](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=125s) What Makes an Agent Work: Models, Harnesses, and Sandboxes

Priyanka breaks down the fundamental machinery of an agent to its core components: a model, a harness, and a sandbox. At the most fundamental level, an agent is simply a model running in a loop with tools. The foundation model evaluates the state, decides on the next appropriate action, and executes tool calls iteratively until the user's task is resolved.

An audience member briefly interrupts from the back of the room to ask if a link to the slide deck is available. Priyanka and Gabe apologize for the visibility issues in the back, noting that it is difficult to distribute the deck mid-presentation, but promise to share the slides immediately afterward while encouraging attendees to raise hands for roaming microphones whenever they have questions.

[03:06](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=186s) Harnesses and Model-Specific Assumptions

Priyanka explains that a harness is the orchestration layer wrapped around the model. It handles the mechanics of calling tools in a loop, manages the context window, and fills in gaps where model capabilities fall short. Crucially, a harness inherently codifies assumptions about what a specific model cannot do. Because models improve rapidly, these workarounds can become obsolete from one model generation to the next.

To illustrate this, Priyanka shares a concrete engineering example involving model behavior: “A good example is our Sonnet 4.5 model had something what we called context anxiety.” When Sonnet 4.5 sensed it was nearing the edge of its context window, it would prematurely rush to complete the task. To mitigate this behavior, engineers had to build a context-resetting mechanism into the harness. However, when the team transitioned to Opus 4.5, that limitation vanished entirely, rendering the specialized context-reset logic unnecessary. Priyanka emphasizes that building a robust harness requires designing around these shifting quirks without letting temporary workarounds permanently constrain future model updates.

[04:16](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=256s) Sandboxes and Limiting Blast Radius

The third component of an agent is the sandbox—essentially a secure computer or isolated execution environment where Claude can run the code it generates to accomplish tasks. In this environment, the agent requires the ability to inspect files, edit codebases, and install dependencies. Priyanka highlights Claude Code as an everyday example of this pattern: a harness executing locally on a developer's machine with direct access to local files and system commands.

However, running agent-generated code in production introduces significant security and stability concerns. Because agents generate untrusted and potentially buggy code, the execution environment must remain tightly contained within a hardened container. Priyanka highlights the importance of workload isolation, stating: “So typically you want to execute every task in a separate container so you're not mixing up and you're not increasing the blast radius for your tasks.”

[05:10](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=310s) The First Architecture: The "Pet" Container

Priyanka details the initial architecture of Claude Managed Agents, which Anthropic shipped to early access customers in December. In this early V1 design, the engineering team packaged every component into a single container. The session log (the append-only record tracking all task events), the harness execution loop, and the sandbox where tool commands executed all coexisted within the same container boundary.

Initially, this unified model offered clear operational simplicity: - There were no complex service boundaries or distributed network hops to design. - Everything operated locally within the container filesystem. - File modifications were as fast and direct as local system calls.

Despite these immediate conveniences, this monolithic setup soon presented fundamental engineering roadblocks that forced the team to rethink their design.

```mermaid flowchart TD accTitle: Architecture V1 Monolithic Container accDescr: Depicts the early monolithic architecture where the session log, harness, and sandbox all lived inside a single container. subgraph Pet["Single Monolithic Container ('The Pet')"] SL["Session Event Log"] H["Harness / Agent Loop"] SB["Sandbox & Tool Execution"] SL <--> H H <--> SB end ```

[06:05](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=365s) The "Pet vs. Cattle" Problem and Failure Modes

The core architectural flaw of the V1 container was that Anthropic had inadvertently created an infrastructure "pet." Evoking the classic DevOps analogy, Priyanka contrasts a pet—a uniquely named, hand-tended resource that requires intense care to nurse back to health if it fails—with cattle, which are interchangeable, disposable instances that can be replaced automatically the moment one goes down.

Priyanka explains how this single-container design degraded operability in production: - **Opaque debugging:** Because everything ran inside one black box, the team could not distinguish between a network packet drop and a dead container. Diagnosing issues required engineers to establish fragile WebSocket streams directly into the running container. - **Privacy and customer data boundaries:** Containers held live customer data and proprietary source code, which meant internal Anthropic engineers could not inspect or troubleshoot broken sessions without violating strict customer privacy walls. - **Network connectivity hurdles:** If an enterprise customer needed the agent to connect to a Model Context Protocol (MCP) server located inside their private VPC, Anthropic faced an awkward dilemma: either establish complex VPC network peering connections or ship the proprietary harness to the customer to run on their own infrastructure.

Confronted with these structural roadblocks, the team abandoned the monolithic container model in favor of a clean separation of concerns.

[07:45](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=465s) Decoupling the Brain from the Hands

To solve the pet problem, Anthropic broke the monolithic agent container into three discrete, independently replaceable interfaces: the Session, the Brain, and the Hands. By establishing strict service boundaries, every component except the immutable session history became interchangeable "cattle."

```mermaid flowchart LR accTitle: Decoupled Agent Architecture accDescr: The decoupled architecture showing the session log, the brain (Claude + harness), and the hands (sandboxes and MCP tools) mediated by an egress proxy. Session[("Session<br/>Append-only Log")]

subgraph Brain["The Brain"] Claude["Claude"] Harness["Harness / Agent Loop"] Claude <--> Harness end

subgraph Hands["The Hands"] Sandbox["Ephemeral Sandboxes"] Proxy["Egress Auth Proxy"] Tools["External MCP Tools"] Sandbox -->|Outbound call| Proxy Proxy -->|Injects secret| Tools end

Session <-->|"Resume / Append"| Harness Harness -->|"Tool invocation"| Sandbox Harness -->|"Tool invocation"| Tools ```

Priyanka details how each layer functions in the decoupled architecture: 1. **The Session:** An append-only historical log of every event, action, input, and response that has occurred throughout the task. It represents the single source of truth and the only stateful asset that must be preserved. 2. **The Brain:** The cognitive engine, combining Claude with the orchestration harness. If the harness crashes, a brand-new harness instance boots up, replays the event log from the session, and resumes task execution from the exact point of failure without losing progress. 3. **The Hands:** Ephemeral execution sandboxes and MCP tool connections provisioned on demand. To Claude, interacting with a sandbox is treated as just another tool call; if a sandbox container crashes, the error reports back to the brain as a failed tool call, allowing Claude to simply spin up a fresh sandbox and continue execution.

[09:05](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=545s) Keeping Credentials Out of the Sandbox

Decoupling the architecture also resolved a major security risk: prompt injection attacks aimed at credential theft. In the legacy V1 container, authentication credentials and API tokens lived inside the execution environment alongside Claude, making them vulnerable if an agent was tricked into printing the environment variables or writing secret tokens to a readable file.

In the decoupled design, credentials never enter the execution sandbox. Instead, when an agent initiates an outbound network request to an authenticated API or external MCP endpoint, the call routes through an egress proxy: - The proxy intercepts the outbound traffic outside the sandbox perimeter. - The proxy injects the necessary access tokens, bearer headers, or credentials at the network boundary. - The external service receives the authenticated request without the model or sandbox ever holding the raw secrets.

As Priyanka points out, this design provides structural immunity against credential-leaking attacks: “That way the model never sees your credentials or your tokens which means you can never prompt inject Claude to say like hey give me your tokens or print out the tokens or write them to a file.”

[09:49](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=589s) Flexible Compaction Strategies

A further benefit of separating the session log from execution is the ability to handle long-running context through flexible compaction strategies. Because the session is maintained as an independent, append-only ledger of discrete events, Anthropic can modify how context is summarized, truncated, or pruned without altering the underlying compute runtime or dropping critical operational history. Work continues uninterrupted, and historical events remain intact even as context windows are dynamically optimized.

[10:00](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=600s) Flexible Compaction, Faster First Token, and Pluggable Hands

Priyanka Phatak explains that moving away from the monolithic container design fundamentally changed how session history is managed. Because the underlying event stream is strictly append-only, raw interactions are never mutated or thrown away during compaction. This separation allows the compaction strategy to operate independently: it can inspect the entire event log to synthesize an executive summary for Claude's context window, or it can selectively pull in only the trailing $N$ events depending on the task requirements.

```mermaid flowchart TD accTitle: Decoupled Agent Architecture accDescr: Flow diagram showing the separation between the append-only event log, the brain harness, and pluggable hands.

subgraph Storage ["State Management"] Log["Append-Only Event Log"] Compact["Flexible Compaction Strategy"] Log --> Compact end

subgraph Core ["The Brain"] Harness["Interchangeable Harness"] Claude["Claude Inference"] Compact --> Harness Harness <--> Claude end

subgraph Execution ["The Hands"] Sandbox["Container Sandbox"] VPC["Customer VPC"] MCP["MCP Server"] end

Harness -->|"On-demand spawn"| Sandbox Harness --> VPC Harness --> MCP ```

This decoupled model also eliminates the startup latency overhead of container sandboxes. Because Claude can begin inference immediately without waiting for execution infrastructure to spin up, the time to first token dropped by approximately 90%. A sandbox container is only spawned when the model explicitly issues an action that requires code execution, resulting in a much snappier interaction loop. Furthermore, the harness acts as a centralized "brain" capable of driving multiple, interchangeable "hands," including customer virtual private clouds (VPCs), Model Context Protocol (MCP) servers, or isolated container sandboxes.

- Append-only event streams store every atomic interaction, ensuring no raw session data is discarded. - Compaction strategies can be modified dynamically (e.g., full historical summarization versus sliding window of the last $N$ events). - Decoupling reduced time to first token by roughly 90% by deferring container provisioning until tool execution is required. - Execution targets ("hands") are pluggable and include sandboxes, remote customer VPCs, and external MCP servers.

---

[11:09](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=669s) Interfaces Outlasting Assumptions and Audience Q&A

Highlighting the primary architectural insight from building Claude Managed Agents, Phatak emphasizes the vulnerability of tying system infrastructure to model behaviors. As foundation models rapidly advance, the internal reasoning patterns and prompt requirements baked into orchestration loops quickly become obsolete. By decoupling the architecture into modular interfaces, the Anthropic team ensured the core platform can evolve without breaking backwards compatibility.

> “So, if you take one thing home from this, it's that harnesses encode assumptions and assumptions can go stale. So we designed interfaces to outlast these assumptions and made the architecture more flexible.” — Priyanka Phatak

When an audience member asks to revisit the prior slide to clarify the three core interfaces, Phatak reviews the tripartite separation that future-proofs the system: 1. **The Append-Only Session Log:** An immutable ledger recording all inbound and outbound events. 2. **The Interchangeable Harness:** The execution loop orchestrating model calls and context compaction, easily swappable as model capabilities advance. 3. **The Hands:** Pluggable execution environments (sandboxes, bash environments, MCP connectors, and external API tool calls) invoked on demand.

---

[11:39](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=699s) API Credit Claiming and Workshop Logistics

Phatak transitions the session into the interactive, hands-on workshop segment. To allow attendees to build directly alongside the presentation, Anthropic provided complimentary platform API credits. Attendees are instructed to scan an on-screen QR code and either authenticate using an existing account or register a new one at the Claude platform.

As attendees pull out their smartphones to claim credits, minor conference logistics arise. Phatak pauses for about thirty seconds, fielding issues from attendees experiencing venue Wi-Fi instability ("Oh, there are problems with the internet. Oh, no."). To ensure audience questions can be heard across the room, she coordinates with Gabe Cemaj and brings in team member Travis to circulate with a handheld microphone while the platform credits propagate to user accounts over the span of a minute or two.

---

[13:49](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=829s) Core APIs: Environments, Agents, and Sessions

To introduce the developer surface of Claude Managed Agents, Phatak walks through the three foundational API objects required to build a simple "joke teller" agent before writing code in the console.

```mermaid flowchart LR accTitle: Core API Lifecycle Flow accDescr: Sequence diagram showing the three stages from Environment to Agent to Session.

subgraph Prep ["Configuration"] Env["1. Environment\n(v1/environments)\n• Network rules\n• Packages"] Agent["2. Agent\n(v1/agents)\n• Model choice\n• System prompt\n• Toolsets"] end

subgraph Exec ["Runtime"] Session["3. Session\n(v1/sessions)\n• Agent ID + Env ID\n• Idle until triggered"] end

Env --> Session Agent --> Session ```

The setup follows a clean, three-step resource lifecycle:

1. **Environments API (`/v1/environments`):** Defines the sandbox template and isolation boundaries. Developers specify networking configurations (ranging from completely unrestricted network access to whitelists restricted to specific domains or MCP endpoints) and configure pre-installed base software packages. 2. **Agent API (`/v1/agents`):** Specifies the persona and cognitive configuration. Developers supply an identifier (e.g., `joke-teller`), select a foundation model (such as Claude Opus, Claude Sonnet, or Claude Haiku), establish the system prompt (e.g., instructing the agent to act as a comedian and tell a fresh joke), and attach tool sets. Typical deployments include the standard `agent_toolset`, which equips Claude with low-level execution primitives like `bash`, file reading, file writing, and `grep`. 3. **Sessions API (`/v1/sessions`):** The operational runtime unit representing a concrete task. Instantiating a session links an `agent_id` with an `environment_id`. When initially provisioned, the session enters an idle state where no compute resources are consumed until an initial trigger event is received.

---

[15:18](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=918s) The Event Stream Architecture and Console Quick Start

Once a session is established, all communication flows through a bidirectional event stream. Phatak illustrates how input events sent by the user trigger corresponding lifecycle and output events from the agent harness:

| Event Type | Direction | Purpose / Behavior | |:--- |:--- |:--- | | `user_message` | Inbound (User $\to$ Agent) | Sends natural language instructions (e.g., *"Tell me a joke about distributed systems"*). | | `custom_tool_use` | Outbound (Agent $\to$ User) | Emitted when Claude requests an action delegated to client-side code rather than the sandbox. | | `tool_result` | Inbound (User $\to$ Agent) | Returns the client-side execution output back into Claude's event stream. | | `session_error` | System Outbound | Dispatched if execution encounters an unhandled runtime failure. | | `status_idle` | System Outbound | Marks that execution has finished and the sandbox is inactive, saving compute. | | `interrupt` | Inbound (User $\to$ Agent) | Immediately aborts the agent loop and halts ongoing work. |

Phatak notes that advanced architectural capabilities—including complex multi-agent orchestration and persistent cross-session memory—will be covered in depth by Gabe Cemaj later in the workshop. She directs attendees to navigate directly to `platform.claude.com` and open the Managed Agents section, guiding the audience toward the built-in "Quick Start" interactive tour to deploy their first agent via the console interface while team members circulate the room to troubleshoot setup questions.

## Notable quotes > [11:09](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=669s) So, if you take one thing home from this, it's that harnesses encode assumptions and assumptions can go stale. So we designed interfaces to outlast these assumptions and made the architecture more flexible. — Priyanka Phatak

> [04:16](https://www.youtube.com/watch?v=Uv0nAf_7tyU&t=256s) So typically you want to execute every task in a separate container so you're not mixing up and you're not increasing the blast radius for your tasks. — Priyanka Phatak

## Mentioned Priyanka Phatak, Gabe Cemaj, Claude Managed Agents, Anthropic, Sonnet 4.5, Opus 4.5, Claude Code, Claude Haiku, Model Context Protocol, AI Engineer

## Video description The first version of Claude Managed Agents put everything in one container. Here's why Anthropic split it apart.

NEXT UP: AI ENGINEER CODE SUMMIT Join us in SF for the second annual AIE CODE Summit, Nov 10–12, our last flagship summit of 2026. Applications live now: https://aie.codes

Priyanka Phatak, who leads the Claude Managed Agents engineering team at Anthropic, defines an agent as a model in a loop with tools, plus a harness and a sandbox, and explains why harnesses encode assumptions that go stale with each new model. She walks through the first architecture, where the session, harness and sandbox shared one hard-to-debug 'pet' container, and the redesign into an append-only session log, a brain (harness plus Claude) and hands (sandboxes and tools). Credentials stay out of the sandbox and time to first token dropped about 90%. Then she introduces the core APIs with a simple joke-teller agent.

This is part 1 of 4 of the Claude Managed Agents workshop from Anthropic.

In this video: • Why harnesses carry model-specific assumptions • Decoupling session, harness and sandbox into replaceable parts • Injecting credentials at an egress proxy so Claude never sees them • The core flow: environment, agent, session, events

SPEAKERS Priyanka Phatak, Member of Technical Staff, Anthropic (leads the Claude Managed Agents engineering team)

Gabe Cemaj, Member of Technical Staff, Anthropic GitHub: https://github.com/gcemaj

LINKS Claude Managed Agents docs: https://platform.claude.com/docs/en/managed-agents/overview Scaling Managed Agents: Decoupling the brain from the hands: https://www.anthropic.com/engineering/managed-agents

CHAPTERS 0:00 Welcome and intros 0:58 Workshop agenda 2:05 What makes an agent work 3:06 Harnesses and model assumptions 4:16 Sandboxes and limiting blast radius 5:10 First architecture: all in one container 6:05 The pet vs cattle problem 7:45 Decoupling the brain from the hands 9:05 Keeping credentials out of the sandbox 9:49 Flexible compaction, faster first token 10:49 One brain, many hands 11:09 Interfaces outlast assumptions 11:39 Claiming API credits 12:24 Q&A: the three core interfaces 13:49 Building a joke-teller agent 15:18 Sessions and the event stream 16:33 Console quick start

Recorded at the AI Engineer World's Fair 2026 in San Francisco. Subscribe for more talks from the engineers building with AI.

AI Engineer: https://ai.engineer YouTube: https://www.youtube.com/@aiDotEngineer X: https://x.com/aiDotEngineer LinkedIn: https://www.linkedin.com/company/aidotengineer/

#Claude #AIAgents #AIEngineer

[Source](https://www.youtube.com/watch?v=Uv0nAf_7tyU)

Reading summary

Anthropic restructured Claude Managed Agents away from monolithic containers into a decoupled architecture separating state, cognitive orchestration, and execution environments to prevent infrastructure rigidity and security vulnerabilities. Failure of the Monolithic Pet Container (5:10) Anthropic's initial December V1 architecture packaged the session event log, the agent harness loop, and the sandbox execution environment inside a single container. While this design simplified file access and eliminated distributed networking hops, it inadvertently created an infrastructure 'pet' that required intense maintenance. When failures occurred, engineers could not distinguish container crashes from dropped network packets without establishing fragile WebSocket streams directly into running instances. The monolithic setup also created major operational friction around privacy and enterprise integrations. Containers held live customer data and proprietary source code, barring Anthropic engineers from troubleshooting broken instances without breaching customer data boundaries. Furthermore, connecting to customer-hosted Model Context Protocol (MCP) servers inside private VPCs forced Anthropic into an unsustainable choice between complex network peering or distributing proprietary harness code directly to clients. Decoupling Sessions, Brains, and Pluggable Hands (7:45) To build an interchangeable 'cattle' infrastructure, Anthropic separated the system into three distinct interfaces: an immutable Session, the cognitive Brain, and pluggable Hands. The Session acts as an append-only event ledger capturing every user input, agent action, and response. The Brain pairs Claude with the orchestration harness; if the harness terminates unexpectedly, a replacement instance restarts by replaying the session log without state loss. The Hands are ephemeral sandboxes and MCP tool connections treated as external tool invocations that Claude can replace if they crash. Separating the harness from container provisioning reduced time to first token by approximately 90%, as Claude starts inference immediately and delays sandbox creation until code execution is explicitly needed. This separation also enables flexible context compaction strategies, such as synthesizing summaries or filtering to a trailing window of events, without mutating raw historical logs. Defending Credentials via Egress Proxies (9:05) Co-locating API secrets and execution runtimes in the V1 model exposed systems to prompt injection attacks aimed at credential theft, where malicious inputs could instruct Claude to write environment variables to readable files. In the decoupled design, authentication credentials and tokens never enter the execution sandbox. All external API and MCP requests from the sandbox must route through an egress authentication proxy situated outside the execution perimeter. The proxy intercepts outbound traffic and injects bearer tokens and authentication headers at the network boundary, ensuring that the model and sandbox never handle or expose raw credentials. Abstracting Transient Model Quirks (3:06) Orchestration harnesses inevitably codify assumptions around model limitations, but these behaviors shift across model generations. Priyanka Phatak cited Sonnet 4.5's 'context anxiety'—a tendency to prematurely rush tasks when approaching context window boundaries—which required custom context-resetting mechanisms in the harness. When upgrading to Opus 4.5, this behavior disappeared, rendering the workaround obsolete. Anthropic designed its modular interfaces specifically so the core platform can outlast shifting model-specific quirks. By keeping the append-only event ledger, orchestration harness, and execution tooling decoupled, developers can adapt prompting routines, context management, and model versions without rewriting the underlying runtime environment. Core Developer APIs and Event Streams (13:49) The public developer surface for Claude Managed Agents relies on three foundational API objects: Environments (`/v1/environments`) to define package installations and network access rules; Agents (`/v1/agents`) to configure models, system instructions, and toolsets like bash and grep; and Sessions (`/v1/sessions`) to instantiate runtime tasks that bind an agent to an environment while idling until triggered. Task execution operates over a bidirectional event stream. User inputs arrive as `user_message` events, triggering actions such as sandbox-based tool calls or client-side `custom_tool_use` events. Results return as `tool_result` events, while client control hooks like `interrupt` allow users to abort tasks mid-execution. Anthropic's architectural shift underscores that agent infrastructure must treat execution environments and orchestration logic as disposable components around an immutable log, though managing complex multi-agent state across extended sessions remains an ongoing challenge.

Source quotes

[11:09] Priyanka Phatak: So, if you take one thing home from this, it's that harnesses encode assumptions and assumptions can go stale. So we designed interfaces to outlast these assumptions and made the architecture more flexible. [4:16] Priyanka Phatak: So typically you want to execute every task in a separate container so you're not mixing up and you're not increasing the blast radius for your tasks.

Original transcript

[0:01] [music] [0:12] Thank you so much to everybody for for [0:14] joining. Um I think we're going to get [0:16] started given we have a have a full [0:19] house. Um hi everyone. My name is [0:21] Priyanka. I'm a member of technical [0:24] staff at Enthropic. Uh I lead the [0:26] engineering team that built cloud manage [0:29] agents and I'm really excited to be here [0:30] to talk to all of you uh and help you [0:33] ship your first manage agent. I've been [0:35] anthropic a little bit over two years [0:36] and the last 12 months I've been focused [0:38] on uh building um agentic infrastructure [0:42] and hope to share some of our learnings [0:44] with you. [0:45] >> Uh hello my name is Gabe Semach. I'm a [0:47] member of the technical staff uh [0:48] building cloud managed agents in [0:49] Priyanka team. I've been at Anthropic a [0:52] little bit over a year and I've been [0:54] mostly working on this my entire time. [0:58] >> All right. Um, so here is our agenda. We [1:02] will kick it off with h a little bit of [1:05] an evolution story of how we built and [1:07] scaled managed agents, some of the [1:10] pitfalls and the learnings that we had [1:12] along the way. Then we'll switch to a [1:14] hands-on part of the workshop. Uh the [1:17] first part uh we will build uh a very [1:19] simple agent uh using cloud platforms [1:22] console. You will not be writing any [1:24] code during that part. We'll just kind [1:26] of prompt our way to our first agent and [1:28] test it out. Uh then I'll hand it over [1:30] to Gabe to walk you through like a [1:32] hands-on portion. We'll be writing code [1:34] using cloud code or your favorite coding [1:36] agent. Um and then build a more complex [1:39] financial agent and then we'll have [1:41] plenty of time at the end for Q&A. We we [1:43] have a twohour slot. I know they broke [1:45] it down into four parts, but it's [1:46] basically one long presentation. Um, [1:49] hopefully it doesn't take the full two [1:50] hours. U, we want this to be pretty [1:53] interactive, so if you do have [1:54] questions, raise your hands. We have a [1:56] couple folks around that can run to you, [1:58] hand you a mic uh with a question, [2:00] especially as we get into the hands-on [2:02] uh portion. [2:04] All right, let's let's get going. Um, so [2:07] I'll start with the basics. So, we'll [2:08] we'll start with what what is an agent [2:10] or what makes an agent work? Um so agent [2:15] is basically uh a model in a loop with [2:18] tools. So you'll see on the left you [2:21] have the model that's deciding and [2:22] taking the next action and calling tools [2:24] in a loop until your task is done. So [2:26] that's like the very basic what what an [2:29] agent is. [2:32] >> Excuse me. [2:32] >> Y [2:42] slide deck or slide. [2:44] >> Oh, a link to a slide deck. Um, we can [2:48] try to [2:49] >> we we can we can share it after. [2:51] >> Yeah, we we'll share it after. It'll be [2:53] hard for us to get it out right now. Um, [2:56] but happy to answer questions uh and and [2:58] share the slide deck at the end. Are you [2:59] is it hard for you to see see the slides [3:02] from the back? Okay, sorry about that. [3:04] Um, all right. Uh, the next thing I [3:06] wanted to chat about is what a harness [3:08] is. harness is typically like a layer [3:10] that wraps around the model that helps [3:12] you make these tool calls in a loop to [3:15] get you the outcome for the task that [3:17] you're the task at hand and it's making [3:20] assumptions about what the model cannot [3:22] do and trying to sort of fill those [3:24] gaps. So it's running in a loop making [3:26] tool calls managing your context [3:29] encapsulating everything that the model [3:30] cannot do. A good example is our set 45 [3:34] model had something what we called uh [3:36] context anxiety. So whenever sonnet 45 [3:39] felt like you're getting to the end of [3:41] the context limit, it would try to wrap [3:43] up the task really quickly. So when [3:45] you're building a harness around sonnet [3:47] 45, you would add something like a [3:50] context reset to get around the [3:52] limitation of the anxiety. But with the [3:54] next model like opus 45, opus 45 did not [3:56] have this limitation and you did not [3:58] need to do this like context reset for [4:00] opus 45. So when you're building a [4:02] harness, you want to encapsulate all [4:05] these assumptions for different models [4:07] and keep up with it with every new model [4:09] that comes up, which is why building a [4:11] good harness is really really important. [4:13] And that's something we've tried to do [4:14] with cloud managed agents. And then the [4:17] last bit uh you want your agent to have [4:19] access to a sandbox or a computer [4:21] essentially uh a place where it's going [4:23] to run the code it's writing to execute [4:26] the task. Um, so typically you're giving [4:28] cloud access to like a sandbox or [4:30] container where it's executing the code [4:31] it's writing. It's able to edit files, [4:33] install dependencies, etc. Cloud code is [4:36] a really good example of this. It's [4:37] running, it's a harness essentially [4:38] running locally on your computer, has [4:41] access to your files, and it's [4:42] executing, updating your files as it [4:44] goes. Um, it's also writing uh code [4:47] that's untrusted. It might be buggy. So [4:49] you want to make sure when you're [4:51] deploying production agents uh your a [4:54] the code your agents are writing is [4:55] sandbox and contained within a [4:57] container. Um and then you want your [5:00] sandbox to be isolated and the blast [5:02] radius to be limited. So typically you [5:03] want to execute every task in a separate [5:05] container so you're not mixing up and [5:07] you're not um uh increasing the blast [5:10] radius for for your tasks. [5:13] Next up, I'll walk you through um the [5:16] first architecture that we actually [5:18] built managed agents with. This was in [5:20] December of last year where we shipped [5:22] our first architecture to our early [5:24] access customers, got a bunch of [5:26] feedback, and then actually pivoted to a [5:28] new architecture. So, I'm going to walk [5:29] you through some of like the pitfall [5:31] pitfalls and like issues that we saw [5:33] with the first one. So, with the first [5:36] architecture, what we did was we put [5:38] everything in the container. So we had [5:40] the session log of everything that's [5:42] happened within that session. So test [5:43] session is essentially your um unit of [5:46] work. Um the harness was also running [5:49] inside the container and then the [5:51] sandbox execution was also happening [5:53] inside the container. The benefit of [5:55] that was like because everything was in [5:56] the container there was no service [5:58] boundaries to design for. Everything was [6:00] local um easy to edit. File edits were [6:03] essentially just like sis calls. [6:08] But what happened was we realized we [6:10] adopted a pet. Um so if uh if you've not [6:13] heard about the pet and cattle analogy [6:16] from like the old infrastructure days, [6:18] um pet is when you essentially have a [6:20] named and handtended entity. When it [6:23] gets sick, you have to nurture it back [6:25] to life. Otherwise, you you basically [6:27] cannot afford to lose it. And cattle is [6:29] more interchangeable, more disposable. [6:32] So when one fails, you can replace it [6:33] with another one and move on. So a good [6:35] example is imagine you had like a single [6:37] database shard. It goes down, your [6:40] product is down, you have a pet. But [6:42] imagine you have a master replica set [6:43] up. Your master goes down, you can bring [6:45] up a replica. That's a cattle, right? So [6:47] you have many instances. One goes down, [6:49] that's not a problem. You can bring it [6:50] back up. So what we had with our initial [6:52] setup was essentially a pet. [6:56] Um so few few issues with this debugging [6:59] was really hard because everything was [7:01] running in the container. We didn't know [7:03] what was causing the issue. So a a drop [7:05] packet a dead container would show up [7:07] very similarly and we had to essentially [7:09] like websocket stream into the container [7:11] to debug. Um the other issue was [7:14] investigating meant we had to uh [7:17] essentially investigating was hard [7:19] because customer data would live on [7:20] these containers. So we didn't have a [7:22] way in essentially to go in and debug. [7:24] So that was like the other issue we saw [7:26] in our early access. And then the last [7:28] one was if a customer wanted us to [7:30] connect to let's say an M MCP in their [7:33] VPC, it meant peering networks or [7:36] shipping them our harness and having [7:37] them run it. So there were like a bunch [7:39] of challenges with that architecture [7:40] that that we weren't able to really have [7:43] a good solution to overcome. So what we [7:45] decided that we wanted to essentially [7:47] decouple the brains from the hands and [7:50] I'll dive into what that means. [7:53] Um so the agent essentially became three [7:56] separate interfaces. On the left you [7:58] have the session which is essentially an [8:01] appendon log of everything that has [8:03] happened in the session so far. In the [8:05] middle you have the brain that's your [8:06] harness or the agent loop along with [8:08] cloud. Um and then on the right are the [8:10] hands. So sandboxes your MCP tool calls [8:13] etc. Provisioned on demand uh gone when [8:16] the work is done. And if you need if you [8:18] lose a sandbox you just spin it back up. [8:23] So every component essentially became a [8:24] cattle and interchangeable. So when the [8:26] sandbox died, uh the harness or cloud [8:29] could choose to just spin it back up, [8:31] right? The error essentially went back [8:33] to cloud and the sandbox to cloud was [8:35] essentially like any other tool call. So [8:37] the tool call fails, sandbox fails, it [8:38] decides what to do and it might decide [8:40] to spin it up again or choose to [8:42] continue to move on. um when the harness [8:45] died, you could bring up a new instance [8:46] of the harness and continue where you [8:49] left off by essentially just reading [8:51] your event log from the session and [8:52] continue from there. So work resumes [8:55] from the last event as if nothing went [8:57] wrong, nothing happened. Um so the only [9:00] thing with protecting here was like your [9:01] session log. Everything else was [9:03] interchangeable, could go down, you [9:04] could bring it back up. [9:08] The other thing that we did was [9:09] credentials never entered our sandbox. [9:12] With our previous setup, your credential [9:14] would be in your sandbox, so you'd be [9:16] more susceptible to prompt injection. [9:18] The change we made was if the sandbox [9:20] ever needed to call out um to uh [9:25] something that needed a token or access [9:27] control, it would be routed through a [9:29] proxy that would inject your token [9:31] before it called the external endpoint [9:33] or external MCP. That way the model [9:36] never sees your credentials or your [9:37] tokens which means you can never prompt [9:39] inject claude to say like hey give me [9:42] your tokens or print out the tokens or [9:44] write them to a file. You can never do [9:45] that because cloud actually never sees [9:47] your your tokens. [9:51] The other thing we did was because we [9:53] had this like append only event log in [9:55] the session um our compaction strategy [9:57] could stay flexible. So nothing is ever [10:00] thrown away. We're not compacting and [10:01] changing your event stream. We're always [10:03] storing each and every event that [10:05] happened and then the compaction [10:06] strategy is the one that's deciding oh [10:08] do I want to look at my entire event log [10:11] uh summarize and put it in the context [10:13] do I want to only look at like the last [10:14] n events and put those into context. So [10:17] we we could have a more flexible context [10:19] strategy because of this like interface [10:21] design that we chose. [10:24] And then the other benefit we saw is [10:26] because we could immediately start our [10:29] inference calls, we were able to bring [10:31] down the TAM to force token by about [10:33] 90%. So the cloud would only spawn the [10:35] sandbox when it needed and it would not [10:37] wait for the container sandbox to spin [10:39] up for you to get your first token back. [10:41] So we were able to get like a much [10:43] snappier and faster experience with this [10:45] uh architectural change. [10:50] Um, and then here's sort of like the [10:52] illustration of like one brain can reach [10:54] many hands. So your agent loop or [10:57] harness can now call a sandbox [10:58] container. It could call into a [11:00] customer's VPC. It could call into an [11:02] MCP server. So all these like hands are [11:05] essentially interchangeable. You can [11:06] call and plug in many of these and it [11:08] made our architecture a lot more [11:10] flexible. [11:13] Um, so if you take one thing home from [11:15] this, it's that harnesses encode [11:18] assumptions and assumptions can go [11:20] stale. So we designed interfaces to [11:23] outlast these assumptions and made the [11:25] architecture more flexible. So this [11:28] allowed us to like I said change our [11:30] compaction strategy, change out the [11:31] harness completely but the interface and [11:34] the architecture remains uh the same and [11:37] we can really have a more pluggable way [11:39] of operating this. [11:43] All right, so next we're going to get [11:45] into a little bit of a hands-on portion. [11:48] U we got you some complimentary API [11:51] credits to help you build with us today. [11:54] So, please scan the QR code, either sign [11:57] in to your cloud platform account or [11:59] create a new one and you should be able [12:01] to um get in there and get those credits [12:04] so that you can build with me and and [12:06] then with Gabe. [12:08] And I'll I'll leave this for for a [12:09] second. Hi. [12:13] >> Sorry, what? [12:15] >> Last slide. [12:25] It's basically what we talked about [12:27] here, right? This is the [12:30] this is sort of like the three [12:32] interfaces we designed for, right? So [12:33] the first one is the the the question [12:35] was like what were the interfaces that [12:36] we designed that ma made things outlast [12:39] uh changes. So we have the append only [12:41] session log. You have the harness that's [12:43] again interchangeable and then the hands [12:46] where you can plug in a sandbox tool [12:48] calls or whatever the model might need [12:50] access to and that that's what kind of [12:52] makes it more generic and extendable. [12:56] All right, going back to [13:00] the credits. Uh, does anyone else need [13:03] to scan this before we jump in? Okay, [13:05] still seeing a couple phones. Okay, [13:08] going to give everyone about 30 seconds. [13:10] Thanks for your patience. [13:16] Oh, there are problems with the [13:17] internet. Oh, no. [13:26] >> Uh, Gabe, do we have a mic? Because I I [13:28] can't hear some of the questions. [13:37] Yeah, the the credit should arrive once [13:39] you once you sign up in hopefully a [13:42] minute or two. Um, yeah, we're getting a [13:44] mic so that we can hopefully walk around [13:46] and uh get get some of these questions. [13:48] But yeah, I'm going to walk you through [13:51] building a really simple agent that [13:53] tells you jokes. [13:57] Uh, and I'm going to cover some of our [13:58] core APIs, our concepts first, and then [14:01] we'll hop over to [14:02] platform.entthropic.com [14:04] to build your first agent. Um, so our [14:06] first step is going to be creating our [14:08] our environments API, which is v1 [14:10] environments that helps you create the [14:13] environment or template for your [14:14] sandbox. So this is going to have uh [14:17] your networking setup. So do you want uh [14:19] unrestricted networking or you want to [14:21] restrict it to specific domains or MCPS? [14:24] you can define what packages you want [14:26] installed on your uh container or [14:28] sandbox. Um so this is going to be like [14:31] the first step we're going to take to [14:32] set up our environment. [14:35] Next you're going to create the agent. [14:37] So agent is essentially uh you're you [14:40] can give your agent a name. So in this [14:42] case we have we're going to call it joke [14:43] teller. Um we're going to choose which [14:46] model you want to use for this agent. So [14:48] you can use opus 48, you can use haiku [14:51] uh or sonnet uh your choice. Uh and then [14:55] we're going to provide the agent with a [14:56] system prompt. In this case, we're going [14:58] to say you're a comedian. Find a fresh [15:00] joke on the topic. Deliver it well. Uh [15:03] and then you can provide this agent with [15:05] tools. In this case, we're going to [15:07] provide it with agent tool set, which is [15:08] sort of like our basic tool set. This is [15:10] like your bash tool set, read, write, [15:12] grap, etc. And you almost all agents [15:15] will need need this. Um so that's going [15:18] to be your step two. Step three is going [15:20] to be finally creating the session. Um [15:23] so session takes an agent ID and an [15:25] environment ID and creates a session. [15:26] This is your task uh unit of work or [15:29] your task. Um and when the session is [15:32] provisioned it's idle. No work has been [15:34] done right until you send an event. [15:39] And then this is sort of what an event [15:41] stream on your session would look like. [15:43] Um you're going to have events that you [15:45] send and then events that the agent will [15:46] come back to you with. On the left side [15:48] you'll see you have user message. You [15:50] can say, "Oh, tell me a joke about [15:51] distributed systems." And then the agent [15:53] will come back to you with a funny joke. [15:55] Um, you can use something called a [15:56] custom tool. Custom tool essentially [15:58] lets you define a custom tool that you [16:01] want to handle how you uh how you [16:02] respond to it and claude will [16:04] essentially put a custom tool use event [16:07] on your event stream that you can listen [16:08] to and then you can process that event [16:10] and then return the result um to claim [16:14] tool result. And then there are some [16:15] other examples in there for what type of [16:17] events you would see. So you'll see [16:19] session error if your session ever ends [16:21] up in an error or sees an error. Status [16:23] idle is when your session is idle, not [16:25] working. And this is typically when [16:26] you're not really have a sandbox that [16:28] you're using. Um and then interrupt on [16:30] the left is when you want to stop or [16:33] kill the session and don't want to do [16:34] the work anymore. [16:36] Uh this is sort of like our full feature [16:38] list. Maybe if we have time at the end, [16:40] Gabe can kind of come back to this and [16:42] dive in. But Gabe will be kind of [16:43] working with you on his part of the [16:45] workshop going deeper into some of like [16:46] these concepts like multi-agent and [16:48] memory that we also provide. [16:52] All right, before we go to that one, [16:54] we're going to hop over now to [16:57] platform.claw.com. [17:00] Um, and hopefully you can use your API [17:02] credits and see those. Now, if you [17:04] don't, I have Travis walking around with [17:06] the mic in case you have questions or [17:08] you need to just like flag him down for [17:09] for anything. Um but if you go to your [17:12] console you'll see in this manage agent [17:14] section there is something called as a [17:17] quick start. This is sort of like our um [17:20] guided tour of how to build your first [17:22] agent. [17:36] [music]