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 you can choose, with a displayName, description, and default flag. The list is the same for every organization. The console locks Runtime after you create the environment. To use a different runtime, create a new environment.

What the sandbox starts with

The Agent runner image is a Debian-based Linux image 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.

Compute

resources sizes the sandbox. Omit it, or choose Let the platform size it in the console, to use the service’s default size. The console can’t select a GPU: its GPU option lists no models. Set resources.accelerator through the API. 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.
  • Network policy can lower the ceiling. A restricted network policy, including the default no-internet policy, can run only on machines that enforce it. The largest size the API accepts can then be smaller than the console’s 8 vCPU and 32 GiB sliders allow, and the 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

An idle stop saves money without losing work: the next tool call starts compute again and restores the workspace. A stopped delete removes the workspace for good. The API doesn’t check these ranges when you save; a value outside them fails when compute starts, so run a setup test after you change one.

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 templates

listEnvironmentSetupTemplates returns starting-point scripts. Copy one and edit it; a template never updates your environment later. Every template downloads packages, so it needs network access to those hosts.

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, image, 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.

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.
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.
  • 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 is independent of the network policy: changing one never changes the other. In the console, it’s the Privileged Docker access checkbox. Turning it on needs expected_access in a PATCH and makes the setup verdict stale. If no compute can run privileged Docker with the environment’s other settings, the save or the sandbox start 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.
  • In an update, env_vars replaces the whole map. Send {} to clear it.
  • Changing variables makes the setup verdict stale.
  • If the runner changed after the reusable image was captured, a new session runs setup on its own compute. In that case startSession refuses variables that run code at shell or program start, such as BASH_ENV, HOME, PYTHONPATH, and LD_PRELOAD, with 422 setup_fallback_environment_unsafe. Remove the variable, or run setup again to capture a new image.

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.