# Claude Managed Agents

> A Claude service that runs your agent for you. Its tools run in a sandbox.

**Field:** Software Development  
**Category:** AI Engineering  
**Also known as:** Managed Agents, Claude Managed Agents API, Anthropic Managed Agents

## Think of it like

It is like a helper who comes with a desk and tools. You just say what job to do.

## Definition

Claude Managed Agents is a part of the Claude API that runs a whole agent for you. You set up an agent once, with a model, a system prompt and its tools. Then you pick an environment, which is a cloud sandbox or one on your own servers. Each job runs as a session, and you talk to it by sending events and reading a stream back. Claude runs commands, edits files and searches the web inside that sandbox. It is in beta, so each call needs the managed-agents-2026-04-01 beta header.

## Example

Emma's team makes one agent that fixes failing tests. Each night a session copies the code into a cloud sandbox, runs the tests and streams back what it changed.

## Example code

```python
session = client.beta.sessions.create(
    agent=agent.id,
    environment_id=environment.id,
    title="Nightly test fix",
)
```

A session joins one agent to one environment. Work starts when you send it an event.

## Why it matters

You skip building the agent loop, the sandbox and the tool runner yourself. Long jobs can run for minutes or hours and pick up again after a pause.

## Common mistake

Sending it data that must not be kept. Sessions keep their history on the service until you delete them. So it is not zero data retention.

## Three principles

- **Agent, environment, session.** Set up once, run many times.
- **Events in, stream out.** Steer it while it works.
- **A beta header.** Needed on every call for now.

## Related terms

- [Claude API](https://learn.benibix.com/term/development/claude-api)
- [Agent Harness](https://learn.benibix.com/term/ai/agent-harness)
- [Agent Sandbox](https://learn.benibix.com/term/ai/agent-sandbox)
- [Claude Agent SDK](https://learn.benibix.com/term/ai/claude-agent-sdk)
- [Agent Loop](https://learn.benibix.com/term/ai/agent-loop)
- [Server-Sent Events (SSE)](https://learn.benibix.com/term/development/server-sent-events)
- [Model Context Protocol (MCP)](https://learn.benibix.com/term/ai/model-context-protocol)

## Told apart from

- [Claude Managed Agents vs Claude Agent SDK](https://learn.benibix.com/compare/claude-managed-agents-vs-claude-agent-sdk): People think Claude Managed Agents and the Claude Agent SDK are the same, since both give you a ready-made Claude agent. The Agent SDK is a library. Its agent runs inside your own app, on your own machine or server. Managed Agents is a service in the Claude API. Its agent runs as a hosted session in a sandbox, and your app sends it events.

![Two setup boxes at the top: an agent holding the model, system prompt and tools, and an environment holding a cloud sandbox and its network rules. Both feed a session box in the middle, where Claude runs bash, edits files and searches the web inside the sandbox. On the left, your app sends events in and gets a stream back. On the right, a note lists what you do not build: the agent loop, the sandbox and the tool runner.](https://learn.benibix.com/diagrams/dev6-managed-agents.svg)

---

Source: https://learn.benibix.com/term/development/claude-managed-agents
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
