01 / DECISION
When this primitive earns a place
Use Sandbox SDK when untrusted or generated code needs an isolated Linux execution environment and a Worker must control the boundary.
02 / ARCHITECTURE
Build the smallest defensible path
Allocate one sandbox per trust boundary, use explicit sessions, allowlist commands and egress, set resource and time limits, proxy secrets outside, and destroy on completion.
- 01Name the contract
Use Sandbox SDK when untrusted or generated code needs an isolated Linux execution environment and a Worker must control the boundary.
- 02Add one primitive
Allocate one sandbox per trust boundary, use explicit sessions, allowlist commands and egress, set resource and time limits, proxy secrets outside, and destroy on completion.
- 03Capture failure evidence
Reject a forbidden command and destination, enforce timeout and cleanup, verify session separation, and confirm no secret enters the sandbox.
03 / REPRODUCE
Evidence before confidence
Reject a forbidden command and destination, enforce timeout and cleanup, verify session separation, and confirm no secret enters the sandbox.
pnpm create cloudflare@latest my-sandbox --template=cloudflare/sandbox-sdk/examples/minimal 04 / BOUNDARY
The production boundary
Isolation is not permission to run arbitrary user intent. Follow current SDK migration guidance and keep browser automation in Browser Run.
05 / FIRST-PARTY SOURCES
Keep first-party sources authoritative
Product behavior, limits, pricing, and availability can change. Re-check these sources before acting.