Install
- pnpm
- npm
- bun
Core concepts
Every sandbox has two layers:- System driver provides host capabilities: filesystem, network, child processes, and permissions.
- Runtime driver manages the isolated execution environment (V8 isolate on Node, Web Worker in browser).
Create a runtime
- Node
- Browser
Execute code
Two methods for running sandboxed code:Capture output
Console output is not buffered by default. Use theonStdio hook to capture it:
Permissions
All capabilities are blocked unless you opt in:Resource limits
Prevent runaway execution with CPU and memory bounds:Filesystem
Networking
TypeScript
Optional companion package for sandboxed type checking and compilation:Clean up
Next steps
Runtimes
Node and Python runtime details.
System Drivers
Configure host capabilities per environment.
Security Model
Trust boundaries, timing hardening, and isolation guarantees.
API Reference
Complete type and method reference.