volume.files.
Volumes require a microVM-runtime deployment with the shared-volume backend and Supabase-backed control-plane state enabled.
Create and mount
/workspace/.nullspace.
Each sandbox can have up to 8 active volume attachments, and subpath= can
mount a volume subdirectory. read_only=True prevents writes through the
sandbox mount while still allowing direct volume.files writes by callers with
API access.
You can also attach volumes at create time with dictionaries:
Runtime attachments
Attach or detach volumes after a sandbox is already running:sandbox.attach_volume(...) accepts a volume ID, volume name, VolumeMount,
or dictionary. If read_only is omitted, the API defaults it to False.
List every sandbox attachment for a volume:
sandbox.pause() and sandbox.hibernate() release live mount leases while
stopped, but preserve attachment intent and remount the same volumes on resume.
AsyncSandbox exposes the same runtime volume methods with await.
Direct volume files
/.
Relative paths are rejected, .. cannot escape the root, and direct volume
operations do not use sandbox cwd or user semantics.
write_files() raises BatchWriteError if any file fails after earlier writes
may already have succeeded. Inspect successes and failures before retrying.
Volume lifecycle helpers
Volume.from_id(id) when you already have a volume ID, and
Volume.from_name(name, create_if_missing=True) when setup scripts should be
idempotent.
Volume.list(fields=[...]), Volume.get(id, fields=[...]), and
Volume.get_by_name(name, fields=[...]) return raw dictionaries containing only
the requested metadata fields.
Async API
AsyncVolume.files mirrors the synchronous direct file and transfer API.
VolumeInfo.max_size_bytes is the current enforced cap. In the hosted private
beta, auto-grow is currently disabled and the default cap is 2 GiB per volume
unless an operator has applied a tenant-specific override. Refresh volume
metadata after large writes when you need the latest capacity view.