Skip to content
The AI Agent Factory

Cloud environments and self-hosted runners

Approved by
Panaversity ·
10 min read

The sandbox has a settings layer

[Vendor-documented] Each Claude Code cloud session "runs in a cloud environment." An environment is a named set of sandbox settings: network access, environment variables, network secrets and a setup script. The same environments apply to the desktop app, the mobile app, claude.ai/code, claude --cloud, cloud scheduled tasks and Claude Tag. Project threads use the environment set in the project.1,2

[Unknown] The session examined here was started from a claude.ai chat. The environment page does not say whether chat sessions, or tasks in a conversation, use these settings.

The environment page also says what happens to an idle VM. The sandbox and its state quotes it and compares it with what was observed.

Network access

[Vendor-documented] Each environment has one network access level for outbound connections.1

LevelWhat sessions can reach
NoneNothing through the session's network
Trusted (the default)Allowlisted domains: package registries, GitHub and cloud SDKs
FullAny domain
CustomYour own allowlist, with the defaults if you choose

[Vendor-documented] Four paths skip the allowlist at every level:1

  • GitHub, through its own proxy.
  • The MCP connectors you turn on.
  • The hosts listed on the environment's network secrets.
  • The Anthropic API, for Claude Code's own requests.

Setup scripts and the environment cache

[Vendor-documented] A setup script installs tools before Claude Code starts. If it finishes in about five minutes, Anthropic takes a snapshot. A snapshot is a saved copy of the disk. Later sessions start from it. It keeps files the script wrote, not programs that were running. It is rebuilt when you change the script or the allowed hosts, and after about seven days.1

[Inferred] So a new session still gets a new desk. But the desk starts from a known picture. Speed comes from the cache, not from a VM that stays on.

Variables, network secrets and the GitHub proxy

[Vendor-documented] Environment variables are not private. "Anyone who uses the environment can read the values." For a key, use a network secret. Anthropic's agent proxy "adds the key to requests for the hosts you list, after each request leaves the session's VM, so the key itself stays outside the VM." The GitHub proxy works the same way. It "keeps your real GitHub credentials outside the session's VM."1 Who may add a network secret depends on the plan. See Appendix: runtime details.

[Inferred] A network secret protects the key, not its use. A tricked agent cannot copy the key out. But it can still send requests to the listed hosts, with the key attached. So use the narrowest key the job needs, such as a read-only key.

[Vendor-documented] On Team and Enterprise plans, an Owner can create environments shared with every member. Do not put secrets in a shared environment's variables, "because every member's sessions read them."1

Self-hosted environments: the same session in your network

[Vendor-documented] A self-hosted environment "executes Claude Code cloud sessions on infrastructure your organization operates." People start sessions the same way. Only the place changes. A runner is a program on your own hosts. It claims each session from Anthropic's queue, clones the repository and runs Claude Code. "Anthropic never connects into your network." Every connection goes out. Appendix: runtime details shows how runners claim sessions.3

What stays on your machinesWhat still goes to Anthropic
Repository checkouts, build artifacts, secrets, and files the session creates or changesThe conversation: prompts, responses and tool results. Anthropic stores the transcript so you can resume elsewhere
Your runner image and its toolsThe control plane, the Anthropic service that organizes sessions: the queue, orchestration and the claude.ai interface

Basis: vendor-documented.3

[Vendor-documented] Model requests go to the Anthropic API by default. A runner can send them to Amazon Bedrock or Google Cloud's Agent Platform instead. But "session content goes to Anthropic in both cases." Self-hosted environments are in public beta for Team and Enterprise. They are off by default. They are not available with Zero Data Retention or the HIPAA configuration. They have no network secrets, so your deployment provides the keys. Anthropic says most teams are better served by its hosted environments.3,1

[Vendor-documented] Each self-hosted session carries a signed token that your services can check. It proves which session and environment it belongs to. It shows whether a person or your organization's service identity started it. It does not prove which process presents it.4 [Inferred] So it identifies a session, not a worker with narrow scopes. The business layer still adds that. The token's fields are in Appendix: runtime details.

How it maps onto the four layers

LayerAnthropic-hostedSelf-hosted
UIclaude.ai, the apps, claude --cloud, scheduled tasks, Claude TagThe same
BackendAnthropic: queue, orchestration, transcriptThe same Anthropic control plane
Harness and sandboxClaude Code in an Anthropic VM, shaped by the environmentClaude Code on your runner, from your image
ModelAnthropic APIAnthropic API, or Bedrock or Google Cloud's Agent Platform

Basis: vendor-documented.3,1

Two places a cloud session can run. Anthropic-hosted: Claude Code runs in a VM shaped by the environment. The agent proxy adds network secrets outside the VM, and the GitHub proxy swaps in your real token. Self-hosted: a runner in your network claims the session and runs Claude Code, which reaches internal services and your git host. Traffic to Anthropic is outbound only, and model requests can go to Bedrock or Agent Platform instead. A callout says environments change where a session runs and what it reaches, not what it may do.

[Inferred] Environments and runners change what the sandbox can reach and where it runs. They do not decide whether an action is allowed. A self-hosted runner can even widen the reach. See Security boundaries.

Rule to remember: The environment decides where the session runs and what it can reach. Keep keys outside the sandbox and narrow. Keep approval in the service that acts.

Check yourself

Question 1 / 4

0 answered

Where does a network secret's key sit while a cloud session uses it?

  1. As verified on November 9, 2026. Configure cloud environments, Anthropic.↑↑2↑3↑4↑5↑6↑7↑8
  2. As verified on November 9, 2026. Let Claude coordinate ongoing work with Projects, Anthropic.↑
  3. As verified on November 9, 2026. Self-hosted environments were in public beta on Team and Enterprise plans and off by default. Self-hosted environments, Anthropic.↑↑2↑3↑4
  4. As verified on November 9, 2026. Verify session identity in self-hosted environments, Anthropic.↑
Owner
Panaversity