LLM API Guide

Self-Hosted Claude Managed Agents: Access, Setup & Model Gateway

Learn how to access self-hosted Claude Managed Agents, deploy cma-server with PostgreSQL 16+, isolate credentials, and route requests to a custom LLM gateway.

Summary

  1. Self-hosted Claude Managed Agents launched in private beta on November 12, 2026.
  2. Unlike self-hosted sandboxes, the full self-hosted release runs the control plane (cma-server), PostgreSQL 16+ database, local OIDC console.
  3. Only model inference payloads leave cma-server, and you can route them to Anthropic, AWS Bedrock, Google Vertex AI, Microsoft Foundry.
  4. Self-hosted instances omit direct /v1/messages and /v1/files endpoints, webhook worker triggers, built-in office skills, and automatic MCP OAuth token refresh.

Self-hosted Claude Managed Agents is not a public download, and you cannot enable it from a standard Claude Pro, Max, or self-serve Console account. Anthropic launched the full self-hosted release in private beta on November 12, 2026 (Claude Platform Release Notes). To get the container images, Helm charts, and commercial license under the Claude Managed Agents Server Software License Agreement, you have to contact your Anthropic account team directly.

When I first read the announcement, the biggest point of confusion I saw among infrastructure teams was the difference between the older self-hosted sandboxes (released back in May 2026) and this new self-hosted service. Self-hosted sandboxes only moved tool execution onto your machines while keeping the agent loop, session state, and credential vaults on Anthropic's servers. The November 12 release of self-hosted Claude Managed Agents moves the entire control plane into your VPC or on-premises data center.

It does not, however, put Claude model weights on your local GPUs. You host the orchestration server (cma-server), the session database, the secrets store, and the sandbox workers, while cma-server sends model inference requests to the upstream endpoint you configure.

On this page

Three Deployment Modes and Network Egress Boundaries

Anthropic splits Managed Agents into two architectural halves: the service (which serves the REST API, drives the agent loop, manages vaults, and stores session history) and the sandboxes (isolated containers or VMs where bash commands and file edits actually execute). Depending on your compliance requirements, you can run this stack in one of three ways:

Deployment Mode Sandboxes (Tool Execution) Control Plane & Session Storage Model Inference Endpoint Network Egress & Data Residency
Cloud sandboxes (Default) Anthropic cloud Anthropic cloud Anthropic Claude API Code, files, session logs, and prompts all live on Anthropic infrastructure.
Self-hosted sandboxes Your infrastructure Anthropic cloud Anthropic Claude API Code runs locally, but tool inputs, outputs, and session history flow to Anthropic's control plane.
Self-hosted Managed Agents Your infrastructure Your infrastructure (cma-server + PostgreSQL 16+) Anthropic API, Bedrock, Vertex, Foundry, or your own LLM Gateway Session history, agent definitions, and vault credentials never leave your network. Only inference payloads exit cma-server.

If your security team only cares that an agent can reach an internal Git repository or private staging database during a build, self-hosted sandboxes are usually enough. You need full self-hosted Managed Agents when your compliance policy forbids storing multi-turn session logs, file diffs, and tool output histories on an external vendor's control plane, or when corporate policy requires every model call to pass through a private cloud VPC endpoint or an internal LLM gateway.

What Actually Leaves Your Network

In a full self-hosted deployment, your agent definitions, session event logs, and encrypted vault secrets sit inside your own PostgreSQL database. Anthropic has no remote access to your server, cannot view your local web console, and receives zero telemetry when your workers run shell commands.

The only data that leaves cma-server is the model inference request itself—meaning the system prompt, conversation context, tool definitions, and tool results required for Claude to decide its next action. Where that payload goes depends entirely on your inference.provider setting:

  1. Direct to Anthropic (anthropic, default): cma-server calls the public Claude Messages API. If your organization has a Zero Data Retention (ZDR) agreement with Anthropic, ZDR applies to these calls in the exact same stateless manner as standard /v1/messages traffic.
  2. Cloud Provider VPC (bedrock, vertex, foundry): cma-server routes inference to Claude models on AWS Bedrock or Google Vertex AI, or Microsoft Foundry, allowing traffic to stay within your cloud provider's private network backbone.
  3. Internal Model Gateway (gateway): cma-server sends inference requests to your own internal proxy URL.

One detail buried in the data and access documentation is how attribution headers work. When inference.provider is set to anthropic, cma-server attaches three locally generated IDs to outbound API requests (anthropic-managed-agents-session-id, anthropic-managed-agents-agent-id, and anthropic-managed-agents-environment-id), sets metadata.user_id to cma-server, and includes the server version in the User-Agent string. As soon as you change inference.provider to bedrock, vertex, foundry, or gateway, cma-server stops sending those headers and makes zero outbound connections to Anthropic.

Required Components and the Three-Credential Model

