Skip to main content
This page lists every environment setting you can use, what each one does inside the sandbox, and the limits the API enforces. For step-by-step tasks, see Set up an environment. For request and response schemas, open Endpoints in the sidebar and select Environments.

Environment fields

Send these fields to createEnvironment and updateEnvironment. An update is partial: omitted fields keep their saved values.

Fields the service sets

These appear in responses. The service sets them, so don’t send them. For an Agent runner environment, responses always include network_policy and privileged. A network_policy of {} means unrestricted.

Runtimes

The runtime (provider) decides what kind of sandbox the environment runs on. listSandboxProviders returns the runtimes API clients can choose, with a displayName, description, and default flag. The list is the same for every organization. The console uses the catalog’s default runtime and does not show a runtime control. API clients still send provider when creating an environment; an existing environment’s provider cannot be changed.

What the sandbox starts with

Every environment starts from the Agent runner image: Debian-based Linux with Python 3 and uv, Node.js and npm, git, curl, and apt with sudo. Add anything else in the setup script. The agent’s working directory is /workspace.

Environment templates

listEnvironmentTemplates returns reviewed starting points. Each has an id, a revision, a name and summary for the console card, and a definition in the createEnvironment request shape. The console’s Choose a starting point cards fill the create form from the same list. See Start from a template.

Compute

resources sizes the sandbox. Omit it, or choose Use platform default in the console, to use the service’s default size. In the console, expand Compute, set Compute kind to GPU, and pick a GPU model. Each model shows its memory and whether one is free now; availability is checked again when a sandbox starts. For CPU sizes, the console offers these shortcuts, in 250-millicore and 1024-MiB steps: How sizes are checked:
  • CPU and memory must fit one machine together. A pair that no machine offers is rejected with 400 invalid_request, and the message names the most memory available at that CPU size.
  • Available compute can lower the ceiling. CPU environments never exceed 8 vCPU or 32 GiB. The current provider catalog and a restricted network policy, including the default no-internet policy, can impose a smaller maximum; a rejected save returns 400 invalid_request with the current limit.
  • Changing compute makes the setup verdict stale. Run setup again after you resize.

Workspace and lifecycle

Message the same session to reopen its workspace after an idle stop or later release. Its /workspace files can be used when the workspace reopens successfully. If it cannot reopen, contact support. Delete the session separately when you no longer need it. The API checks these ranges when you save; run a setup test afterward to verify the complete environment configuration.

Sandbox paths

Who shares a sandbox

  • Each top-level session gets its own fresh sandbox from the environment. Sessions never share files through an environment.
  • Subagents and teammates run in their root session’s sandbox, so they can hand work over by file path. See Multi-agent.
  • A change to the environment affects only sandboxes started after it. Running sessions keep the configuration they started with.

Setup

How the script runs:
  • As the sandbox user, not root, in a separate bash login shell with set -eo pipefail. The first failing line ends the run.
  • With the environment’s env_vars, mounts, and network policy. In a setup run, session credentials such as vault grants are never available to it.
  • Exports, source, aliases, and shell functions don’t carry over to the agent’s commands.
On save, the service converts Windows line endings and trims trailing whitespace. A non-empty script is stored ending in one newline. In an update, setup replaces the whole object, and {"script": ""} removes the script.

Setup warnings

setup_warnings lists advice. Warnings never block a save or a run. Each warning has a code, a one-based line (0 when it’s about the save), and a message.

Setup verification

setup_verification tells you whether the setup script has passed for the environment’s current configuration. When a script exists, a session can start only when status is verified, stale is false, and the service kept a reusable image from the passing run. Otherwise startSession returns 422 environment_not_verified. Changes that make the verdict stale: provider, setup (script or timeout), resources, pvc_size_gi, env_vars, mounts, network_policy, and privileged. Changes that don’t: name, description, metadata, computer_use, idle_stop_after_seconds, and stopped_delete_after_seconds.

Last-run summary

Setup runs

A setup run executes the setup script on fresh compute, records its output, checks the compute, saves a reusable image, and releases the compute. Saving an environment never starts compute. After the save succeeds, call createEnvironmentSetupRun with its own Idempotency-Key to start a run.

Setup-run statuses

Only a failure in the setup phase points at your script. A run can succeed even if saving the reusable image fails; the console then shows Setup passed, but its reusable image failed. and sessions can’t start until a later run saves one.

Setup-run log lines

getEnvironmentSetupRunLog returns lines, a next_after cursor, the run’s status, and truncated.

Setup-run parameters

Network policy

