# Self-Hosted Claude Managed Agents: What It Means and How to Start

> Self-hosted Claude Managed Agents (private beta) lets you run the service, sandboxes and session history in your own cloud. Compare it with self-hosted sandboxes and plan a first run.

Source: https://www.epifive.com/blog/claude-managed-agents-self-hosted-setup · Published 2026-11-25 · EpiFive

## Key takeaways

- Self-hosted Claude Managed Agents is in private beta; access is requested through your Anthropic account team.
- It runs the API, agent loop and storage on your infrastructure, while self-hosted sandboxes move only tool execution.
- Model calls still leave your network by default, to the Claude API or to the inference provider you configure.
- You take on operating the server, a PostgreSQL 16+ database, workers and each release upgrade.
- If you only need tools to run on your own hosts, self-hosted sandboxes (public beta) are the lighter first step.

Self-hosted Claude Managed Agents is Managed Agents running on your own infrastructure, in a cloud account or an on-premises data center. You run the server, its database and the sandboxes; the model runs at Anthropic or at an inference provider you choose. As of 2026-11-25 it is a private beta, so you start by asking your Anthropic account team, and the practical first step for most teams is the public-beta self-hosted sandboxes option.

## Who this is for and what you will have at the end

This guide is for engineers, platform teams and security reviewers deciding where Claude agents should run. It does not walk through installing the server, because Anthropic gates the download behind private-beta access. Instead you will finish with:

- A clear picture of the three hosting options and what you operate in each.
- A decision rule for choosing between them.
- A checklist of what is missing or different on a self-hosted server.
- Exact steps, from Anthropic's documentation, for a first run on self-hosted sandboxes, which you can try today.

## The three options, side by side

Anthropic's documentation splits Managed Agents into two parts you can host: the sandboxes (containers, VMs or other isolated workspaces where the agent's tools run commands and work on files) and the service (the API, the agent loop, and storage for agents, sessions and session history).

| Option | Sandboxes | Service | Model |
| --- | --- | --- | --- |
| Cloud sandboxes (default) | Anthropic | Anthropic | Anthropic |
| Self-hosted sandboxes | You | Anthropic | Anthropic |
| Self-hosted Managed Agents | You | You | Anthropic, or a provider you choose |

Both self-hosted options use the same API as the hosted service, so the SDKs and the `ant` CLI work with either, apart from the exceptions listed later in this guide.

## When to choose self-hosted Managed Agents

Anthropic names two reasons to choose the full self-hosted service:

- **Storage on your infrastructure.** You must store agents, sessions and session history yourself.
- **Your choice of inference provider.** Model calls must go 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 infrastructure you control, Anthropic recommends self-hosted sandboxes, where Anthropic runs the service. If you are new to Managed Agents or unsure, the documentation says to start with a cloud environment, because there is nothing for you to host.

The cost of the full option is operational. You run and secure a server, its database and your sandboxes, and you install each release yourself.

## What runs where

One deployment is made of one or more servers, a database and your sandboxes.

```text
Your network
  Your applications --(Managed Agents API)--> Server (cma-server) --> Database
  Your workers ------(poll for work)--------> Server
Server --(model calls)--> Inference provider (Claude API by default)
```

- **Server (`cma-server`)** serves the API, runs the agent loop and stores agents, sessions and history. It never runs the agent's shell or file tools.
- **Database** is PostgreSQL 16 or later. Without one, data lives in memory and a restart erases it.
- **Workers** take work from the server and run the agent's shell and file tools in your sandboxes. A worker is an `ant beta:worker` command or an SDK worker.
- **Console on your server** is a web page at the server's address where people sign in through your identity provider.
- **Admin CLI (`cma-server-admin`)** creates environments and their environment keys. It runs on Linux (x86-64 and Arm) and on macOS on Apple silicon.

### Three credentials

| Credential | Held by | Authenticates |
| --- | --- | --- |
| Server API key | Your applications, the `ant` CLI, the admin CLI | Requests to your server (the role a Claude API key plays on the hosted service) |
| Inference credential | The server | Model calls to your provider |
| Environment key | Workers that poll the server | One environment's work queue and sessions |

## What still leaves your network

Self-hosting the service is not the same as air-gapping the model. For each model call the server sends the conversation so far, including tool inputs and tool results, to your inference provider, which is the Claude API by default. A call to the Claude API also carries the IDs of its session, agent and environment. Anthropic's "Data and access" page lists every connection the server makes; read it before a security review.

On data retention, the Managed Agents feature page says the service is not eligible for zero data retention (ZDR) "except for self-hosted Managed Agents", and not eligible for HIPAA. Anthropic's announcement adds that if your organization has ZDR, it applies to requests sent to Claude as for any Messages API call. Confirm the details for your contract with your account team.

