Sandboxing and the Dock

Some code you'd rather not trust with everything — a scraper, a third-party toolkit, a snippet an agent wrote. A sandbox block is how a workbook runs that code with only the powers you grant it. It compiles to WebAssembly and runs against a single, audited host surface called the Dock.

The membrane

WebAssembly has no ambient authority: a wasm module can compute, but it can't open a socket, read a file, or call an API on its own. The only things it can do are the functions the host imports into it. The Dock is that host surface — the one place the Nexus hands real powers to guest code.

Nothing crosses the membrane that you didn't grant. That's the whole security model: not a list of rules the guest is asked to follow, but a wall it physically cannot reach through.

What the Dock can offer

The Dock exposes a small, fixed set of host functions. Guest code never gets the raw power — it gets a narrow, typed call that the host brokers. These are the live host functions a sandbox can call by name today:

Each host function is WIT-typed: the host declares the exact function signature the guest may import. There's no way to import a power that wasn't wired in.

Behind these live calls sits a broader capability catalog — the named capabilities (net, kv, secrets, fs, exec, and the runtime caps vfs, commands, llm, browse, parallel) and the WIT interface each projects. The catalog is the vocabulary the toolchain reasons about; not every catalogued capability has a live guest entry point yet. net (via fetch) and the brokered LLM (via complete) are live today; secrets, fs, exec, and a tenant-scoped kv are catalogued WIT interfaces without a live guest call.

Why broker instead of allow

Every Dock function is the host doing the work, not the host opening a hole. fetch isn't "raw sockets, please be careful" — it's "ask the host to fetch this URL," and the host applies its own policy (the SSRF gate, allowlists) before it acts. That keeps the dangerous part on the trusted side of the membrane, where it can be audited in exactly one place.

You declare what it needs

A sandbox names the host functions it wants, and the weave checks them: the capability audit runs at weave/build time, matching the host functions a block actually calls against what it grants, so a block that reaches fetch is visible at review time and a block that grants nothing can't surprise you. The grants are part of the source — see Grants & capabilities.

The point: untrusted code is still useful code. The Dock lets you run it, see exactly what it can touch, and trust the wall instead of the author.