Self-Hosted Claude Managed Agents: Architecture, Setup, and Security
Deploy Claude Managed Agents on internal infrastructure. Learn server roles, sandbox execution, credential management, and migration requirements.
- Anthropic launched self-hosted Claude Managed Agents on 2026-11-12, moving API management, agent loops, and session data to private servers.
- The deployment requires running the cma-server process alongside PostgreSQL 16 or newer, with isolated worker sandboxes handling bash tools.
- Three distinct credentials control access: server API keys, environment keys for polling workers, and backend inference credentials.
- Model inference requests can target Anthropic, Amazon Bedrock, Google Cloud, Microsoft Foundry, or custom model gateways.
Self-Hosted Claude Managed Agents Overview
On 2026-11-12, Anthropic announced self-hosted Claude Managed Agents for organizations requiring full control over agent execution state. While previous configurations supported self-hosted sandboxes to run code locally while relying on Anthropic cloud infrastructure for control planes, this release allows teams to host the entire Managed Agents core service within private boundaries. Self-hosted deployments run inside cloud accounts or on-premise data centers, storing agent definitions, ongoing sessions, and transcript records on private systems.
The release addresses strict compliance constraints where organizations cannot store conversation histories, agent skills, and prompt sessions on external multitenant platforms. In this model, the local server coordinates the iterative agent loop and communicates with an inference backend. By default, inference requests route to the Claude API, but teams can configure connections to Amazon Bedrock, Claude Models on Google Cloud, Microsoft Foundry, or an internal proxy gateway. Access to server binaries requires approval through Anthropic account representatives.
| Deployment Model | Sandbox Execution | Service and Loop | Inference Model Provider |
|---|---|---|---|
| Cloud Sandboxes | Anthropic | Anthropic | Anthropic |
| Self-Hosted Sandboxes | Customer Infrastructure | Anthropic | Anthropic |
| Self-Hosted Managed Agents | Customer Infrastructure | Customer Infrastructure | Anthropic, Cloud Partners, or Custom Gateway |
Core System Architecture and Components
A self-hosted deployment consists of three primary software tiers operating within a private network: the management server, an external relational database, and distributed worker execution environments. Applications interact directly with the local server rather than sending coordination requests across the public internet.
- cma-server: Serves the Managed Agents API, maintains the execution loop, and manages storage for agents and transcripts. The server dispatches inference calls to model backends but never directly runs bash commands or file manipulations.
- Database: Demands PostgreSQL 16 or later. When operated without an external database connection, the server retains state solely in volatile memory, losing all session logs on reboot.
- Sandboxes and Workers: Worker processes poll cma-server for tasks and execute local commands. Workers run via the ant CLI utility or custom programs compiled with supported SDKs.
- Administration Utilities: Operators manage environments and issue environment keys using the cma-server-admin CLI tool, supported on Linux and macOS architectures.
- Local Server Console: A built-in web portal exposed directly by the server instance, enabling operators to authenticate through corporate identity providers to inspect sessions and create agents.
The execution workflow separates orchestration from script execution. Client applications send session directives to the server over internal endpoints. Sandboxed workers continuously poll the server queue. When a task requires tool execution, a worker claims the session item, processes bash commands or filesystem modifications inside its isolated container, and returns tool results to the server. The server packages the response, appends prior conversation messages, and issues an inference request to the configured model backend.
Authentication and Credential Distribution
Operating self-hosted Managed Agents involves three non-overlapping credential boundaries. Separating these secrets ensures that untrusted code executed during an automated session cannot compromise management endpoints or backend model accounts.
- Server API Key: Held by internal applications, automation scripts, and administrative CLI tools. This token authenticates client calls directed to the cma-server endpoint, replacing external cloud API keys.
- Inference Credential: Confined exclusively to the cma-server host. This represents the API token or cloud provider authentication identity needed to call model providers such as Anthropic, Amazon Bedrock, or Microsoft Foundry.
- Environment Key: Configured strictly on worker hosts and sandbox containers. The key permits workers to authenticate against specific queues to poll for tasks without exposing broader server permissions.
Because workers process untrusted bash commands inside tool routines, environment workers must never store the server API key or inference credentials. If code running inside a worker inspects local environment variables, it only encounters its assigned queue credentials.
Worker Setup and Sandbox Initialization
Deploying execution workers requires a supported Linux host or a macOS workstation. Worker hosts require network connectivity for outbound HTTPS requests to the server and a bash binary located specifically at /bin/bash. Systems running macOS utilize Bash 3.2 at /bin/bash, regardless of newer alternative versions present in Homebrew paths. Linux hosts typically initialize /workspace as the default operational directory.
Operators install the ant CLI tool to manage worker polling routines. Installation options include precompiled binaries, Homebrew packages, or building from source using Go 1.26.10 or later. For Linux environments, binary extraction automates configuration:
VERSION=2.9.0
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
case $(uname -m) in
x86_64) ARCH=amd64 ;;
aarch64) ARCH=arm64 ;;
esac
curl -fsSL "https://github.com/anthropics/anthropic-cli/releases/download/v${VERSION}/ant_${VERSION}_${OS}_${ARCH}.tar.gz" \
| sudo tar -xz -C /usr/local/bin ant
After establishing CLI binaries, workers export identity parameters and launch background polling loops against the working directory:
export ANTHROPIC_ENVIRONMENT_KEY="sk-ant-oat01-..."
export ANTHROPIC_ENVIRONMENT_ID="env_..."
sudo mkdir -p /workspace && sudo chown "$USER" /workspace
ant beta:worker poll --workdir /workspace
Developers verify worker connectivity by querying queue metrics from an external management terminal. A successful connection returns a workers_polling integer value of at least 1, indicating that the worker is listening for dispatched tasks.
Network Egress and Data Governance
Operating self-hosted agents shifts data retention boundaries to the hosting infrastructure. Transcripts, skill files, memory stores, and session histories remain confined to the self-hosted PostgreSQL database. Organizations evaluating data retention obligations can review comparative provider details in API data retention and training policies.
Data egress occurs whenever the server submits inference calls to the configured model provider. Outbound requests contain conversation histories, tool inputs, execution results, and metadata tracking session and environment IDs. Supported models span the Claude family, including claude-fable-5.1, claude-opus-5.5, claude-sonnet-5.5, and claude-haiku-4.5. Model token expenses follow the published API pricing tiers detailed at /tools/llm-api-pricing/.
Security isolation depends entirely on container configuration. The agent bash tool executes system commands with the exact permissions of the worker process. The worker process itself does not apply virtualization or sandbox boundaries. Instead, infrastructure teams must deploy workers inside isolated Docker Compose configurations, Kubernetes pods via the cma-sandboxes Helm chart, or disposable virtual machines.
Implementation and Migration Checklist
Teams planning to migrate from hosted Claude Managed Agents or evaluate self-hosted deployments should complete the following verification steps:
- Contact Anthropic account teams to request download credentials for cma-server and the cma-server-admin CLI.
- Provision a dedicated PostgreSQL 16 or newer database instance to persist agents and execution records across server reboots.
- Configure distinct network zones separating the cma-server control plane from untrusted worker execution environments.
- Set up isolated worker runtimes using containers or throwaway virtual machines equipped with /bin/bash.
- Establish authentication tokens, keeping model inference credentials isolated on the server and environment keys isolated on workers.
- Review model usage plans against token rates using the /tools/llm-api-cost-calculator/ to anticipate inference costs across target model tiers.