What’s included
A snapshot captures:- Filesystem: the disk state of the box at the time of the snapshot, including cloned repos and installed packages.
- Box configuration: the agent model, runtime, and browser setting. The agent harness is taken from the source box.
- Agent API key: a key passed directly as
apiKeyis not stored in the snapshot. The restored box uses your stored key for that provider or the Upstash-managed key. Passagentagain to use your own key. - Network policy: pass
networkPolicyagain on restore. - Attach headers: pass
attachHeadersagain on restore. - Lifecycle settings: init command, keep-alive, and size use the values passed on restore.
- Schedules: active schedules are not carried over.
Snapshots are the best way to preserve cloned repositories, installed dependencies, and prepared workspaces. If your box already has a repo checked out, restoring from a snapshot is usually faster than cloning it again.
API
Create a snapshot
Callsnapshot() on a running or paused box. The returned Snapshot object contains the ID you need to restore later.
Snapshots are independent of the source box. Deleting the original box does not delete its snapshots. They remain available for restore at any time.
List snapshots
Retrieve all snapshots belonging to a box.Delete a snapshot
Remove a snapshot by ID.Restore from a snapshot
Box.fromSnapshot() provisions a new box from the snapshot’s filesystem and agent model. The original box is unaffected. You can branch into multiple boxes from the same checkpoint.
agent.apiKey, networkPolicy, attachHeaders, initCommand, and keepAlive, can be passed to fromSnapshot(). Env vars from the source box carry over.