environments changedmanaged-agents/environments
Nearest release: v2.1.323, published 4 hours after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+10added
Lines−10removed
From line
179
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits31to this page, all time
## Preinstalled runtimes ## Pre-installed runtimes
The whole hunk
from line 179, old and new numbered
/
from line 179
179179
180180## Use the environment in a session
181181
182Pass the environment ID as a string when [creating a session](https://platform.claude.com/docs/en/managed-agents/sessions).
182Pass the environment ID as a string when you create a session (see [Start a session](https://platform.claude.com/docs/en/managed-agents/sessions)).
183183
184184<CodeGroup>
185185 ```bash cURL
from line 258
258258
259259### Packages
260260
261The `packages` (csharp, go: `Packages`) field pre-installs packages into the sandbox before the agent starts. Packages are installed by their respective package managers and cached across sessions that share the same environment. When multiple package managers are specified, they run in alphabetical order (apt, cargo, gem, go, npm, pip). You can optionally pin specific versions. Unpinned packages install the latest version. If the environment uses `limited` [networking](https://platform.claude.com/docs/en/managed-agents/environments#networking), also set `allow_package_managers` (java, php: `allowPackageManagers`; csharp, go: `AllowPackageManagers`) in `networking` (csharp, go: `Networking`) to `true`; otherwise the request is rejected with a 400 error.
261The `packages` (csharp, go: `Packages`) field installs packages into the sandbox before the agent uses it. Package managers run in alphabetical order (apt, cargo, gem, go, npm, pip). You can pin specific versions. If the environment uses `limited` [networking](https://platform.claude.com/docs/en/managed-agents/environments#networking), also set `allow_package_managers` (java, php: `allowPackageManagers`; csharp, go: `AllowPackageManagers`) in `networking` (csharp, go: `Networking`) to `true`; otherwise, the API rejects the request with a 400 error.
262262
263263<CodeGroup defaultLanguage="CLI">
264264 ```bash cURL
from line 609
609609</CodeGroup>
610610
611611<Info>
612 Use `limited` networking with an explicit `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) list. Follow the principle of least privilege by granting only the minimum network access your agent requires, and regularly audit your allowed domains.
612 Use `limited` networking with an explicit `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) list. Follow the principle of least privilege by granting only the minimum network access your agent requires, and regularly audit your allowed hosts.
613613</Info>
614614
615615With `limited` networking and no other fields set, no hosts are allowed. Files, memory stores, and GitHub repositories that you attach to the session stay available. When a request from the sandbox on port 80 or 443 is refused because its host is not allowed, the response is a 403 that names the blocked host.
from line 616
616616
617617When using `limited` networking:
618618
619* `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) specifies domains the sandbox can reach. Specify bare hostnames or wildcard patterns (such as `*.example.com`). Do not include a URL scheme, port, or path. A bare hostname matches that exact host: `example.com` does not match `www.example.com`. `*.example.com` matches every subdomain of `example.com`, but not `example.com` itself.
619* `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) specifies hosts the sandbox can reach. Specify bare hostnames or wildcard patterns (such as `*.example.com`). Do not include a URL scheme, port, or path. A bare hostname matches that exact host: `example.com` does not match `www.example.com`. `*.example.com` matches every subdomain of `example.com`, but not `example.com` itself.
620620* `allow_mcp_servers` (java: `allowMcpServers`; php: `allowMCPServers`; csharp: `AllowMcpServers`; go: `AllowMCPServers`) allows outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) array. Defaults to `false`. While it is `false`, session creation fails with a 400 error if the agent declares an MCP server whose host is not in `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`). The same applies to [an agent it can delegate to](https://platform.claude.com/docs/en/managed-agents/multiagent-orchestration). To fix it, add the host to `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) or set `allow_mcp_servers` (java: `allowMcpServers`; php: `allowMCPServers`; csharp: `AllowMcpServers`; go: `AllowMCPServers`) to `true`.
621* `allow_package_managers` (java, php: `allowPackageManagers`; csharp, go: `AllowPackageManagers`) allows outbound access to a set of public package registries and code hosts beyond those listed in the `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) array. See [Package manager hosts](https://platform.claude.com/docs/en/managed-agents/environments#package-manager-hosts) for the list. Defaults to `false`. Set it to `true` whenever the environment specifies `packages` (csharp, go: `Packages`); otherwise the request is rejected with a 400 error, even if the registry hosts are listed in `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`).
621* `allow_package_managers` (java, php: `allowPackageManagers`; csharp, go: `AllowPackageManagers`) allows outbound access to a set of public package registries and code hosts beyond those listed in the `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) array. See [Package manager hosts](https://platform.claude.com/docs/en/managed-agents/environments#package-manager-hosts) for the list. Defaults to `false`. Set it to `true` whenever the environment specifies `packages` (csharp, go: `Packages`). Otherwise, the API rejects the request with a 400 error, even if `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`) lists the registry hosts.
622622
623623#### Package manager hosts
624624
from line 669
669669
670670## Environment lifecycle
671671
672* Environments persist until explicitly archived or deleted.
672* Environments persist until you archive or delete them.
673673* Each session gets its own sandbox instance, even when multiple sessions reference the same environment. Sessions do not share filesystem state.
674674* Environments are not versioned. If you update an environment frequently, keep your own record of the changes so you can tell which configuration each session used.
675675
from line 812
812812 ```
813813</CodeGroup>
814814
815## Pre-installed runtimes
815## Preinstalled runtimes
816816
817Cloud sandboxes include common language runtimes, databases, and command-line tools out of the box. See [Cloud sandbox reference](https://platform.claude.com/docs/en/managed-agents/cloud-sandboxes-reference) for the full list.
817Cloud sandboxes include common language runtimes, databases, and command-line tools. See [Cloud sandbox reference](https://platform.claude.com/docs/en/managed-agents/cloud-sandboxes-reference) for the full list.
818818
819819## Next steps
820820
821821<CardGroup cols={2}>
822822 <Card title="Cloud sandbox reference" icon="book" href="https://platform.claude.com/docs/en/managed-agents/cloud-sandboxes-reference">
823 Pre-installed packages, databases, and utilities available in cloud sandboxes.
823 Preinstalled packages, databases, and utilities available in cloud sandboxes.
824824 </Card>
825825
826826 <Card title="Start a session" icon="play" href="https://platform.claude.com/docs/en/managed-agents/sessions">
No line in this hunk matches that.