- Declarative images — build images with varying dependencies on demand when creating sandboxes
- Pre-built snapshots — create and register ready-to-use snapshots that can be shared across multiple sandboxes
Declarative image building
Build images on-the-fly when creating sandboxes. Ideal for iterating quickly without creating separate snapshots. Declarative images are cached by content hash — identical manifests produce the same image. Subsequent runs reuse the cached image instantly.image to Sandbox.create(), the server:
- Hashes the image manifest to compute a cache key
- If cached, creates the sandbox from the existing checkpoint instantly
- If not cached, boots a build sandbox, executes each step, checkpoints the result, then creates your sandbox from it
Creating pre-built snapshots
Create named snapshots that persist permanently and can be shared across sandboxes. Snapshots are visible in the dashboard and don’t need to be rebuilt.Managing snapshots
Default template
Sandboxes use the default template when no image or snapshot is specified. It includes:- Ubuntu 22.04
- Python 3 with pip, venv, setuptools
- Node.js 20 LTS with npm
- Build tools: build-essential, cmake, pkg-config
- CLI tools: git, git-lfs, curl, wget, jq, rsync, htop, tree
- Editors: nano, vim-tiny
- Database: sqlite3
- Networking: openssh-client, iproute2, net-tools, dnsutils
- Claude Agent SDK and claude-code (pre-installed for agent sessions)
Image configuration
TheImage class provides a fluent, immutable API for defining sandbox environments. Each method returns a new Image instance — the original is never modified.
| Method | Description |
|---|---|
Image.base() | Start from the default OpenSandbox environment |
.aptInstall(packages) / .apt_install(packages) | Install system packages via apt-get |
.pipInstall(packages) / .pip_install(packages) | Install Python packages via pip |
.runCommands(...cmds) / .run_commands(*cmds) | Run shell commands during build |
.env(vars) | Set environment variables (written to /etc/environment) |
.workdir(path) | Set default working directory |
.addFile(path, content) / .add_file(path, content) | Embed a file with inline content |
.addLocalFile(local, remote) / .add_local_file(local, remote) | Read a local file into the image |
.addLocalDir(local, remote) / .add_local_dir(local, remote) | Read a local directory into the image |
.toJSON() / .to_dict() | Return the image manifest |
.cacheKey() / .cache_key() | Compute SHA-256 content hash |
SnapshotInfo
| Field | Type | Description |
|---|---|---|
id | string | Unique snapshot identifier |
name | string | Snapshot name |
status | string | "building", "ready", or "failed" |
contentHash | string | SHA-256 hash of the image manifest |
checkpointId | string | Linked checkpoint ID |
manifest | object | The declarative image manifest |
createdAt | string | ISO 8601 creation timestamp |
lastUsedAt | string | ISO 8601 last usage timestamp |