Sailboxes are persistent Linux VMs managed by Sail. They are useful for running generated code, isolated agent workspaces, test suites, web servers, or commands that need a real Linux environment.Documentation Index
Fetch the complete documentation index at: https://docs.sailresearch.com/llms.txt
Use this file to discover all available pages before exploring further.
Sailboxes are currently in beta. APIs and operational behavior may change as
we stabilize the product.
- Run indefinitely without a fixed maximum lifetime.
- Pause and resume sandbox state, including open network connections, for any duration. This allows agent harnesses to be quiesced without any additional work required.
- Automatically sleep Sailboxes while waiting on Sail inference calls. You are only charged while your sandbox can actively be used.
Install
Create a sailbox
Create a Sail app namespace, then start a sailbox from the Debian arm64 image:Sailbox.create() returns after the VM is running. Pass cpu, memory_mib,
and disk_gib to size the sailbox, and ingress_ports to expose services.
Sailboxes should use
sail.Image.debian_arm64 or sail.Image.debian_arm. We
have plans to support AMD64 images soon - please contact us if you would like
us to prioritise this.Sailbox.connect():
connect() returns a full Sailbox handle that can run commands, read and
write files, manage listeners, and make network requests. It verifies the
current placement for a running sailbox and resumes a paused or sleeping
sailbox before returning.
Run commands
exec() starts a shell command and returns a durable exec request. Call wait()
to read stdout, stderr, and the return code.
cwd to run from a working directory. Use background=True for long-lived
processes such as web servers.
Read and write files
Usewrite() to upload bytes, strings, or file-like objects into the sailbox
filesystem and read() to fetch regular files back as bytes. Paths must be
absolute. Missing parent directories are created by default. Pass mode to set
POSIX permission bits; when omitted, writes default to 0o644.
Run Python functions
Decorate a Python function with@sail.function() and pass it to exec() to
run it inside the sailbox. For functions, exec() waits for completion and
returns the function’s return value directly. Sail runs the function with the
image’s python3.
Python functions are currently supported only for sailboxes running custom
images. We plan to remove this limitation shortly.
background=True is not supported for
functions. Remote exceptions are raised as sail.SailboxFunctionError with the
remote traceback attached.
This beta path sends serialized function payloads and return values through the
existing exec RPC. Keep arguments and return values small; for large dataframes
or artifacts, write data from inside the sailbox and return a small reference.
Expose ports
Passingress_ports when creating the sailbox, start a service inside the VM,
then fetch the listener URL.
1 and 65535. Ports 22 and 10000 are
reserved by the platform.
Lifecycle
Sailboxes preserve their writable disk, in-memory state, and in-flight network requests across checkpoints and resumes.checkpoint() after important setup, such as installing packages or
fetching remote data. On host failure, Sail restores from the most recent
completed checkpoint and does not replay commands that ran after that
checkpoint.
Sleep during inference
To automatically sleep a sailbox while a foreground Sail inference call is in flight, include its ID in the request with theX-SailboxId header. Sail will
resume the sailbox after the inference call completes.
Custom images
Start from the arm64 Debian base image and add build steps:apt_install, pip_install, run_commands, env, and build.