run_on= (Python) or run_on: (YAML) once on a flow, team, or workflow and every agent shares one remote sandbox, so a file written by one step is visible to the next.
run_on= gives them all the same /workspace.
Quick Start
1
Share one sandbox across a workflow
Set
run_on once — every step runs its shell and file tools in one sandbox. Python and no-code YAML both use the same key.- Python
- YAML
2
Share one sandbox across a team
The same
run_on= kwarg works on a team.3
From workflow YAML — no Python
Add one line — Run it with the standard CLI — no Python needed:The accepted values are identical to the Python API —
run_on: docker — to any workflow YAML and every step shares the same sandbox. The rest of the file is a normal workflow.docker | e2b | modal | daytona | flyio | tenki | local, or omit run_on: entirely for the default local behaviour (see the Configuration Options table below). Action-only steps like - agent: X; action: "..." share the same sandbox as regular steps, so the writer/reader pattern above works exactly as shown.4
Pick a provider
Pass any provider name, or a pre-configured provider instance to customise the image and resources. The provider name is identical for Python and YAML.
- Python
- YAML
- docker
- e2b
- modal
- daytona
- flyio
- tenki
- local
How It Works
One sandbox is provisioned lazily on first tool use and torn down when the run ends, even if a step raises.Load-time Validation
A typo inrun_on: fails when the YAML loads, not halfway through a paid run.
The provider name is checked against the registry at parse time. An unknown provider raises with the full list of valid names:
DOCKER and " docker " both normalise to docker.
Configuration Options
run_on= accepts a provider name or a pre-configured provider instance. The accepted values are identical for Python (run_on="docker") and YAML (run_on: docker).
Which param goes where
run_on= is the team- and workflow-level kwarg; per-agent execution still uses compute=.
run_on= and per-agent compute= are different knobs. Set run_on= on the flow or team when agents share files; use compute= on an individual agent to sandbox just that agent.Common Patterns
Hand a file between two agents — step 1 writes, step 2 reads the same/workspace.
Choosing a Provider
Pick the provider that matches where you want the sandbox to live.Best Practices
Size the sandbox for the heaviest step
Size the sandbox for the heaviest step
All steps share one instance. Pass a configured provider instance to size the image, CPU, and memory for the biggest step, since it affects the whole run.
Don't mix run_on= with agents that carry their own backend=
Don't mix run_on= with agents that carry their own backend=
Agents that already carry their own
backend= are deliberately skipped — they keep pointing at their own runtime. Use one approach or the other per agent.Related
YAML Workflows
Full no-code workflow reference — including the top-level
run_on: key.Managed Agents
Per-agent managed execution and providers.
Managed CLI
Use
managed ps / stop to find and reclaim stray sandboxes.Managed Agents (Docker)
Docker daemon setup and provider details.
Managed Agents (E2B)
E2B cloud sandbox and
E2B_API_KEY setup.Managed Agents (Modal)
Modal cloud compute setup.
Tenki Cloud
Tenki microVM and
TENKI_API_KEY setup.
