Skip to content
Gespräch vereinbaren
AI

Claude Managed Agents: Run Autonomous AI Agents Without the Infrastructure Headache

Felix Schmidt

Building an AI agent that can actually do things — run code, search the web, read and write files — is harder than it looks. Beyond choosing a model, you need a reliable agent loop, a sandboxed execution environment, tool integrations, state management, and streaming infrastructure. That's a lot of plumbing before you've even touched your actual use case.

Claude Managed Agents changes that calculus. It's Anthropic's pre-built, fully managed agent harness: you define what the agent should do, and the platform handles how it runs.

The Core Mental Model

Claude Managed Agents is built around four concepts that map cleanly to how you actually think about agents:

Agent — the "who": the model, system prompt, tools, MCP servers, and skills that define the agent's capabilities and personality. You configure this once and reuse it across many sessions.

Environment — the "where": a cloud container template specifying which packages are available (Python, Node.js, Go, etc.), network access rules, and any files that should be pre-mounted. Think of it as the agent's workspace.

Session — the "what": a running agent instance that takes a specific task, executes it inside an environment, and produces outputs. Sessions are ephemeral but their event history is persisted server-side.

Events — the "how": the message exchange between your application and the session. You send user turns, Claude streams back tool calls and results via server-sent events (SSE), and you can inject new messages at any point to steer or interrupt.

How a Session Flows

The lifecycle is refreshingly straightforward. You create an agent (once), configure an environment (once or per task), then start a session with a task. Claude picks up the task, calls tools as needed — bash commands, file reads, web searches — and streams results back in real time. If you want to redirect mid-execution, just send another event. When the task is done, the session closes and outputs are available.

What makes this compelling for production use is what you don't have to build: the retry logic, the tool execution layer, the context compaction when conversations get long, the prompt caching for efficiency. All of that is handled for you.

When to Reach for Managed Agents

Managed Agents fits naturally when your workload involves any of the following:

Long-running execution — tasks that take minutes or hours, with many sequential tool calls. A synchronous request-response pattern breaks down here; async sessions with SSE streaming don't.

Cloud infrastructure needs — your agent needs to run Python, install packages, execute shell scripts, or access the network in a controlled way. Managed Agents provides a secure container out of the box.

Minimal infrastructure budget — you want to ship fast without building a custom agent runtime. Managed Agents collapses months of infrastructure work into a few API calls. Early adopters like Notion and Asana reported 10x improvements in time-to-ship.

Stateful interactions — you need persistent file systems and conversation history across multiple exchanges with the same agent.

If instead you need fine-grained control over the agent loop, or you're building a highly custom tool execution layer, the raw Messages API gives you more flexibility.

Built-in Tools

Out of the box, Claude has access to bash (shell commands), file operations (read, write, edit, glob, grep), web search and fetch, and MCP servers for connecting to external services. This covers a wide range of real-world tasks: writing and running code, data processing, research, file manipulation, and integration with third-party APIs.

Practical Examples

Example 1: Competitive Research with Web Search

One of the most natural fits for Managed Agents is research that requires browsing multiple sources and synthesizing findings. Here's how you'd set up an agent that monitors competitor pricing:

import anthropic

client = anthropic.Anthropic()

# Create the agent once
agent = client.beta.agents.create(
    model="claude-sonnet-4-6",
    name="Competitor Research Agent",
    system_prompt="""You are a market research assistant. When given a product category,
search the web for current pricing from the top 5 competitors, extract structured data,
and produce a markdown report with a comparison table.""",
    tools=[{"type": "agent_toolset_20260401"}],  # includes web_search + web_fetch
)

# Start a session with a concrete task
session = client.beta.sessions.create(
    agent=agent.id,
    environment_id=environment.id,
    title="Competitor pricing research",
)

# Send the task as an event and stream results
with client.beta.sessions.events.stream(session.id) as stream:
    client.beta.sessions.events.send(
        session.id,
        events=[{
            "type": "user.message",
            "content": [{"type": "text", "text": (
                "Research current pricing for project management SaaS tools. "
                "Focus on Asana, Linear, Monday.com, Notion, and Basecamp. "
                "Include plan tiers and monthly/annual pricing."
            )}],
        }],
    )
    for event in stream:
        if event.type == "agent.message":
            for block in event.content:
                print(block.text, end="")
        elif event.type == "session.status_idle":
            break

Claude will autonomously search the web, visit each competitor's pricing page, extract the relevant data, and compile the report — all within a single session. No orchestration logic needed on your end. The same agent definition can be reused for any product category.


Example 2: Automated Data Pipeline with Code Execution

Managed Agents also shines for tasks that combine code generation with immediate execution — a pattern that's tedious to build yourself but trivial to delegate. Here's an agent that processes a CSV upload and produces an analysis:

import anthropic

client = anthropic.Anthropic()

# Create a persistent data analyst agent
agent = client.beta.agents.create(
    model="claude-sonnet-4-6",
    name="Data Analyst Agent",
    system_prompt="""You are a data analyst. When given a CSV file path, load it with pandas,
perform exploratory analysis (shape, dtypes, missing values, key statistics), identify
interesting patterns, and write a concise summary report to /output/report.md.
Also save any charts as PNG files in /output/.""",
    tools=[{
        "type": "agent_toolset_20260401",
        "configs": [
            {"name": "web_search", "enabled": False},  # disable web access
            {"name": "web_fetch", "enabled": False},
        ],
    }],
)

# Configure an environment with pandas and matplotlib pre-installed
environment = client.beta.environments.create(
    name="data-analysis-env",
    config={
        "type": "cloud",
        "networking": {"type": "unrestricted"},
    },
)

# Run the analysis
session = client.beta.sessions.create(
    agent=agent.id,
    environment_id=environment.id,
)

with client.beta.sessions.events.stream(session.id) as stream:
    client.beta.sessions.events.send(
        session.id,
        events=[{
            "type": "user.message",
            "content": [{"type": "text", "text": "Analyse /data/sales_data.csv and produce a report with your key findings."}],
        }],
    )
    for event in stream:
        if event.type == "agent.message":
            for block in event.content:
                print(block.text, end="")
        elif event.type == "agent.tool_use":
            print(f"\n[Tool: {event.name}]")
        elif event.type == "session.status_idle":
            print("\n\nDone.")
            break

The agent writes and executes Python code in the secure container, iterates if something fails, and writes the finished report to /output/. The entire workflow — code generation, execution, error handling, and output — happens inside the managed session.

Pricing

Managed Agents uses consumption-based pricing: standard Claude Platform token rates apply, plus $0.08 per session-hour for active runtime. There are no fixed infrastructure costs — you pay only for what runs.

Current Status

Claude Managed Agents launched into public beta on April 8, 2026. All endpoints require the managed-agents-2026-04-01 beta header (the SDK sets this automatically). Three features — outcomes, multi-agent orchestration, and memory — are in research preview and require separate access.

Rate limits are 60 requests per minute for create operations and 600 for reads, per organization.

Getting Started

You need a Claude API key and access is enabled by default for all API accounts. The quickstart walks through creating your first session, and the API reference covers the full endpoint surface.

For most teams shipping AI-powered automation, Managed Agents removes the hardest parts of the infrastructure story — and that's a meaningful shift.


Sources

Dieses Thema betrifft dein Team? Lass uns besprechen, wie ich helfen kann.

Diese Website verwendet Drittdienste (Google reCAPTCHA, Calendly), die Cookies setzen können. Mehr dazu in meiner Datenschutzerklärung .