Skip to main content
A volume is a named, owner-owned store of files that lives outside any single sandbox. Unlike a sandbox’s own filesystem — which is ephemeral, private, and gone when the sandbox is killed — a volume persists, and you can attach it to any number of sandboxes at a mount path. Volumes carry data (datasets, model weights, an agent’s working tree); templates define the base image a sandbox boots from.

Two kinds of volume

Both are owner-scoped — you can only attach your own volumes.

Create and attach (copy-mode)

Upload a gzip tar archive once, then attach it to sandboxes at create time. On boot, the archive is materialized under the attachment’s mount_path before the first command runs.
The same volume can be attached to many sandboxes in parallel — each gets its own private copy, so there’s no contention.

File-granular volumes (live mounts)

A file-granular volume is a shared filesystem you can edit from the SDK with no sandbox running, and live-mount into a sandbox so reads and writes go straight to the shared volume. Create one empty (or seed it from an archive), edit its files directly, then mount it read-write.
Use mode="mount-ro" for a read-only mount (guest writes are rejected). Live mounts require a file-granular volume; copy-mode volumes can only be attached with mode="copy".

Mount a sub-path

Mount just part of a volume with subpath (live-mount only — the server rejects subpath on a copy attachment):

Snapshot and commit

Capture filesystem state from a running sandbox into a new volume — the source is never modified:
snapshot captures any in-sandbox path; commit captures the mount path of a volume already attached to that sandbox. Both return a new volume and leave the source untouched. Synthetic paths (/proc, /sys, /dev) are rejected.

Coordinate writers with advisory locks

When several sandboxes share a live-mounted volume, coordinate writers with advisory leases over a (volume, path) pair. acquire returns a token you present to renew / release:
Locks are advisory — they coordinate cooperating writers; they don’t block I/O from code that ignores them. For atomic read-modify-write, file-granular writes also support a compare-and-swap (if_version) check.

Limits

  • Format: uploads are gzip-compressed tar archives (application/gzip). Only regular files are materialized — symlinks, hardlinks, device nodes, and entries containing .. are dropped for safety.
  • Upload size: the upload body is capped at 4 GiB.
  • File-granular capacity: a flat 64 GiB per-volume cap (a hard abuse-prevention ceiling, not a per-tier quota — volumes are not tier-gated).
  • Ownership: strictly owner-scoped; you can attach only your own volumes. A volume that is still live-mounted by a sandbox cannot be deleted.

VolumeInfo model

Use cases

Upload a dataset once, then fan out many parallel sandboxes that each read the same files at boot — no per-sandbox upload step.
Live-mount one file-granular volume into several sandboxes so a team of agents reads and writes a common workspace. Serialize concurrent writers with advisory locks.
Capture a sandbox’s output directory into a new volume after an expensive step, so you can restore or share it later.
For the full method reference, see the SDK volume guides (Python, TypeScript, Go) and the Volumes API. For runnable examples, see the Volumes cookbook.