Skip to content
Naditu
Get started

Self-hosted Claude Managed Agents: architecture and limits

Self-hosted Claude Managed Agents explained: cma-server, PostgreSQL 16, worker bash isolation, three credentials, and what still leaves your network.

Naditu3 min read

Regulated banks, defense suppliers, and multi-plant manufacturers routinely ask how to run frontier agent loops without storing session histories on vendor clouds. Anthropic's answer is self-hosted Claude Managed Agents, an access-gated deployment option where both the orchestration service and the tool execution sandboxes run inside your own cloud account or on-premise data center. Before your infrastructure team provisions hardware, it pays to read the operator contract closely: what moves inside your firewall, what you suddenly become responsible for securing, and which data still crosses your network perimeter on every turn.

Cloud sandboxes, self-hosted sandboxes, or full self-hosted Managed Agents?

Anthropic divides Managed Agents into three layers (sandboxes, orchestration service, and model inference) and offers three hosting splits:

  • Cloud sandboxes (default): Anthropic runs the tool containers, the agent loop, session storage, and model inference.
  • Self-hosted sandboxes: only tool execution moves inside your network so commands touch internal systems locally, while Anthropic still hosts the session database and orchestration loop (distinct from the laptop-resident VM architecture we examine in Claude Cowork VM, DXT extensions, and MCP tool cache limits).
  • Self-hosted Claude Managed Agents: you operate the cma-server binary, a PostgreSQL 16+ state database (running without PostgreSQL keeps state in RAM and wipes everything on restart), polling workers (ant beta:worker or SDK workers), an SSO-backed web console, and the cma-server-admin CLI, while routing model calls to Anthropic, Amazon Bedrock, Google Cloud, Microsoft Foundry, or an internal model gateway.

Four security realities inside the operator contract

Bringing cma-server in-house shifts every operational duty we reviewed in an MCP security checklist for enterprise IT onto your own engineering team, alongside the bot-identity challenges covered in Nous Hermes Agent for enterprise bots: patterns and risks:

  1. The worker process does not isolate bash: while cma-server never touches a shell, the worker's bash tool executes with the worker process's exact OS permissions and network reach. Real isolation comes only from wrapping each session's worker in a disposable container, VM, or the cma-sandboxes Helm pod.
  2. Three separate credentials enforce least privilege: applications hold the Server API key, only cma-server holds the Inference credential, and polling workers hold an Environment key scoped to a single work queue.
  3. Each trust zone requires a separate deployment: rather than sharing one server across conflicting security tiers, Anthropic's multitenancy rules call for distinct deployments per trust boundary.
  4. Self-hosting does not keep prompts or tool results off the wire: on every model turn, cma-server sends the running conversation history, including tool inputs and returned ERP rows, to your configured inference provider, plus session, agent, and environment IDs when calling the Claude API.
cma-server keeps session storage on your PostgreSQL 16 instance, while disposable containers isolate worker shells and outbound arrows carry prompts to your chosen model provider.

Why self-hosted agent infrastructure still needs an enterprise ontology

  • Minimize what crosses the inference boundary: instead of dumping raw database tables containing national IDs or payroll columns into tool results that travel to a cloud model endpoint, place an enterprise business ontology in front of your databases to enforce row-level permissions, field masking, and concise semantic objects.
  • Export OpenTelemetry traces and gate every write: pair W3C traceparent spans across cma-server and MCP tools with deterministic schema validation and human-in-the-loop approval before any ERP or financial mutation executes.
Self-hosting controls where the loop runs, while an operational ontology controls what data the loop sees and what actions it may propose.

Sources

  1. Self-hosted Claude Managed Agents Documentation, Anthropic Platform Docs
  2. Model Context Protocol (MCP): Security Design Considerations for AI-Driven Automation, National Security Agency
  3. MCP 2026-07-28 Specification Reference: Stateless HTTP, Tasks, Events, Apps & Elicitation, Open Enterprise Ontology Handbook (Ontoloji.org)

More on AI agent governance: Permissions, approval, audit and security for AI agents that read and act on company systems, including agents that work through MCP.

Keep reading

Follow what we ship.

New connectors, product updates and what we learn rolling AI out in enterprises, sent to your inbox.

Book a demo

Tell us where to reach you and we will reply with times.