Learning resourcesReviewed · Anthropic

Securely deploying AI agents

Securely deploying AI agents is a guide for developers securing Claude Code and Agent SDK deployments, with safeguards that depend on careful infrastructure configuration. It explains isolation choices, external credential proxies, network restrictions and filesystem controls.

Researched 23 Nov 2026

In short.

Securely deploying AI agents is a practical guide for developers and infrastructure teams running Claude Code or the Agent SDK, with protection dependent on correctly implemented isolation and access controls. It connects prompt-injection risks to concrete deployment choices, including restricted containers, external credential proxies and read-only workspaces. The examples support architectural planning, but their compatibility, performance and security effectiveness remain unassessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is limited to the complete selected documentation page at [https://code.claude.com/docs/en/agent-sdk/secure-deployment.md]. It includes the threat model, built-in safeguards, isolation comparisons, container and cloud configurations, credential-management patterns, filesystem guidance and stated security limitations. Linked documentation, repositories, model evaluations and further-reading pages are excluded. Performance figures are source claims without supporting benchmark methods on this page. No software execution, deployment validation or security testing was performed; current compatibility, total cost and redistribution rights remain unknown.

The overview

Resource identity

This guide appears in the Claude Code documentation at [https://code.claude.com/docs/en/agent-sdk/secure-deployment.md]. It addresses Claude Code and Agent SDK applications that execute code, access files and interact with external services.

Its scope runs from built-in permission and sandbox features to deployment architectures using containers, gVisor, virtual machines and cloud network controls.

Practical assessment

The guide is useful for deciding where an agent's authority should end and which controls must operate outside its environment. Its most concrete contribution is connecting isolation with a proxy that controls outbound requests and supplies credentials without exposing them directly to the agent.

The configurations are architectural examples requiring deployment-specific components. The page does not establish that a particular combination is secure, compatible with a given application or ready for production.

Who it helps

Individual developers and CI/CD maintainers can use the sandbox discussion to understand lightweight restrictions. Teams handling customer data, multiple tenants or untrusted repositories can use the container, gVisor, VM and cloud sections to consider stronger boundaries.

Beginners receive explanations of prompt injection, least privilege and credential separation. Implementing the examples calls for knowledge of operating-system permissions, container networking and proxies; TLS interception also introduces certificate-management work.

What the guide covers

The page describes permission rules, approval for recognized critical-path deletions in default permission mode, summarized web-search results and sandboxed Bash execution. It distinguishes command approval from controls that restrict filesystem access.

Deployment guidance covers read-only mounts, temporary writable storage, reduced Linux capabilities, syscall filtering, resource limits, restricted networking and external proxies. Cloud guidance adds private subnets, egress firewall rules, minimal service-account permissions and proxy logging.

Using it

Requirements

Requirements depend on the isolation choice. The sandbox-runtime description uses bubblewrap on Linux and sandbox-exec on macOS. The container example assumes Docker, an agent image, a seccomp profile, selected host paths and an external proxy. The gVisor example additionally requires the runsc runtime and Docker daemon configuration.

Proxy-based credential injection requires a service outside the agent's boundary. Inspecting arbitrary HTTPS traffic also requires TLS termination and a proxy CA certificate trusted inside the agent environment. The page supplies no general minimum hardware requirements; its example resource limits are configuration choices.

How the protection works

Prompt injection means that instructions inside processed content can influence an agent's actions. The guide responds by limiting what those actions can reach: files are selectively exposed, direct network access is restricted, and sensitive credentials remain outside the agent's environment.

An external proxy can validate destinations, attach credentials and log requests. ANTHROPIC_BASE_URL changes the destination of Claude sampling API requests. HTTP_PROXY and HTTPS_PROXY configure proxy use for clients that respect them; an ordinary HTTPS CONNECT tunnel does not expose request contents for credential injection without TLS termination.

The container pattern combines --network none with access to a host proxy through a mounted Unix socket. A local TCP endpoint, when needed by a client, must be relayed to that socket.

Setup guidance

The Docker example combines dropped Linux capabilities, no-new-privileges, a seccomp profile, a read-only root filesystem, temporary writable directories, disabled networking, resource limits and a non-root user. It mounts source code read-only and exposes an external proxy socket. The actual image, seccomp policy and proxy implementation must be supplied.

For writable work, the page presents temporary memory-backed filesystems, an overlay layer whose changes can be inspected, or a dedicated persistent volume. Sandbox-runtime installation and launch instructions are delegated to a linked page and are outside this document.

Illustrative use

For a repository-analysis service, the container pattern would expose only the required source files through a read-only mount, provide temporary working storage and disable ordinary container networking. Secrets such as environment files, registry tokens and private keys would be excluded before exposing the source.

A host-side proxy reached through a Unix socket would permit the required API requests and attach credentials outside the container. This illustrates how the guide's components fit together; it is not an executed deployment.

Assessment & evidence

Limits and failure modes

Domain allowlists still permit data to be sent to allowed destinations. The guide warns that permissive credentials for an allowed service can enable further requests or data disclosure. Its default sandbox proxy does not inspect TLS, and the page identifies domain fronting as a possible route around hostname-based restrictions.

Some programs ignore proxy environment variables, so setting those variables alone does not establish enforced routing. Read-only mounts prevent modification but still expose readable secrets. Sandbox-runtime and ordinary containers share the host kernel; gVisor and VMs introduce different boundaries with their own implementation and operational trade-offs.

The page's performance and isolation-strength comparisons are guidance rather than independently established results. It supplies no reproducible benchmark procedure or evidence that the example configuration blocks every relevant attack.

Architectural implications

The architectural implication is that restrictions should continue to apply even when an agent requests an unintended action. Filesystem and network boundaries constrain what can succeed, while keeping credentials outside the agent reduces opportunities for direct secret disclosure.

Credential separation does not by itself limit every authenticated action. Request validation, narrowly scoped service permissions and carefully chosen destinations remain central to the design. The appropriate isolation level depends on the sensitivity of accessible data, the trustworthiness of processed content and acceptable operational overhead.

Options compared

The guide presents sandbox-runtime as the simpler, lightweight option; Docker adds configurable container isolation; gVisor mediates system calls through a userspace compatibility layer; and VMs provide a separate guest kernel. These are implementation choices discussed by the page, with no independently verified ranking.

For authenticated services, it offers custom tools or MCP servers that perform authenticated work outside the boundary, and TLS-terminating proxies that handle general HTTP-based services. Envoy, mitmproxy, Squid and LiteLLM are named proxy options, but their documentation, licenses and suitability are not assessed here.

Evidence and confidence

The documentation supplies architectural explanations, configuration snippets, comparison tables and explicit security cautions. These support an account of the proposed controls and their stated limitations.

The page contains no deployment test logs, penetration-test results or reproducible benchmark methodology. No commands or configurations were executed, so working behavior, compatibility, performance and security effectiveness remain unassessed.

Access & freshness

Costs and operational effort

The page gives no Claude usage prices, infrastructure prices, software charges or staffing estimates. Total deployment cost is unknown.

The described architectures require different amounts of infrastructure and administration. Proxies, certificates, isolation environments and traffic logs add components to operate. The page compares performance overhead, but it does not provide a cost model or measurements for a particular deployment.

Licensing and reuse

The supplied page contains no explicit license or redistribution permission for its documentation or examples. Reuse and redistribution rights are unknown. Licenses for the linked tools and repositories are outside the selected page.

Dates and version coverage

The supplied copy was captured on 23 November 2026 at 16:22:39 UTC. The page states no publication date, last-update date or overall version pin for Claude Code or the Agent SDK.

Compatibility with particular releases of Docker, gVisor, operating systems and proxy tools is not established by this page.

How to use the guide

Use the guide to define the files, destinations and authenticated operations an agent actually needs, then choose an isolation approach that fits the data sensitivity and operating environment. Prepare sanitized mounts and keep credentials outside the agent boundary wherever the architecture permits.

Before relying on a deployment, establish that direct outbound connections are blocked as intended, proxy requests are appropriately restricted, secrets are inaccessible and unwanted writes fail. Measure the actual workload before accepting performance trade-offs, and consult the referenced setup and permissions documentation for implementation details.

Evidence for this report

selected-page.txtselected · checked 2026-11-23