Self-hosted Claude Managed Agents: run the whole service, and pick your own model provider
In brief
On November 12, 2026 Anthropic released self-hosted Claude Managed Agents in private beta. You run the server (cma-server), a PostgreSQL 16+ database, and the workers. Agents, sessions, history, and credentials stay on your infrastructure, and model calls go to the Claude API, Bedrock, Google Cloud, Microsoft Foundry, or your own gateway. Same API, so the SDK and ant CLI work by changing the base URL. What you gain, the features you lose (Files API, scheduled deployments, webhooks, dreams, prebuilt document skills), and a first session in Docker Compose.
Contents
On November 12, 2026 Anthropic released self-hosted Claude Managed Agents, in private beta. You run the entire Managed Agents service on your own infrastructure, in a cloud account or an on-premise data center. To get the software, contact your Anthropic account team.
If you are new to Managed Agents: it is Anthropic's hosted agent loop. You define an agent (model, system prompt, tools), start a session, and exchange events with it while it works. See Claude Managed Agents for the basics.
Three ways to run Managed Agents now
| Option | Sandboxes (where tools run) | Service (API, agent loop, storage) | Model |
|---|---|---|---|
| Cloud (default) | Anthropic | Anthropic | Anthropic |
| Self-hosted sandboxes | You | Anthropic | Anthropic |
| Self-hosted Managed Agents | You | You | Anthropic, or a provider you choose |
Self-hosted sandboxes, released in June, moved tool execution to your machines. This release moves the rest: the API, the agent loop, the database of agents and sessions, and the credential vaults.
When to choose it
Anthropic's documentation gives two reasons:
- You must store agents, sessions, and session history yourself. Common in banking, healthcare, and government, where the session log itself counts as regulated data.
- Model calls must go somewhere other than the Claude API. The server can send them to Amazon Bedrock, Claude Models on Google Cloud (Google managed), Microsoft Foundry, or your own model gateway.
If you only need tools to run on your network, so the agent can reach a private database or an internal MCP server, stay on self-hosted sandboxes. Anthropic keeps running the service and you skip the operations work.
What you run
- Server (
cma-server). Serves the API, runs the agent loop, stores agents and sessions, and calls your inference provider. It never runs shell or file tools itself. - Database. PostgreSQL 16 or later. Without one, the server keeps data in memory and a restart erases it.
- Workers. Programs that poll the server for work and run the agent's shell and file tools in sandboxes. A worker is an
ant beta:workercommand or an SDK worker. If you already run self-hosted sandbox workers, they work with your server. - A console at your server's address, with sign-in through your identity provider (OpenID Connect).
- Admin CLI (
cma-server-admin) to create environments and their keys.
For production, Anthropic recommends the two Helm charts in the release archive. A Docker Compose stack is included for development.
There are three credentials. A server API key that your applications send, playing the role your Claude API key plays today. An inference credential that only the server holds, for its model provider. And an environment key per environment, held by the workers that poll it.
Pointing your code at your server
The server has the same API as the hosted service, so the SDK works unchanged once you set the base URL and use the server API key:
import os
import anthropic
# The server API key, not your Claude API key
client = anthropic.Anthropic(
base_url="https://cma.internal.example.com",
api_key=os.environ["CMA_SERVER_API_KEY"],
)
agent = client.beta.agents.create(
name="build-fixer",
model="claude-opus-5-5",
system="You fix failing CI builds. Open a branch, never push to main.",
tools=[{"type": "agent_toolset_20260401"}],
)
session = client.beta.sessions.create(
agent=agent.id,
environment_id=os.environ["CMA_ENVIRONMENT_ID"], # a self_hosted environment
)
The ant CLI works the same way through two environment variables:
export ANTHROPIC_BASE_URL=https://cma.internal.example.com
export ANTHROPIC_API_KEY=$CMA_SERVER_API_KEY # server key, not a Claude key
ant apply --yes agents/ # same agent files you use against the hosted service
One trap from the quickstart: if you run docker compose up in a shell where ANTHROPIC_BASE_URL points at your own server, Compose passes it through and the server calls itself instead of the Claude API. Keep a separate terminal for the CLI.
What you lose
Nothing is copied from the hosted service. Recreate agents, skills, vault credentials, and memory stores on your server. Then check these gaps:
| Hosted feature | On your server | Workaround |
|---|---|---|
| Cloud environments | Only self_hosted environments; a cloud one returns 400 |
Run workers for every environment |
| Messages API, Models API | Not served; /v1/messages returns 404 |
Use a separate client pointed at the Claude API or your provider |
Files API and file session resources |
Rejected | Put files in the worker's working directory; send images and PDFs as base64 |
| Prebuilt docx, pdf, pptx, xlsx skills | Rejected | Upload them as custom skills from Anthropic's skills repository |
| Scheduled deployments, dreams | No routes | Start sessions from your own cron; dreams have no replacement |
| Webhooks | None sent | Follow the event stream; keep workers polling |
mcp_oauth vault credentials |
Rejected | Store a static_bearer token and rotate it yourself |
| Dynamic workflows, advisor, self-defined subagents | Not available | Use {"type": "coordinator", "agents": [...]} with 1–20 listed agents |
If you rely on dynamic workflows or the advisor tool, self-hosting is a step back today.
What you get that the hosted service does not have
- Your choice of model provider (above).
- Single sign-on: callers can use tokens from your identity provider, with roles mapped from groups.
- Your own secret manager for vault credentials.
- Agent identity: the server signs a short-lived token and sends it with an agent's calls to an MCP server, which can verify it against public keys you publish. That lets your internal MCP servers know which agent is calling.
Settings that start closed
Several things are off until you allow them in the server's settings file. This is the right default, but it explains most "why doesn't my agent work" questions in week one:
mcp:
allowed_hostnames:
- mcp.internal.example.com # exact match, no wildcards
git:
allowed_hostnames:
- github.com
allowed_push_refs:
- refs/heads/agent/ # agents can only push here
web_tools:
enabled: true # web_search / web_fetch are off by default
Two notes from the docs. The server does not refuse force pushes, so protect the allowed branches on your Git host. And web_search only works when the provider is anthropic, vertex, or foundry. On Bedrock or a gateway, the agent lists the tool but the model can never call it, with no error.
Your security responsibilities
The bash tool is a real shell with the worker process's permissions and network access. The worker does not isolate it. Isolation comes from what the worker runs in. The Compose stack and the Helm chart give each session its own container or pod. If you start a worker some other way, run it in a disposable container or VM that holds nothing you need to protect.
Everything Anthropic handles on the hosted service is now yours: securing the server, hosting memory stores, spotting unusual usage, and installing each release. Each trust level needs its own deployment. Session records can be exported over OpenTelemetry, so wire them into the same pipeline as your other agent traces.
For data: every model call sends the conversation so far, including tool inputs and results, to your inference provider. If your organization has zero data retention with Anthropic and the provider is the Claude API, ZDR applies as it does to any Messages API call.
What to do this week
- Already on self-hosted sandboxes, with no storage or provider requirement: stay where you are.
- Blocked by a data-residency or provider requirement: ask your account team for the archive, run the Docker Compose quickstart on a throwaway machine, and go through the "what you lose" table against your current agents before committing.
- Platform teams: budget for running Postgres, the server, and release upgrades. This is now a service you operate.
Announcement: Operate Claude Managed Agents inside your security perimeter. Docs: Self-hosted Claude Managed Agents.