network_policy decides which hosts the sandbox can reach. It governs the setup script, the agent’s commands, package managers, git, and websites the sandbox browser opens. Model calls, the agent’s MCP servers, and the web_search and web_fetch tools don’t go through the sandbox, so the policy doesn’t affect them.
  • A session started by an automation or from Slack, in an environment with any restricted policy (limited or no internet access), doesn’t get the web_fetch tool.
  • Tools of built-in integration apps, such as Jira and Confluence, run inside the sandbox. Recursion adds the hosts they need to a policy limited to specific hosts; a no-access policy blocks them.
How rules apply:
  • Rules are checked in order. The first rule that matches a host decides.
  • Outbound traffic that no rule allows is blocked.
  • A rule allows or blocks a whole host. Once allowed, sandbox code can send any request to it, including uploads.
  • Unknown fields are rejected with 400 invalid_request.

Common policies

Hosts common tools need

Attaching a credential in a vault never opens the network. If the agent uses a credential from inside the sandbox, the policy must also allow the host. See Authenticate with vaults and GitHub access.

Defaults and updates

  • Create: omitting network_policy, or sending null, stores {"version": "v1", "rules": []}: no internet. Send {} for unrestricted access.
  • Update: omitting network_policy keeps the saved policy. A value you send replaces the whole policy.
  • Privileged Docker: a nonempty policy cannot be combined with privileged: true on create or when access settings change. Use {} for unrestricted access before enabling privileged Docker.
  • Access precondition: a PATCH that changes a saved policy other than {} (including the default no-internet policy), or turns privileged on, must include expected_access with the network_policy and privileged values from your last read. Missing returns 428 precondition_required; out of date returns 412 precondition_failed.
  • Console: Internet access sets Enabled ({}) or No access (no rules). A saved host-rule policy shows as Custom policy (saved) until you pick a mode, which replaces it.
  • Verification: any policy change makes the setup verdict stale.

Privileged Docker

privileged: true lets the agent run Docker containers inside the sandbox. It’s false by default and requires unrestricted internet access (network_policy: {}). The console’s Privileged Docker access checkbox is available after you choose Internet access → Enabled. Changing either setting does not silently change the other. Turning privilege on needs expected_access in a PATCH and makes the setup verdict stale. If an existing environment has both limited internet access and privileged Docker, you can view it and edit other settings. To start a new session, enable unrestricted internet access or turn off privileged Docker. If no compute is available for the requested settings, saving or starting a session fails.

Computer use

computer_use: true adds a shared browser display to the sandbox, which the agent controls with the computer tool. You can follow the recorded screens in the session. The service sets http_port to 6901 for the display. When the agent needs a person for a step such as a sign-in, it calls handoff_to_user and the session waits in awaiting_human; see Sessions.
  • idle_stop_after_seconds must be 0 or at least 600.
  • The browser follows the network policy. Under a restricted policy, allow each site the agent must visit.
  • Turning computer use on or off doesn’t make the setup verdict stale.

Environment variables

env_vars is a map of names to plain-text values exported in the sandbox. Anyone who can view the environment can read the values, and so can any code the agent runs. Never put secrets here; use vaults instead.
  • PATH is rejected. The sandbox already selects /workspace/.venv; call tools by full path or prepend to $PATH inside a command.
  • Variables the shell, the loader, or Python read at startup are rejected too: BASH_ENV, HOME, SHELLOPTS, PS4, PYTHONPATH, PYTHONHOME, PYTHONUSERBASE, PYTHONWARNINGS, PYTHONPLATLIBDIR, LD_PRELOAD, LD_AUDIT, LD_LIBRARY_PATH, GCONV_PATH, and BASH_FUNC_*. Set one inside the command that needs it instead, for example PYTHONPATH=/workspace/src python main.py.
  • In an update, env_vars replaces the whole map. Send {} to clear it.
  • Changing variables makes the setup verdict stale.

Mounts

mounts downloads files into the workspace when a sandbox starts, so the agent finds input data on disk at its first turn.
  • Two mounts can’t use the same path or one inside the other.
  • Mounts are checked when a sandbox starts, not when you save. An invalid mount makes provisioning fail, so run a setup test after you change mounts.
  • Anyone who can view the environment can read each source URL. Don’t embed long-lived credentials in it.
  • In an update, mounts replaces the whole list. Send [] to clear it.

Sandbox tools that depend on the environment

The agent’s tools run in the sandbox this environment defines. A few depend on its settings. For the full tool list, see Tools. A tool being available never grants network access.

Environment lifecycle

Limits

For every product limit, see Limits.

Next steps

Set up an environment

Create, verify, restrict, update, and delete environments.

Deliverables and artifacts

How agents save files to the outputs folder and how they’re collected.

Security

What reaches the sandbox and how credentials flow.

Troubleshooting

Fix common session and environment problems.