Skip to main content
POST
Fork Sandbox
Forks a sandbox: the new sandbox boots from a snapshot of the origin, so it starts with the origin’s filesystem already in place. The two are independent from that point on — writes in the fork are not visible to the origin, and the origin keeps running. Use this to branch an expensive setup (dependencies installed, dataset downloaded, model warmed) into several parallel workers without repeating the setup in each one.
A fork requires an existing snapshot. Take one with Create Snapshot first, or the request fails with 404 no snapshot to fork from.
Without snapshot_id, the newest snapshot is not necessarily chosen. Resolution is by source first, then recency: newest pause → newest periodic → newest manual.So if the sandbox has ever been paused, a fork with no snapshot_id uses that pause snapshot — even when the manual snapshot you just took is newer. Pass snapshot_id explicitly whenever it matters which point in time you fork from.
The origin’s template and resources are inherited (they must match the snapshot, or Firecracker rejects the restore), so template is ignored in the request body. name falls back to the origin’s when omitted. Everything else — timeout, metadata, envs, network, lifecycle, security — is taken from this request, not copied from the origin. Fields you can set at create time but which are not read here at all (vault_refs, volumes, secure, resources) are simply ignored.

Path Parameters

string
required
The sandbox to fork from. Format: sbx-<hex>.

Query Parameters

string
Fork from a specific snapshot instead of the most recent usable one. The snapshot must belong to this sandbox and to your account.

Body Parameters

Policy is not inherited. Only the template, resources and name come from the origin. security, network, envs, metadata, lifecycle and timeout are taken from this request — omit them and the fork gets none, not the origin’s.So forking a hardened sandbox without repeating its security and network policy produces an unhardened fork. Re-send the policy you want on every fork.
All fields are optional in the sense that the request succeeds without them — but an omitted field means “unset on the fork”, not “copy the origin”.
string
Name for the forked sandbox. Unlike Create — which derives the name from the template — Fork honours this field.
integer
Auto-kill timeout in seconds, applied independently of the origin. It runs from creation and is not extended by activity — running commands does not reset it. Pass 0 to disable auto-kill.
object
Environment variables for the fork. Replaces the origin’s, rather than merging.
object
Network policy for the fork. See Network Policy.
object
Security policy for the fork. See security policies.
object
Arbitrary string key/value pairs.
object
Lifecycle configuration for the fork, applied independently of the origin.

Response

Returns 201 with the full sandbox object for the fork — the same shape as Create Sandbox. sandbox_id is new; the origin is unchanged.

Example

Response

Error Responses