Skip to main content
SandboxState is a JSON-serializable snapshot of a CapabilitySet. Use it when you need to persist a sandbox policy, transmit it between processes, or build a capability set from previously stored configuration.

Create state from capabilities

Serialize to JSON

The returned value is a JSON string.

Restore from JSON

SandboxState is safe for concurrent use. Multiple goroutines may call JSON concurrently; Close requires exclusive access.