# What's the difference between the Claude Agent SDK and Claude Managed Agents?

The Claude Agent SDK is a library you run yourself, in a process you control, embedding Claude Code's own agent loop, tools, and hooks into your application; Claude Managed Agents is Anthropic's hosted alternative, where Claude runs in an Anthropic-managed cloud sandbox, or a self-hosted one on your infrastructure, and you talk to it over events instead of owning the process. Anthropic's own docs frame the SDK as a library that embeds Claude Code's agent, its built-in tools, permissions, sessions, and hooks, into a process you operate yourself; Managed Agents is for "long-running tasks and asynchronous work" where you'd rather not build your own loop, sandbox, or tool execution layer.

Managed Agents also persists more than a bare SDK session does: conversation history, sandbox state, and outputs are stored server-side, resumable after a pause and runnable on a schedule through scheduled deployments. The tradeoff is what that history costs you: a Managed Agents session isn't eligible for zero data retention, because there's nothing to retain zero of once the state has to survive a pause. [Grading a run you can only reconstruct from stored events afterward](/answers/agent-reliability/how-do-you-measure-agent-reliability-in-production) is a different problem than grading one your own process already watched happen.

---

Sources:
- Claude Docs: Agent SDK overview: https://code.claude.com/docs/en/agent-sdk/overview (fetched 2026-09-27)
- Claude Docs: Managed Agents overview: https://platform.claude.com/docs/en/managed-agents/overview (fetched 2026-09-27)

Source: https://tessary.ai/answers/claude-agent-sdk-evals/whats-the-difference-between-the-claude-agent-sdk-and-claude-managed-agents
More on Claude agent sdk evals: https://tessary.ai/answers/claude-agent-sdk-evals
From Tessary, agent reliability for AI agents in production: https://tessary.ai
