AI Codex
Agents & OrchestrationHow It Works

Claude Managed Agents: a hosted agent loop without the infrastructure

In brief

Anthropic now runs the full agent loop for you — sandboxed execution, built-in tools, and event streaming included. Here's what you get and when it makes sense over building the loop yourself.

5 min read·AI Agent

Contents

Sign in to save

When you build an agentic system with Claude yourself, you manage the whole loop: running each model call, handling tool execution, managing state between steps, dealing with errors, streaming results back to users. That is real work. Claude Managed Agents (public beta, April 8 2026) is Anthropic running that loop for you.

You send a task. Anthropic handles the iteration. You get back results via server-sent events as the agent works.

What is included

Sandboxed execution. The agent runs in an isolated environment. Code it writes executes in a secure sandbox — you do not need to set that up yourself.

Built-in tools. Web search, code execution, file operations, and browser use are available without you wiring them up separately. You can include your own tools alongside them.

Server-sent event streaming. The agent streams progress as it works — steps completed, tool calls made, intermediate outputs. You get observability without building it.

Automatic error handling. Managed Agents handles retries and recovery from common failure modes in the agent loop.

The API shape

The request uses a different endpoint from the standard messages API. It requires the beta header.

import anthropic

client = anthropic.Anthropic()

with client.beta.managed_agents.stream(
    model="claude-sonnet-4-6",
    task="Research the top three competitors for [company] and summarize their pricing",
    betas=["managed-agents-2026-04-01"],
    tools=["web_search", "code_execution"],
    max_steps=20,
) as stream:
    for event in stream:
        print(event)

You can add custom tools alongside the built-in ones. The agent decides which tools to use and when.

DIY loop vs. Managed Agents

Building your own agent loop gives you full control: custom tool logic, precise state management, specific error handling, the ability to inject context between steps. If your use case is highly customized, building the loop yourself is still the right call.

Managed Agents makes sense when:

  • You want to ship an agentic feature without building the infrastructure
  • Your use case fits the built-in tool set (search, code, browser, files)
  • You want streaming observability without building it
  • You are prototyping before deciding whether to invest in a custom loop

Combining with the advisor tool

You can pair Managed Agents with the advisor tool: use Sonnet as the executor in a Managed Agent loop, with Opus as the advisor for hard decisions. The two features are compatible.

Official docs

Full reference: platform.claude.com/docs/en/agents-and-tools/managed-agents

Weekly brief

For people actually using Claude at work.

What practitioners are building, the mistakes worth avoiding, and the workflows that actually stick. No tutorials. No hype.

No spam. Unsubscribe anytime.

What to read next

All articles →