Installation
Runnable Smoke Tests
The repository includes end-to-end scenario scripts undertests/smoke/ in both JavaScript and TypeScript. These also serve as readable usage documentation.
NONO_APPLY=1.
The scripts in
tests/smoke/ are the canonical source for end-to-end behavior.
This page keeps shorter teaching snippets and links back to those files.Basic Usage
1. Check Platform Support
Before applying a sandbox, verify that the current platform supports it:2. Define Capabilities
Create aCapabilitySet and add the permissions your application needs:
3. Apply the Sandbox
End-to-End Patterns
For complete runnable flows, use these scenarios directly fromtests/smoke/:
02-build-capabilitiesfor capability construction patterns03-query-policyfor preflight allow/deny checks withQueryContext04-state-roundtripforSandboxStateserialization and restoration05-safe-apply-patternfor a guarded irreversibleapply()flow06-10for wrapper, agent workspace, diagnostics, config roundtrip, and subprocess patternsnpm run demo/npm run demo:attack-testfor the end-to-end demonstrator
Next Steps
CapabilitySet
Learn all the ways to define capabilities
QueryContext
Test permissions before applying the sandbox
SandboxState
Serialize state for child processes
Functions
Module-level functions reference