← Claude Docs

Deploy self-hosted environments to production - Claude Code Docs

Claude Docs · August 12, 2026
Self-hosted Claude Code environments run sessions on in-network runners that execute model-directed code, requiring hardening through ephemeral per-session containers, default-deny network egress, isolated credentials, and blocked access to cloud metadata endpoints. The deployment restricts outbound traffic to specified hosts, manages git configuration for repository operations, and enforces repo-settings guards to prevent unauthorized access across workspace boundaries. Session dispatch remains organization-wide with no per-environment access control, making host-level security and credential isolation critical safeguards against code execution by any organizational member.

Detailed Analysis

Anthropic's Claude Code documentation has expanded to include a detailed operational guide for organizations deploying self-hosted environments to production, reflecting the maturation of Claude Code from an interactive coding assistant into infrastructure capable of running autonomous, model-directed sessions on enterprise-controlled hardware. The guide, framed for the "operator taking a working environment to production," walks through hardening requirements, network egress rules, git authentication, deployment patterns, and troubleshooting. At its core is a stark acknowledgment: a self-hosted runner executes arbitrary code on behalf of any member of an organization's Anthropic account, with no per-environment access control on dispatch. This means any authorized user in an org can trigger code execution on any connected runner host, a design choice that shifts substantial security responsibility onto the deploying organization rather than Anthropic itself.

The technical specifics reveal how seriously Anthropic is treating the security posture of agentic coding systems as they move from sandboxed demos into real production pipelines with access to proprietary codebases and credentials. Recommendations include ephemeral, single-use containers destroyed after each session; minting short-lived credentials per session rather than embedding long-lived secrets in images; blocking cloud metadata endpoints (a classic vector for privilege escalation in cloud environments, notably exploited in incidents like the 2019 Capital One breach); and enforcing "repo-settings guards" that scan repositories for permission grants that could let a session escape its intended workspace. The emphasis on default-deny network egress and least-privilege IAM roles for runner hosts mirrors hardened CI/CD security practices, acknowledging that an AI agent with code-execution capability is functionally equivalent to an untrusted automated pipeline that needs the same containment discipline as a build server running third-party code.

This documentation matters because it signals a broader industry inflection point: AI coding agents are no longer confined to read-only suggestions or human-supervised pair programming but are being architected to run semi-autonomously against live infrastructure, git hosts, and internal services. As agentic AI systems gain the ability to write, execute, and push code with minimal human-in-the-loop oversight, the attack surface expands correspondingly — a compromised session could pivot into credential theft, lateral movement, or metadata-endpoint exploitation if operators don't implement the controls Anthropic outlines. The explicit warning that "dispatch is organization-wide" and that operators must "treat every runner host as reachable for code execution by every org member" underscores that trust boundaries in agentic systems are organizational, not architectural, by default — a nuance that could catch security teams off guard if they assume per-project or per-user isolation exists out of the box.

More broadly, this reflects the growing convergence between AI agent deployment and traditional DevSecOps discipline. Just as containerization and Kubernetes forced a generation of engineers to rethink network segmentation, secrets management, and IAM scoping, the rise of agentic coding tools like Claude Code is forcing similar rigor around autonomous code-execution environments. Anthropic's decision to publish granular, prescriptive hardening guidance — rather than simply exposing an API and letting enterprises figure out security themselves — suggests the company recognizes that mishandled agentic deployments could produce high-profile security incidents that would damage trust in AI coding tools industry-wide. It also positions Claude Code alongside competitors like GitHub Copilot Workspace and Devin as part of a maturing category of "agentic development environments," where the differentiator increasingly isn't just model capability but the robustness of the surrounding operational and security scaffolding required to run these systems safely at enterprise scale.

Read original article →