🧭 Claude Managed Agents: A Fully Hosted Agent Harness Launches in Public Beta
Anthropic has shipped Claude Managed Agents in public beta — a hosted service that runs Claude as an autonomous agent without requiring you to build or maintain your own agent loop, sandbox, or tool execution layer. Instead of wiring together containers, managing persistent state, and piping tool results back manually, you define an agent (model + system prompt + tools), configure an environment (a cloud container with pre-installed packages and network rules), and start a session — then send events and stream back results via server-sent events (SSE).
All Managed Agents endpoints require the beta header anthropic-beta: managed-agents-2026-04-01; the SDK sets it automatically. Access is enabled by default for all API accounts.
Core concepts
Agent — the model, system prompt, tools, MCP servers, and skills. Create once, reference by ID across sessions.
Environment — a configured cloud container: pre-installed packages (Python, Node.js, Go…), network access rules, and mounted files.
Session — a running agent instance within an environment. Event history is persisted server-side; you can fetch it in full at any time.
Events — the protocol: user messages, tool results, and status updates flow in both directions as SSE.
Built-in tools available to every agent
Bash — run shell commands inside the container
File operations — read, write, edit, glob, and grep files in the container
Web search & fetch — retrieve content from URLs or run searches
MCP servers — connect to external tool providers via MCP
The harness includes built-in prompt caching and compaction (released last week), so long-running sessions automatically avoid context exhaustion without developer intervention. You can also steer or interrupt a running session mid-execution by sending additional user events.
When to choose Managed Agents over the Messages API
The Messages API gives you maximum control — use it when you need a custom agent loop, fine-grained tool execution, or tight integration with your own infrastructure. Choose Managed Agents when your workload runs for minutes or hours, needs cloud containers with pre-installed dependencies, or must survive network interruptions gracefully. The session log acts as an external context object, so a crashed harness can resume exactly where it left off via wake(sessionId) — a capability you'd have to build yourself on the Messages API.
Research preview features (request access)
Three capabilities are in a separate research preview — outcomes (structured goal tracking), multiagent (sub-agent spawning within a session), and memory (cross-session persistence). Fill in Anthropic's form at claude.com/form/claude-managed-agents to request early access.
🧭 The ant CLI: Script, Explore, and Version-Control the Claude API from Your Terminal
Alongside Managed Agents, Anthropic released ant — a command-line client for the full Claude API. Every API resource is a subcommand, beta resources live under the beta: prefix (and automatically send the correct anthropic-beta header), and Claude Code knows how to use ant natively — meaning you can ask Claude Code to introspect your agent sessions without writing any glue code.
One of the most useful patterns ant enables is storing agent and environment definitions as YAML files in your repository and syncing them to the API in CI. This means your agent configurations get code-reviewed, diffed, and rolled back like any other infrastructure-as-code:
# Define your agent
cat summarizer.agent.yaml
# name: Summarizer
# model: claude-sonnet-4-6
# system: You are a helpful assistant that writes concise summaries.
# tools:
# - type: agent_toolset_20260401
# Create it
ant beta:agents create < summarizer.agent.yaml
# Update it in CI (needs the ID and current version as optimistic lock)
ant beta:agents update \
--agent-id agent_011CYm1BLqPXpQRk5khsSXrs \
--version 1 \
< summarizer.agent.yaml
Extract IDs and chain commands
The --transform flag (powered by GJSON paths) and --format yaml together let you extract scalar values cleanly for use in shell variables — useful for scripting multi-step workflows:
# Capture the first agent's ID
FIRST_AGENT=$(ant beta:agents list \
--transform id --format yaml | head -1)
# List its versions
ant beta:agents:versions list \
--agent-id "$FIRST_AGENT" \
--transform "{version,created_at}" --format jsonl
Ask Claude Code to operate your API resources
With ant installed and ANTHROPIC_API_KEY set, Claude Code can operate the API on your behalf. Try prompts like: "List my recent agent sessions and summarize which ones errored" or "Pull the events for session X and tell me where the agent got stuck." Claude Code shells out to ant, parses the structured output, and reasons over it — no custom integration needed.
ant CLIdeveloper toolsClaude Codeinfrastructure as codeYAMLscripting
🧭 Inside Managed Agents: Decoupling the Brain from the Hands
Anthropic's engineering team published "Scaling Managed Agents: Decoupling the brain from the hands" — the architecture post explaining how they solved the core challenge of building a hosted agent service: how do you design an infrastructure that won't become obsolete as the models themselves improve?
Their early, coupled design placed the harness, session, and sandbox in a single container — a setup that created fragile "pets": if the container failed, the entire session was lost. The breakthrough was a three-way split:
Brain — Claude and its harness (the inference logic). Stateless; can be restarted without losing the session.
Hands — the sandboxes and tools performing real-world actions. Replaced via provision({resources}) calls; containers are now cattle, not pets.
Session — an append-only event log that lives outside both. Recovery is just wake(sessionId) + getSession(id).
Security isolation that falls out of the design
Because token storage is separated from execution sandboxes, credentials are never accessible to generated code. Git tokens initialise repositories without being exposed inside the container; OAuth tokens stay in secure vaults while the harness calls external services through proxies. This isn't bolted on — it's a structural consequence of separating the brain from the hands.
Performance numbers
Decoupling enabled stateless harnesses — eliminating the provisioning overhead of spinning up a new container on every run. The result: time-to-first-token (TTFT) dropped roughly 60% at p50 and over 90% at p95 compared to the coupled design. The tail latency improvement is especially significant for interactive use cases where a slow start is visible to the end user.
What this means for teams building their own agent infrastructure
Even if you're not using Managed Agents, the brain/hands/session split is a transferable pattern. Any agentic system where the harness shares a process or container with the sandbox is vulnerable to total failure on any crash. Externalising the event log — even to a simple append-only store like Redis Streams or a Postgres table — means any harness restart can replay from the last event rather than starting from scratch. The performance gains Anthropic cites (60–90% TTFT reduction) come directly from making the harness stateless enough to start instantaneously, which is achievable in custom agent loops too.