Running self-hosted Managed Agents means operating five local components alongside the client applications that call them:

  • cma-server: The core control plane binary/container. It exposes the Managed Agents REST API, runs the agent orchestration loop, writes state to the database, and calls the inference provider. By design, cma-server never executes agent bash commands or file tools on its own host.
  • PostgreSQL 16+ Database: Mandatory for any persistent environment. If you start cma-server without a PostgreSQL connection configured, it falls back to an in-memory store, and every agent, session, and event log is wiped the moment the container restarts.
  • Workers: Processes started via ant beta:worker or the Anthropic SDK (EnvironmentWorker) inside your sandbox containers or VMs. They poll cma-server for queued work items, run the requested shell or file operations in /workspace, and return the output.
  • cma-server-admin: The administrative CLI (distributed for Linux x86-64/Arm and macOS Apple silicon) used to bootstrap execution environments and generate worker environment keys.
  • Local Web Console: A web UI hosted directly on your server that connects to your company's OIDC identity provider (IdP) so engineers can inspect sessions and test agents without touching platform.claude.com.

How the Three Credentials Isolate Sandbox Risk

When an autonomous agent executes untrusted code or reads external pull requests, a prompt injection inside the sandbox could try to dump environment variables and steal your API keys. To prevent a compromised sandbox from hijacking your upstream LLM bill or reading other workspaces, the architecture splits authentication into three separate credentials:

Credential Name Held By What It Authenticates Security Boundary
Server API key Your backend apps, ant CLI, cma-server-admin Client REST calls to your self-hosted cma-server (CMA_SERVER__API_KEY). Replaces the standard Claude API key for client SDKs. Never placed inside sandbox workers.
Inference credential cma-server only Outbound model calls from cma-server to Anthropic, Bedrock, Vertex, Foundry, or your gateway. Neither your client applications nor the sandbox workers ever see or hold this key.
Environment key Sandbox workers (ant beta:worker) Worker polling and session execution against a single named environment queue. Scoped strictly to one environment's work queue; cannot create agents or call the model directly.

For external API secrets that the agent's tools need during a run (such as a GitHub token or internal Jira credential), you store them in vaults rather than passing them into the sandbox environment. In self-hosted mode, you can configure secret_store so cma-server writes new vault secrets directly to AWS Secrets Manager, Google Cloud Secret Manager, HashiCorp Vault, or Azure Key Vault, keeping only a pointer in PostgreSQL.

Local Quickstart vs. Production Kubernetes Setup

Once your account team hands over the release archive, you can spin up a single-host evaluation stack with Docker Compose before committing to a Kubernetes deployment.

First, generate the .env file with a PostgreSQL password, your upstream inference key, a locally generated Server API key, and a 32-byte base64 encryption key for stored credentials:

bash
cat > .env <<EOF
CMA_PG_PASSWORD=$(openssl rand -hex 32)
ANTHROPIC_API_KEY=sk-ant-api03-your-upstream-key
CMA_SERVER__API_KEY=$(openssl rand -hex 32)
CMA_STORE__CREDENTIALS_ENCRYPTION_KEY=$(openssl rand -base64 32)
EOF
chmod 600 .env

Bring up the stack and verify that cma-server can reach PostgreSQL by hitting the readiness probe on port 8400:

bash
docker compose up --build -d
curl -s http://127.0.0.1:8400/cma-server/readyz
# Expected output: {"status":"ready"}

To point the ant CLI or the Anthropic Python/TypeScript SDK at your local control plane, override ANTHROPIC_BASE_URL and pass the local CMA_SERVER__API_KEY instead of your upstream Anthropic key. (If you also use Claude Code on the same workstation and run into login overrides when exporting custom base URLs, check my guide on why ANTHROPIC_BASE_URL stops working when a session token is cached.)

bash
export ANTHROPIC_BASE_URL=http://127.0.0.1:8400
export ANTHROPIC_API_KEY=$(grep '^CMA_SERVER__API_KEY=' .env | cut -d= -f2)

ant apply --yes quickstart-agent.md

Do not run the Docker Compose file in production. While the Compose stack spins up separate containers per session, it listens on plain HTTP (127.0.0.1:8400) and lacks horizontal worker scaling. For production, the release archive includes two Kubernetes Helm charts (cma-server and cma-sandboxes) that isolate each agent session in its own ephemeral pod and bind directly to AWS EKS IRSA, GKE Workload Identity, or Azure AKS Workload Identity so you don't have to mount static cloud credentials inside the cluster.

Routing Model Calls to Your Own Anthropic Messages Gateway

For most enterprise architects I talk to, the deciding question is whether cma-server can route model inference through an existing internal LLM gateway (such as LiteLLM, Kong AI Gateway, New API, or a custom corporate billing proxy) that speaks the Anthropic Messages protocol.

It can, and there are two ways to wire it up depending on how strict your gateway is.

Path 1: Transparent Proxy with a Static Key

If your gateway exposes a standard /v1/messages path, accepts the exact model IDs that your agents request (for example, claude-opus-5-5 or claude-sonnet-5-5), and authenticates with a single static API key, you don't even need to change inference.provider. Leave the provider on the default anthropic setting, set ANTHROPIC_BASE_URL in the cma-server environment to your internal gateway root, and set ANTHROPIC_API_KEY (or ANTHROPIC_AUTH_TOKEN) to the gateway's token.

Path 2: Dedicated inference.provider: gateway Configuration