## Your security responsibilities

Anthropic's warning is direct: the agent's `bash` tool is a real shell with the worker process's permissions and network access, and the worker does not isolate it. Isolation comes from what the worker runs in. The Docker Compose stack and the `cma-sandboxes` Helm chart start each session's worker in its own container or pod. If you start a worker yourself, run it in a disposable container or VM that holds nothing you need to protect.

Items Anthropic's self-hosted sandbox security page assigns to Anthropic become yours here: securing the server, hosting memory stores and detecting unusual usage. Each trust level also needs its own deployment rather than a separate workspace.

## What is missing or different on your server

Anthropic's "Differences from the hosted service" page is the list to check before migrating anything. Nothing is copied from the hosted service, including session history; you recreate agents, skills, vault credentials and memory stores on your server. Highlights:

| Area | What happens on a self-hosted server |
| --- | --- |
| Cloud environments | Only `self_hosted` environments exist; a request for a cloud environment returns a 400 error |
| Rest of the Claude API | Messages and Models API calls to your server return 404 |
| File resources and Files API | `file` resources are rejected and `/v1/files` does not exist; `memory_store` resources work |
| `mcp_oauth` vault credentials | Rejected; use a `static_bearer` credential and refresh it yourself |
| Prebuilt docx, pdf, pptx, xlsx skills | Rejected; upload your own custom skills |
| Scheduled deployments, dreams, webhooks | No routes or no webhooks; use your own scheduler and the event stream |
| Web tools | `web_search` and `web_fetch` are off until enabled in settings |
| MCP servers | Only hosts listed under `mcp.allowed_hostnames`; the list is empty by default |
| Git repositories | `github_repository` resources need hosts under `git.allowed_hostnames` |

Two settings snippets from the same page show the style of configuration:

```yaml
mcp:
  allowed_hostnames:
    - mcp.example.com
```

```yaml
web_tools:
  enabled: true
```

MCP hosts match exactly, with no wildcards or subdomains. Some features also depend on the inference provider: for example `web_search` works under `anthropic`, `vertex` and `foundry`, and `web_fetch` under `anthropic` and `foundry`. Under the `anthropic` provider the server asks for the Claude API's server-side fallback by default; setting `inference.model_fallback: false` turns it off.

## Try the lighter option today: self-hosted sandboxes

Self-hosted sandboxes are a public beta (announced 2026-05-19) and need no access request. Anthropic keeps running the agent loop; a worker on your host runs each tool call locally. The quickstart needs an existing agent, a Linux or macOS host with `/bin/bash` and outbound HTTPS, a Claude API key kept off the worker host, and the `ant` CLI or SDK on your own machine.

### Step 1: create a self-hosted environment

In the Claude Console open Environments, click **Create environment**, and under **Hosting** select **Self-hosted**. Or call the API:

```bash
curl -sS --fail-with-body https://api.anthropic.com/v1/environments \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2026-10-21" \
  -H "anthropic-beta: managed-agents-2026-04-01" \
  -H "content-type: application/json" \
  -d '{"name": "self-hosted", "config": {"type": "self_hosted"}}'
```

### Step 2: generate an environment key

In the Console, open the environment and click **Generate environment key**. You can generate one only in the Console, even for an environment created through the API. On the worker host, export:

```bash
export ANTHROPIC_ENVIRONMENT_KEY="sk-ant-oat01-..."
export ANTHROPIC_ENVIRONMENT_ID="env_..."
```

### Step 3: install `ant` and start the worker

On macOS, `brew install anthropics/tap/ant` installs the CLI; Linux has a release-binary download on the GitHub releases page. Check with `ant --version`, then on Linux:

```bash
sudo mkdir -p /workspace && sudo chown "$USER" /workspace
ant beta:worker poll --workdir /workspace
```

On macOS the root volume is read-only, so use a directory in your home folder such as `~/workspace`.

### Step 4: verify, then run a session

From your own machine, confirm `workers_polling` is at least 1:

```bash
ant beta:environments:work stats --environment-id "$ANTHROPIC_ENVIRONMENT_ID"
```

Create a session with `ant beta:sessions create --agent "$AGENT_ID" --environment-id "$ANTHROPIC_ENVIRONMENT_ID"`, then send a `user.message` asking the agent to write the output of `uname -a` to `hello.txt`. Read `/workspace/hello.txt` on the worker host: it describes your own kernel, which shows the tool call ran there. If no worker is connected, the session stays queued rather than failing.

### Limits to know

Self-hosted sandboxes accept only `memory_store` session resources; a `file` or `github_repository` resource is rejected with a 400 error. Preinstalled runtimes of a cloud sandbox are not there; you get whatever your worker provides. On Claude Models on Google Cloud (Anthropic managed) you write your own worker, and on Claude Platform on AWS the worker authenticates with IAM instead of an environment key.

