What changed
Self-hosted sandboxes are now available for Claude Managed Agents as an alternative to Anthropic-managed cloud containers โ Anthropic handles orchestration and model inference, but tool execution (bash, file read/write, code execution, skills download) runs in infrastructure you control, and the agent's code, filesystem, and network egress never leave your environment.
TL;DR
Self-hosted sandboxes move Managed Agent tool execution into your own containers or VMs (Anthropic orchestrates, you execute), enabling data-residency compliance and private network tool access; Python/TypeScript/Go SDKs support it via EnvironmentWorker; requires anthropic>=0.103.1.
Developer signal
The pattern: create a self_hosted environment via the Environments API (config: {"type": "self_hosted"}) under the managed-agents-2026-04-01 beta header, generate an environment key (separate from your API key โ the worker authenticates with the environment key, never your organization key), then run ant beta:worker poll (CLI) or the SDK EnvironmentWorker class. The worker can run always-on (polling the work queue continuously) or webhook-triggered (starts polling on session.status_run_started events). Per-session container isolation is supported: use --on-work <spawn-script> to launch a fresh container per session, with each container running ant beta:worker run as its entrypoint. SDK helpers available in Python (>=0.103.0), TypeScript, and Go; C#, Java, PHP, Ruby do not yet have EnvironmentWorker โ use the Environments Work endpoints directly. Key constraints: Memory for Managed Agents is not supported with self-hosted sandboxes; not available on Claude Platform on AWS. The sandbox filesystem: /workspace is the working directory, /mnt/session/outputs is where final output files are written (mount a host path here to retrieve them). Queue monitoring: work.stats endpoint returns depth, pending, and workers_polling for fleet liveness alerting.