Claude Managed Agents: Anthropic Simplifies Autonomous AI
Le brief IA que les pros lisent chaque soir
Les 7 actus IA du jour, décryptées en 5 min. Gratuit.
Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.
Choisis ton rythme
Gratuit · Pas de spam · Désabonnement en 1 clic
Claude Managed Agents: A New Era for Autonomous Agents
On April 8, 2026, Anthropic launched the public beta of Claude Managed Agents, a revolutionary infrastructure that enables the execution of autonomous agents by shifting the execution burden from developers to a hosted environment. This system provides a turnkey solution where developers can define an agent, configure its permissions, and let Anthropic manage the execution, thus eliminating the need to provision servers or code isolation logic.
Key Concepts of Claude Managed Agents
Claude Managed Agents is based on four fundamental concepts:
- Agent: This refers to the definition of the agent, including the model, system prompt, connections to MCP servers, and skills.
- Environment: This is the space where sessions run, either in a cloud sandbox managed by Anthropic or self-hosted.
- Session: An active instance of an agent in an environment, performing a specific task with its own file system and event stream.
- Events: The messages exchanged between the application and the agent, including user interactions and tool results.
Consumption-Based Pricing
The pricing for Claude Managed Agents is transparent, based on the consumption of Claude API tokens and active execution time. Users pay for the tokens used, a cost of $0.08 per hour of active session, and $10 per 1,000 web searches. Waiting time is not charged, aligning costs with actual usage.
Advanced Features for Optimized Management
Claude Managed Agents offers several key features:
- Secure Sandboxing: Agents operate in secure environments, with tool and secret management handled by Anthropic.
- Long-Duration Autonomous Sessions: Agents can run for extended periods, with session persistence even in the event of network disconnection.
- Stateful Design: Sessions retain conversation history and sandbox state, although this excludes coverage for Zero Data Retention and HIPAA BAA due to session persistence. However, you can delete sessions and uploaded files at any time via the API.
- Integrated Tools: Agents have access to shell commands, web search, and can connect to external tools via MCP servers.
- Governance and Traceability: Defined permissions allow for precise management of tools and data accessible by agents.
Recent Innovations
Anthropic has recently introduced three innovative features:
- Dreaming: A process that allows agents to review their past work to improve. This process, similar to memory consolidation in the brain, helps identify recurring errors, useful workflows, and team-shared preferences.
- Outcomes: Agents work towards a defined goal, with a separate evaluation of the output for automatic revisions. An independent evaluator assesses the output in its own context window, flagging issues and prompting the agent to revise without requiring human review for each attempt.
- Multi-Agent Orchestration: A main agent can delegate tasks to specialized sub-agents, facilitating parallel and traceable work. These agents work concurrently, share files, report back to the main agent, and leave a traceable workflow in the Console.
Practical Implementation: Creating an Agent
To create an agent, you first need an Anthropic Console account and an API key. After installing the necessary tools, you can define an agent with its models and tools, create a runtime environment, and launch a session to accomplish specific tasks. The provided Python script allows you to manage these steps and track execution in real-time.
Step 0: Prerequisites
You will need an Anthropic Console account and an API key. Set the key as an environment variable:
export ANTHROPIC_API_KEY="your-api-key-here"
Then, install the CLI and SDK:
brew install anthropics/tap/ant
All managed agent requests require the managed-agents-2026-04-01 beta header, but the SDK sets it automatically for you.
pip install anthropic
Step 1: Create an Agent
Defining the agent is where you specify the model, system prompt, and tools. The tool type agent_toolset_20260401 activates the complete pre-built set.
ant beta:agents create \
--name "Coding Assistant" \
--model '{"id":"claude-haiku-4-5"}' \
--system "You are a helpful coding assistant. Write clean and well-documented code." \
--tool '{"type":"agent_toolset_20260401"}'
Save the returned agent.id. You will reference it each time you start a session.
Step 2: Create an Environment
The environment is the container model in which your sessions run.
ant beta:environments create \
--name "quickstart-env" \
--config '{"type":"cloud","networking":{"type":"unrestricted"}}'
Step 3: Run a Session
A session is where the agent and environment come together and actually perform work. The Python script below creates one, assigns it a task, and streams events to your terminal.
from anthropic import Anthropic
import os
# Reads ANTHROPIC_API_KEY from your environment.
# Make sure you have executed: export ANTHROPIC_API_KEY="your-api-key-here"
client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"].strip())
# IDs returned by your `ant beta:agents create` and
# `ant beta:environments create` commands.
AGENT_ID = "YOUR_AGENT_ID"
ENVIRONMENT_ID = "YOUR_ENV_ID"
# 1. Create a session that references the agent + environment.
session = client.beta.sessions.create(
environment_id=ENVIRONMENT_ID,
title="Quickstart Session"
)
print(f"Session ID: {session.id}\n")
# 2. Open a stream, send the task, and process events as they arrive.
with client.beta.sessions.events.stream(session.id) as stream:
client.beta.sessions.events.send(
{
"type": "user.message",
"content": "Create a Python script that finds the first 50 prime numbers, saves them in primes.txt (one per line), and prints the largest prime number and the sum of all 50 prime numbers."
}
)
for event in stream:
match event.type:
case "agent.message":
for block in event.content:
print(block.text, end="")
case "agent.tool_use":
print(f"\n[Tool Use: {event.name}]")
case "session.status_idle":
print("\n\nThe agent has finished.")
What the Script Does in Order:
-
Creates a session that references your AGENT_ID from Step 1 and ENVIRONMENT_ID from Step 2, linking a model and tools (the agent) to an execution sandbox (the environment).
-
Opens an event stream and sends a user.message describing the task you want the agent to perform.
-
Iterates over events as they arrive, printing each agent.message, logging each agent.tool_use that the agent invokes within the sandbox, and outputting on session.status_idle when execution is complete.
In the background, the agent writes the script, executes it within the container, and then checks the output.
Brief IA — L'actualité IA en français
L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.