D1 · Agentic Architecture › Cluster 4 · Multi-Agent

4.9 · Managed Agents vs. Self-Orchestrated

Who hosts the loop — Anthropic or you?

CONCEPT The one distinction that matters

Everything in Cluster 4 so far assumed you host the agent loop — you call POST /v1/messages, inspect stop_reason, run tools, and append tool_results. That's the self-orchestrated model ("Claude API + tool use"). Managed Agents flip the hosting: Anthropic hosts the agent loop and a per-session container where tools execute. You describe the agent once; Anthropic runs it.

🔑 Awareness-level distinction: who hosts the loop and tool execution? Self-orchestrated = you. Managed Agents = Anthropic, plus a hosted per-session container.

CONCEPT The Managed Agents shape

Conceptually there are two objects:

⚠️ Keep this conceptual for the exam. Know the shape — persisted versioned Agent → Sessions that reference it, hosted loop + per-session container — not the full API surface.

CONCEPT Side-by-side

AspectSelf-orchestrated (Claude API + tool use)Managed Agents
Who runs the loopYou (your code drives the loop)Anthropic hosts the loop
Where tools executeYour infrastructureAn Anthropic-hosted per-session container
Config locationIn your code each callOn a persisted, versioned Agent object
How you run itCall POST /v1/messages in a loopCreate a Session that references the Agent by id
Control vs. convenienceMaximum control & flexibilityLess to build/operate; Anthropic manages the loop & container

DIAGRAM Where the loop lives

flowchart TB subgraph SELF["Self-orchestrated — YOU host"] direction LR YC["Your code:
loop + tool execution"] <-->|POST /v1/messages| API1["Claude API"] end subgraph MAN["Managed Agents — Anthropic hosts"] direction LR AG["📄 Agent (persisted, versioned)
model · system · tools"] --> SESS["Session (references Agent by id)"] SESS --> HOST["Anthropic-hosted loop
+ per-session container (tools run here)"] end classDef y fill:#d1ecf1,stroke:#17a2b8,color:#0c5460; classDef a fill:#e2d4f0,stroke:#764ba2,color:#3d1a5b; class YC y; class AG a; class SESS a; class HOST a;

TRADE-OFFS Control vs. managed convenience

✅ Self-orchestrated

  • Full control over the loop and tool execution
  • Runs on your infrastructure, your environment
  • Maximum flexibility for custom orchestration

✅ Managed Agents

  • Anthropic hosts the loop + per-session container
  • Config lives on a persisted, versioned Agent
  • Less to build and operate yourself

EXAM TRAPS

Trap: Confusing who hosts the loop. → In Managed Agents, Anthropic hosts the loop and the per-session container. With "Claude API + tool use," you host the loop and run the tools.
Trap: Thinking a Session carries the model/system/tools. → Those live on the persisted, versioned Agent. A Session just references the Agent by id.
Trap: Assuming Managed Agents means no tool sandbox. → Tools execute in an Anthropic-hosted per-session container, not on your own machines.

PRACTICE

Q1 · In one sentence, what's the core difference between Managed Agents and "Claude API + tool use"?

In Managed Agents, Anthropic hosts the agent loop and a per-session container where tools run; with "Claude API + tool use," you host the loop and execute the tools yourself.

Q2 · Where do a Managed Agent's model, system prompt, and tools live?

On the persisted, versioned Agent object. You create the Agent once, then create Sessions that reference it by id to run it.

Q3 · A team wants Anthropic to run the loop and provide a container for tool execution. Which option?

Managed Agents. That's exactly the hosted-loop + per-session-container model, versus self-hosting the loop with the plain Claude API + tool use.