# The sandbox The sandbox is a **core subsystem** (`src/modules/sandbox/`): it runs code in an **opaque-origin iframe** (`sandbox="allow-scripts"`, no `allow-same-origin`) that reaches the app **only** through a capability-gated message bridge. Sandboxed code cannot read the page DOM, cookies, `localStorage` (the SASL handoff password), or the store — only what its `permissions` grant. Two things use it: - **Built-in features (bundled)** — the app mounts them itself at boot via `src/modules/sandbox/builtins.ts` → `mountSandboxed({ name, source, permissions })`, with the source compiled into the app (`?raw`). They are **opt-in per deployment**: a built-in only mounts if its name is listed in `config.json` `"builtins": [...]`. Example: the `dice` 🎲/🪙 widget (`src/modules/sandbox/features/dice.js`). To add one, follow `src/modules/sandbox/features/README.md`. - **Operator plugins (config)** — a `config.json` entry with `sandbox: true` is fetched and mounted the same way. Use for community / third-party / less-trusted plugins. (Plain string entries still load in-page as a trusted `