Getting started

Playground guide

Understand the interactive examples, compile a policy locally and interpret every result.

Before a sandbox can enforce anything, somebody must answer three practical questions:

  1. Which files may the program read?
  2. Which files may it change?
  3. May it communicate outside the sandbox or create child processes?

The JSON manifest is that answer. It does not contain executable code and it does not launch anything. It is a strict, reviewable description of the boundary Warden must later enforce.

Start from a task, not from syntax

The workshop provides four starting points:

Use caseBoundary demonstrated
Build a projectread the source, write only build output, no network
Audit source coderead the project, hide sensitive metadata, change nothing
Install dependencieswrite selected directories and reach only approved registries
Run a generatorprotect source files while allowing one generated output tree

Choose the task closest to yours, then read the manifest as a sentence: deny everything by default, open only these paths, choose this network posture, keep the process tree confined.

The four parts of a manifest

CODE
formatVersion   selects the strict source language
filesystem      says what may be read, written or explicitly hidden
network         disables access, mediates named destinations, or allows direct access
process         states whether children must remain confined

Paths normally use symbolic roots such as workspace and temp. Warden binds those names to real directories only when it prepares an execution. This is why one compiled decision can be used across different machines and sandbox backends.

Try the complete pipeline

POLICY WORKSHOPDescribe the boundary before the program starts
Loading runtime

Choose a familiar task, inspect the permissions it needs, then compile a policy you can enforce.

Build limits
  • document=1 MiB
  • filesystem rules=4096
  • path bytes=4096
  • network destinations=1024
  • hostname bytes=253
  • json depth=32
Use case

Read the project and write only to a prepared build directory, without network access.

JSON
Compiled decisionreadable / binary
Your boundary is ready to reviewCompile it to see the normalized decision and download the portable policy file.
Nothing leaves this page.The downloaded file carries the exact decision you reviewed.

Understand the result

After compilation, the right-hand panel exposes three views of one decision:

ResultWhat it tells you
Readable decisionthe normalized permissions that survived validation
Binary policythe exact portable bytes handed to Warden
Decision fingerprintthe SHA-256 identity of those exact bytes

The readable view may reorder entries, lowercase hostnames and remove duplicates. That is expected: many equivalent JSON spellings become one decision.

The downloaded policy.mir is the normative artifact. The readable JSON is an inspection view and never becomes a second policy identity.

What happens inside the browser

The same C11 compiler used by the native CLI is compiled to WebAssembly. It validates the manifest and produces MIR. A small dependency-free TypeScript implementation independently parses those bytes, checks canonical ordering and recomputes their digest.

Nothing is uploaded and no policy service is contacted.

Continue learning