Claude Platform Docs
  • Messages
  • Managed Agents
  • Admin

Search...
⌘K
First steps
OverviewQuickstartPrototype in Console
Define your agent
Agent setupToolsMCP connectorPermission policiesAgent Skills
Configure agent environment
Cloud environment setupCloud sandbox reference
Delegate work to your agent
Start a sessionSession operationsSession event streamSubscribe to webhooksDefine outcomesAuthenticate with vaults
Manage agent context
Access GitHubAttach and download files
Advanced orchestration
Multi-agent sessionsScheduled deployments
Reference
Managed Agents reference
Working with files
Files APIPDF support
Skills
OverviewBest practicesSkills for enterprise
MCP
Remote MCP servers
Claude on cloud platforms
Claude Platform on AWS

Log in
Cloud environment setup
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Claude Platform Docs

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Claude on AWS
  • Claude on Google Cloud

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
Managed Agents/Configure agent environment

Cloud environment setup

Customize cloud sandboxes for your sessions.

Environments define the sandbox configuration where your agent runs. You create an environment once, then reference its ID each time you start a session. Multiple sessions can share the same environment, but each session gets its own isolated sandbox (a fresh Linux container).

This page covers type: cloud environments. To run sandboxes on your own infrastructure, see Self-hosted sandboxes.



All Managed Agents API requests require the managed-agents-2026-04-01 beta header. The SDK sets the beta header automatically.

Create an environment

ant beta:environments create \
  --name "python-dev" \
  --config '{type: cloud, networking: {type: unrestricted}}'

Use a unique, descriptive name so you can tell environments apart.

Use the environment in a session

Pass the environment ID as a string when creating a session.

ant beta:sessions create \
  --agent "$AGENT_ID" \
  --environment-id "$ENVIRONMENT_ID"

Configuration options

Packages

The 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.

ant beta:environments create <<'YAML'
name: data-analysis
config:
  type: cloud
  packages:
    pip:
      - pandas
      - numpy
      - scikit-learn
    npm:
      - express
  networking:
    type: unrestricted
YAML

Supported package managers:

FieldPackage managerExample
aptSystem packages (apt-get)"ffmpeg"
cargoRust (cargo)"[email protected]"
gemRuby (gem)"rails:7.1.0"
goGo modules"golang.org/x/tools/cmd/goimports@latest"
npmNode.js (npm)"[email protected]"
pipPython (pip)"pandas==2.2.0"

Networking

The networking field controls the sandbox's outbound network access. It does not affect the allowed domains for the web_search or web_fetch tools.

ModeDescription
unrestrictedFull outbound network access, except for a general safety blocklist. This is the default.
limitedRestricts sandbox network access to the hosts in allowed_hosts. Set allow_package_managers and allow_mcp_servers to true to allow additional access.

The following example creates an environment with limited networking:

ant beta:environments create <<'YAML'
name: api-access
config:
  type: cloud
  networking:
    type: limited
    allowed_hosts:
      - api.example.com
    allow_mcp_servers: true
    allow_package_managers: true
YAML


For production deployments, use limited networking with an explicit allowed_hosts list. Follow the principle of least privilege by granting only the minimum network access your agent requires, and regularly audit your allowed domains.

When using limited networking:

  • allowed_hosts 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.
  • allow_mcp_servers allows outbound access to MCP server endpoints configured on the agent, beyond those listed in the allowed_hosts array. Defaults to false.
  • allow_package_managers allows outbound access to public package registries (such as PyPI and npm) beyond those listed in the allowed_hosts array. Defaults to false.

Environment lifecycle

  • Environments persist until explicitly archived or deleted.
  • Each session gets its own sandbox instance, even when multiple sessions reference the same environment. Sessions do not share filesystem state.
  • 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.

Manage environments

# List environments
ant beta:environments list

# Retrieve a specific environment
ant beta:environments retrieve --environment-id "$ENVIRONMENT_ID"

# Archive an environment (read-only, existing sessions continue)
ant beta:environments archive --environment-id "$ENVIRONMENT_ID"

# Delete an environment (only if no sessions reference it)
ant beta:environments delete --environment-id "$ENVIRONMENT_ID"

Pre-installed runtimes

Cloud sandboxes include common runtimes out of the box. See Cloud sandbox reference for the full list of pre-installed languages, databases, and utilities.

Next steps


Cloud sandbox reference

Pre-installed packages, databases, and utilities available in cloud sandboxes.


Start a session

Create a session to run your agent and start running tasks.

Was this page helpful?

  • Create an environment
  • Use the environment in a session
  • Configuration options
  • Packages
  • Networking
  • Environment lifecycle
  • Manage environments
  • Pre-installed runtimes
  • Next steps