## Troubleshooting

- **`workers_polling` stays at 0:** check that the worker process is running and has both environment variables; see Anthropic's monitoring and troubleshooting page.
- **A session stops at its first tool call (self-hosted server):** model turns run even with no worker, so the tool call waits without an error. Confirm a worker is polling the session's environment.
- **A 400 error mentioning `resources`:** you attached a `file` or `github_repository` resource to a self-hosted sandbox session. Stage files yourself in the worker directory.
- **The server refuses to save an agent naming an MCP server:** add the exact host to `mcp.allowed_hostnames`.
- **An image sent by URL is ignored:** the server accepts URL image and document blocks but the model never sees them; send `base64` or text.

## Deployment checklist

- Decide whether you need your own storage or provider; if not, use self-hosted sandboxes.
- Request access through your account team and read the operator guide shipped with each release.
- Plan PostgreSQL 16+, backups, upgrades and one deployment per trust level.
- Run every worker in a disposable container, VM or pod.
- Review the "Differences" page against your agents before migrating, and recreate agents, skills and credentials.
- Check data flows to your inference provider with your security team.

For related background see [Claude tool use: build a Python agent loop](https://www.epifive.com/blog/claude-tool-use-python-agent-loop), [Claude API pricing and token cost estimates](https://www.epifive.com/blog/claude-api-pricing-token-cost-estimate) and [best MCP servers for daily work](https://www.epifive.com/blog/best-mcp-servers-github-daily-work). Anthropic has not published pricing or a general-availability date for the self-hosted service.

## See also

- [Pulsezen: Self-Hosted, Cookieless Google Analytics Alternative (Open Source)](https://www.epifive.com/blog/pulsezen-self-hosted-google-analytics-alternative)
- [Statuszen: Free, Self-Hosted Uptime Monitoring and Status Pages (Open Source)](https://www.epifive.com/blog/statuszen-open-source-uptime-monitor-status-page)
- [Dialzen: Open Source AI Voice Agent for Support and Booking Calls](https://www.epifive.com/blog/dialzen-open-source-ai-voice-agent)

## What we checked

- Opened Anthropic's article on self-hosted Claude Managed Agents (claude.com) on 2026-11-25; it is dated 2026-11-12 and states private beta with access through the account team.
- Opened the self-hosted Managed Agents page on platform.claude.com on 2026-11-25 and copied the option table, component list (PostgreSQL 16 or later) and the three credentials from it.
- Cross-checked the ZDR note on the self-hosted sandboxes feature metadata with the announcement's ZDR statement; both say ZDR applies to self-hosted Managed Agents requests, with contract details left to the account team.
- Read the "Differences from the hosted service" page on 2026-11-25 and reproduced the two settings snippets exactly as documented.
- Compared the quickstart on the self-hosted sandboxes page with the "Choosing an agent environment" page; the beta header `managed-agents-2026-04-01` and the `ant beta:worker poll` command appear as shown.
- Confirmed the May 2026 launch post on claude.com describing self-hosted sandboxes as a public beta.
- Not tested hands-on: we have no access to the private beta server or a worker host, so no commands were run; steps follow Anthropic's documentation as of 2026-11-25.

Last tested: 2026-11-25

## References

- [Operate Claude Managed Agents inside your security perimeter](https://claude.com/resources/articles/self-hosted-claude-managed-agents)
- [Self-hosted Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/self-hosted)
- [Differences from the hosted service](https://platform.claude.com/docs/en/managed-agents/self-hosted/differences)
- [Self-hosted sandboxes](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes)
- [Choosing an agent environment](https://platform.claude.com/docs/en/managed-agents/choosing-an-environment)
- [New in Claude Managed Agents: self-hosted sandboxes and MCP tunnels](https://claude.com/blog/claude-managed-agents-updates)

## Frequently asked questions

### Can anyone use self-hosted Claude Managed Agents today?

Not yet. Anthropic lists it as a private beta and says to contact your Anthropic account team to request access. The related self-hosted sandboxes option is a public beta and does not need that request.

### What is the difference between self-hosted sandboxes and self-hosted Managed Agents?

With self-hosted sandboxes you run only the workers that execute the agent's tools, and Anthropic still runs the service. With self-hosted Managed Agents you run the service and its database as well, so agents, sessions and session history are stored on your infrastructure.

### Does self-hosting keep my data away from Anthropic?

Not automatically. By default each model call still goes to the Claude API with the conversation so far, including tool inputs and results. You can instead point the server at Amazon Bedrock, Google Cloud, Microsoft Foundry or your own gateway.

### What database does the self-hosted server need?

Anthropic's documentation says PostgreSQL 16 or later. Without a database the server keeps data in memory and a restart erases it.

