What "self-hosted" moves, and what it does not
Anthropic announced self-hosted Claude Managed Agents on November 12, 2026, as a private beta 1. Two earlier options already existed. With cloud sandboxes, Anthropic hosts the sandboxes, the service and the model. With self-hosted sandboxes, you host the sandboxes only. The new option has you host both the sandboxes and the service, while the model runs at Anthropic or at a provider you choose 2.
The "service" is the part security teams care about: the API, the agent loop, and the storage for agents, sessions and session history 2. Moving it inside your network changes who holds transcripts and secrets. It does not change the fact that a model, somewhere, has to read the conversation. That is the central point of this post: the loop moves in, and the inference hop is still a data flow you have to govern.
The rest of this post takes each class of data in turn: conversation content, credentials, tool calls, logs and usage metadata. It then says where a gateway helps and where it does not.
The components and where each one runs
One deployment is made of a few pieces, all on your side 2:
- Server (
cma-server) serves the API, runs the agent loop, and stores agents, sessions and each session's history. It calls the inference provider whenever the agent needs the model. It never runs an agent's shell or file tools. - Database: PostgreSQL 16 or later. Without one, the server keeps data in memory and a restart erases it.
- Workers take work from the server and run shell and file tools in your sandboxes.
- Console on your server, where people sign in through your identity provider.
- Admin CLI (
cma-server-admin), which creates environments and their keys.
This split follows Anthropic's published design: the harness (the brain) calls Claude, the sandbox (the hands) runs code, and the session is an append-only log kept outside both 3. Because the log lives outside the harness, a crashed harness can be replaced and resume from the last event 3. For you that means the database is the system of record, and it is your backup, retention and access-control problem.
Anthropic states it has no remote access to the server or its log, and that it issues and holds none of the credentials the server accepts 4.
What crosses the boundary on every model call
Each model call carries the conversation so far, including prompts, tool inputs and tool results 4. This is where file contents, ticket text, query results and command output leave your network, because the agent's tool results are part of the next prompt. The destination is your inference provider. The default is the Claude API, and the documented alternatives are Amazon Bedrock, Claude Models on Google Cloud (Google managed), Microsoft Foundry, or your own model gateway 2.
What the provider then does with that data is governed by your agreement with it. If Anthropic serves the model, your retention agreement with Anthropic applies, and a ZDR arrangement covers these calls like any other Messages API call 4. Anthropic's data-retention page lists Managed Agents as not covered by ZDR because, when Anthropic runs the service, it stores transcripts. When you run it, you store them 4.
Choosing Bedrock, Google or Foundry instead changes the contracting party and the region, not the shape of the flow. The full conversation still leaves the server. Treat the choice of provider as a data-processing decision, not an infrastructure detail.
What Anthropic can still see under the Claude API
If the Claude API is the provider, more than content reaches Anthropic 4:
- Up to three ID headers per call:
anthropic-managed-agents-session-id,-agent-idand-environment-id. The IDs hold no name or content but encode the creation time. Anthropic can attribute usage to a session, agent or environment. No setting turns them off. - A
User-Agentnaming the server software and version. Your API key identifies your organization, as on any Claude API request. - A
metadata.user_idlabel ofcma-serveron some calls. It is sent to the Claude API, Microsoft Foundry and to a gateway that accepts the Claude API request shape. It is never sent to Amazon Bedrock, Google-managed Claude, or a gateway that takes another request format. - A credential validity check at startup and every 60 seconds by default. These checks run no inference and carry none of the ID headers.
Under any other provider, the server never sends the ID headers 4. If a gateway forwards a call onward, metadata.user_id can travel with it, and a gateway that rejects that body field will make every model call fail 4. That second point is an integration test you can write before rollout.
Credentials: three kinds, and where secrets live
The server uses three credentials 2:
| Credential | Held by | Authenticates |
|---|---|---|
| Server API key | Your apps, the ant CLI, the admin CLI | Requests to your server |
| Inference credential | The server only | Model calls to your provider |
| Environment key | Workers that poll the server | One environment's queue and sessions |
Applications and workers do not need the inference credential 2. That is a real reduction in exposure: the model key lives on one server, not in every sandbox.
For tool secrets, vaults are designed to keep credentials out of the sandbox: for MCP tools and supported API calls, a proxy outside the sandbox adds the credential to the request, and self-hosting lets you keep credentials in your own secrets manager 1. The product page puts it as the agent handling only a placeholder 5. A detail to check in your design: if you configure a secret manager, new vault credentials go there, but secrets stored earlier stay in the database 4. If you turn on the secret manager after pilot data exists, migrate or rotate those older secrets.
Tool calls, workers and egress
The server makes a defined list of outbound connections: your inference provider, the database, credential-issuing services, the MCP servers you allow, the Git hosts you allow, an OpenTelemetry collector if configured, identity providers, secret managers, and anything else you configure 4. Anthropic suggests comparing your egress proxy or firewall log against that list to check the server's traffic 4.
Workers are the larger risk. A worker has whatever network access you give its container or VM, and every command the agent runs inherits it 4. Anthropic is blunt that the bash tool is a real shell with the worker's permissions and network access, and that the worker does not isolate it; isolation comes from what the worker runs in 2. Each trust level needs its own deployment, not just its own workspace 2.
Where the inference provider offers web search and web fetch, it runs them; the server makes no connection for them, and they are off until enabled 4. So enabling them adds a data path that your server egress rules will not show.
Logs, traces and what deletion does not reach
The server writes its log to standard error, so your container platform collects it. It records no traces or metrics until you set the standard OpenTelemetry environment variables, and it sends them only where those point. It keeps no log files and stores no traces or metrics 4. Retention of logs and traces is therefore decided by your pipeline.
Sessions stay in your database until you delete them; the server does not expire them by age 4. Deleting a session removes it and its history but keeps the session's ID, and the delete does not reach database backups, exported logs and traces, or what the agent wrote to a memory store. On Kubernetes it also leaves the session's /workspace volume in place 4. If you promise deletion to users or auditors, your runbook has to cover each of those copies.
Managed Agents records every step, including tool calls and what came back, and exports that record over OpenTelemetry 1. Anthropic's secure-deployment guide also recommends storing the events you want to keep in your own logs and alerting when a session goes idle, hits its budget or terminates 6. Set a per-session budget as a cap sized to what you expect a run to cost 6.
Where a gateway should sit
There are three useful positions. Only the first is about Claude itself.
1. Between the server and the model. This is the hop that carries the whole conversation. Anthropic lists "your own model gateway" as a supported inference provider, and says that if ANTHROPIC_BASE_URL names a proxy, the ID headers go there 24. A gateway here can enforce model allowlists, budgets, prompt and response checks, and a request log with cost, and it becomes the single place that holds the real provider keys. If you want one that you run yourself, you own its availability too.
2. Between workers and the internet. This is an egress policy, not an AI gateway. It is the control that limits what a prompt-injected shell can reach.
3. Between the agent and its tools. MCP is an open standard for connecting AI applications to external systems 7. A tool gateway can hold tool credentials, pin tool definitions and log calls.
Where INFRO fits, and where it does not
INFRO is a hosted gateway, so it sits outside your network. Its Messages-shaped endpoint (POST /v1/messages) takes Anthropic's request shape, applies routing, budgets refused before the provider is called, guardrails and a request log, and your own provider still bills you 8. Anthropic's docs say a gateway that accepts Claude API requests receives the cma-server label, so test that body field passes through before relying on any gateway 4. INFRO documents Claude Code and the Agent SDK against that endpoint; I did not verify cma-server against it, so run your own test.
Two limits matter for a boundary-driven design. INFRO's MCP gateway only connects to public HTTPS servers, refuses private and localhost addresses, and runs on infrastructure with no fixed outbound IPs, so internal MCP servers and IP-allowlisted ones cannot sit behind it 9. And with capture off it still processes tool arguments and results in transit while keeping none of them 9. A self-hosted or hybrid INFRO deployment is an enterprise-agreement item, not generally available, so plan around the hosted service unless you have that contract.
A decision checklist
- Name the inference provider and confirm its retention terms for agent conversations.
- Decide whether a hosted gateway on the model hop is acceptable, or the gateway must run in your network.
- Test that your gateway accepts
metadata.user_idand the Claude API request shape. - Put the server on an egress allowlist built from the documented connection list.
- Give each trust level its own deployment, and run workers in disposable containers or VMs.
- Turn on a secret manager before creating vault credentials, or rotate the older ones.
- Configure OpenTelemetry export and a per-session budget.
- Write deletion steps that cover backups, exported logs, memory stores and workspace volumes.
- Read Anthropic's differences-from-hosted page for features you lose.
