Skip to content
Claude Managed Agents

Claude Managed Agents

Claude Managed Agents runs an agent’s loop at Anthropic and its tools wherever you choose: in a self-hosted environment. A project can be that environment. Each session then gets a machine of its own in the project. The machine runs the session’s tools, is suspended between messages, and resumes with its files still there when the next message comes.

You keep using Anthropic’s API, Console and your own app to create agents and sessions and to talk to them. AgentSpaces only runs the tools.

Managed Agents is in beta at Anthropic, and so is this. The project setting is offered to staff only for now.

Set it up

  1. In the Claude Console, create a self-hosted environment in your Anthropic organization and generate its environment key (sk-ant-oat01-…). Note the environment’s id (env_…).
  2. In the AgentSpaces portal, open the project’s Settings, tab Claude, and switch on Claude Managed Agents. Give the environment id and key, the size of a session’s machine and how many days to keep a machine after its session ended (7 by default). The portal checks the key with Anthropic before it saves anything.
  3. Create sessions on that environment as usual (API, Console or the ant CLI). Each one shows up on the project’s canvas as a machine named s- and twelve letters and digits.
The Claude Managed Agents dialog under the project's Settings, Claude: the environment id env_01HqR7docs, the masked environment key, the session machine's vCPUs, memory and disk, and the days to keep an ended session's machine, with Turn on The Claude Managed Agents dialog under the project's Settings, Claude: the environment id env_01HqR7docs, the masked environment key, the session machine's vCPUs, memory and disk, and the days to keep an ended session's machine, with Turn on

Once it is on, the tab shows the environment and the session machines’ size:

The Claude Managed Agents card, On: the environment env_01HqR7docs, session machines of 1 vCPU, 512 MiB and a 10 GiB disk, ended sessions' machines kept 7 days, and the key on the Credentials page, with Edit and Turn off The Claude Managed Agents card, On: the environment env_01HqR7docs, session machines of 1 vCPU, 512 MiB and a 10 GiB disk, ended sessions' machines kept 7 days, and the key on the Credentials page, with Edit and Turn off

Two things look alike but don’t work here:

  • A Claude Code environment (claude.ai, admin settings, Cloud environments; its id starts with ccpool_) is for Claude Code’s own sessions, a different product. Managed Agents needs an environment from the Claude Console at platform.claude.com/environments, whose id starts with env_.
  • A Claude API key (sk-ant-api…) is not an environment key. Generate the key on the environment’s page in the Console; it starts with sk-ant-oat01-.

The portal says so when it is given either one.

Switching the setting off (confirmed with a code from your authenticator app or a passkey) removes the project’s dispatcher machine and the stored key. The sessions’ machines stay: they are ordinary machines of the project, and may hold files you want. Delete them when you are done.

One environment per project is the rule: a project is a boundary of its own (its members, its credentials, its machines), which is what Anthropic advises for an environment. You may connect the same environment to two projects; then either project may run any session of it.

What happens

  • A dispatcher (a machine of the project’s that members don’t see) waits for the environment’s work. For a new session it creates the session’s machine; for a returning session it resumes that machine and hands the work over.
  • The session’s machine runs the session’s tools (bash, files, search) in /workspace, until the session is idle for 30 minutes. Then the machine is suspended, as any idle machine is. Its disk is kept, so the next message finds the files where the agent left them.
  • When a session has ended, its machine is deleted after the retention period you set.

The canvas shows a session’s machine with what the session is doing: working, idle, or needs you when it waits for a tool confirmation. The label is the session’s title, and a link opens the session in the Claude Console.

Your environment key

The key lets whoever holds it take every session of the environment. It is kept by AgentSpaces’ credential service, and only the project’s dispatcher can use it. Even the dispatcher never sees it: it sends a placeholder, and the credential proxy puts the key in on the way to Anthropic. No session machine and no other machine of the project can use it, and it is not listed among the project’s credentials. The Credentials page shows it as the project’s Managed Agents environment, where you can replace or remove it.

A session’s machine gets only that session’s work credential, which Anthropic hands out per session for a short time. It authorizes that one session, which the session’s agent controls anyway.

If Anthropic refuses the key, or it is missing, the project gets an alert with a link to the Credentials page. Replace the key there.

A session’s machine has no credentials of the project and can’t create machines or agents: its agent’s instructions come from your Anthropic organization, not from the project. It can message other machines of the project, keep metadata, put artifacts, and reach the internet.

AgentSpaces tools for your agent

A session’s machine serves these tools to the agent next to Anthropic’s own toolset:

ToolWhat it does
agentspaces_send_messagesends a text message to another machine of the project, by name, and resumes it
agentspaces_read_inboxtakes the oldest message other machines sent to this one
agentspaces_put_artifactuploads a file from the workspace as an artifact and answers its URL
agentspaces_set_statussays in one line what the agent is doing, for the canvas
agentspaces_whoamithe machine’s name, project and organization

An agent uses them once you declare them on it. Add the definitions in managed-agents-tools.json to your agent’s tools, next to the agent toolset. An update replaces the agent’s whole tools list, so send the tools it already has along with them, for example with the Python SDK:

import json, anthropic

client = anthropic.Anthropic()
ours = json.load(open("managed-agents-tools.json"))
names = {t["name"] for t in ours}
agent = client.beta.agents.retrieve("agent_…")
# Keep the agent's own tools and toolsets (an older copy of ours makes way for this one),
# and add the agent toolset if it lacks it.
kept = [
    t.model_dump(exclude_none=True)
    for t in agent.tools
    if getattr(t, "name", None) not in names
]
if not any(t["type"] == "agent_toolset_20260401" for t in kept):
    kept.insert(0, {"type": "agent_toolset_20260401"})
client.beta.agents.update("agent_…", version=agent.version, tools=[*kept, *ours])

Costs

Anthropic bills the tokens and any runtime for self-hosted sessions to your Anthropic organization. AgentSpaces bills the machines as any other: a session’s machine while it runs, and its disk while it is suspended. The dispatcher is always on and small.

Last updated on