Skip to main content
Patches attach bash scripts to a checkpoint. When a sandbox boots from that checkpoint or wakes from hibernation, all pending patches run automatically in sequence order.

Create a Patch

result = await Sandbox.create_checkpoint_patch(
    checkpoint["id"],
    script="pip install requests==2.31.0",
    description="Pin requests version",
)

print(result["patch"]["sequence"])  # 1

Sandbox.create_checkpoint_patch(checkpoint_id, script, **kwargs)

checkpoint_id
str
required
UUID of the checkpoint to patch.
script
str
required
Bash script to execute inside the sandbox.
description
str
default:"''"
Human-readable description.
api_key
str | None
default:"None"
API key override.
api_url
str | None
default:"None"
API URL override.
Returns: dict

List Patches

patches = await Sandbox.list_checkpoint_patches(checkpoint["id"])
# [{"id": "...", "sequence": 1, "script": "...", "description": "..."}, ...]

Sandbox.list_checkpoint_patches(checkpoint_id, **kwargs)

Returns: list[dict] — ordered by sequence number.

Delete a Patch

Remove a bad or unwanted patch. Remaining patches continue to apply in sequence order.
await Sandbox.delete_checkpoint_patch(checkpoint["id"], patch["id"])

Sandbox.delete_checkpoint_patch(checkpoint_id, patch_id, **kwargs)

checkpoint_id
str
required
UUID of the checkpoint.
patch_id
str
required
UUID of the patch to delete.
Returns: None

How Patches Apply

EventPatches run?
Sandbox.create_from_checkpoint()Yes — after boot
await sandbox.wake()Yes — after restore
Sandbox already runningNo — next wake/boot
Patches run sequentially by sequence number. If a patch fails (non-zero exit), the chain stops. Progress is tracked per-sandbox, so the next wake retries from the last successful patch.