In most corporate setups, internal gateways use custom model route names (like corp-claude-opus), expect custom authentication headers, or require short-lived OAuth 2.0 JWTs. For those cases, use the native inference.provider: gateway block in your server configuration (Inference Provider Documentation):

yaml
inference:
  provider: gateway
  gateway:
    url: "https://llm-gateway.internal.example.com/v1/messages"
    format: anthropic-messages
    model_map:
      claude-opus-5-5: "corp-claude-opus-5-5"
      claude-sonnet-5-5: "corp-claude-sonnet-5-5"
      claude-fable-5-2: "corp-claude-fable-5-2"
  credentials:
    supplier: env
    env:
      var: LLM_GATEWAY_KEY
    send_as:
      header: x-api-key

There are three strict rules in this block that will break your deployment if you miss them:

  • format: anthropic-messages URL rule: When you select anthropic-messages, gateway.url must be the full endpoint path ending in /v1/messages (or whatever fixed path your gateway uses), and it cannot contain a {model} placeholder. By contrast, if your internal gateway wraps AWS Bedrock (format: bedrock-invoke) or Vertex AI (format: vertex-raw-predict), the URL must include the {model} placeholder so cma-server can interpolate the mapped model name into the path.
  • model_map is an allowlist: Developers still write standard Anthropic model IDs like claude-opus-5-5 inside their agent definitions, and cma-server translates them using model_map before calling the gateway. If an agent requests a model ID that is not explicitly listed in model_map, cma-server rejects the request immediately.
  • Short-lived OAuth tokens (oauth_exchange): If your security team forbids static API keys on the gateway, you can set credentials.supplier: oauth_exchange. In that mode, cma-server calls an internal assertion callback service over mTLS (or with a local bearer file) to fetch a signed JWT assertion, and then exchanges it at your corporate token_url using the urn:ietf:params:oauth:grant-type:jwt-bearer grant type before forwarding the model call.

Feature Differences from Hosted Managed Agents and Unconfirmed Details

Because cma-server runs entirely disconnected from Anthropic's cloud control plane, several features that work out of the box on platform.claude.com either return HTTP errors or require manual workarounds when self-hosted.

Feature / Capability Hosted Service Behavior Self-Hosted (cma-server) Behavior & Workaround
Direct /v1/messages & /v1/files API Served on the same API domain Returns HTTP 404. cma-server only serves Managed Agents control plane routes; send standalone Messages API calls directly to your inference provider.
Cloud sandboxes Default execution environment Returns HTTP 400. Only self_hosted environments work; you must run your own workers.
Session file resources Upload via Files API and attach to sessions Rejected. Write input files directly into the worker's /workspace directory or send images/PDFs as inline base64 blocks.
Webhook worker triggers Wakes workers on session.status_run_started Not emitted. Self-hosted servers do not fire webhooks; workers must run in always-on polling mode.
Built-in docx / pdf skills Pre-installed and ready to reference Not bundled. Referencing prebuilt skills fails; download them from the open-source anthropics/skills repo and upload them as custom skills.
mcp_oauth vault refresh Automatically refreshes expired OAuth tokens Rejected on creation. Use static_bearer credentials and rotate them via an external cron script before expiry.
Multiagent orchestration Dynamic workflows, inline agents, and Advisor Restricted. Only static multiagent: {"type": "coordinator", "agents": [...]} (1–20 predefined agents) is supported; Advisor and dynamic graphs return HTTP 400.
MCP & Git network access Permitted unless restricted by policy Default deny. You must list exact domains in mcp.allowed_hostnames and git config blocks; wildcards are rejected.
Scheduled deployments & dreams Native cron scheduling and memory consolidation No routes available. Trigger sessions from Kubernetes CronJobs or Linux cron instead.

When locking down your workers and connecting your corporate OIDC provider to the local console, keep in mind that environment keys only isolate work queues—they do not enforce multi-tenant OS isolation if two workers share the same underlying VM filesystem. Pair your pod boundaries with strict filesystem and IdP group rules (similar to how we configure workspace write boundaries and gateway IdP groups in Claude Code).

What Anthropic Has Not Publicly Confirmed Yet

Before you schedule a procurement review, note three things that Anthropic has left out of the public documentation as of mid-November 2026:

  • Commercial Server Licensing Price: Anthropic has not published a price list for the cma-server software license. You pay standard token rates (or your negotiated AWS Bedrock / Vertex AI / Foundry contract rates) for the underlying model calls, while the platform license fee itself is quoted privately by your Anthropic account team.
  • Public Beta or GA Timeline: There is no announced date for when self-hosted Managed Agents will leave private beta or allow self-serve image pulls from the Claude Console.
  • Non-Claude / Local Open-Weight Models: While inference.provider: gateway accepts any endpoint that speaks anthropic-messages, Anthropic only certifies Claude models behind that gateway. Using model_map to point cma-server at a local vLLM or llama.cpp instance running open-weight models is neither officially supported nor guaranteed to survive complex multi-step tool-runner loops.

Sources and checks

  1. Claude Platform Release Notes
  2. self-hosted Claude Managed Agents
  3. data and access documentation
  4. Inference Provider Documentation