Mirage In-Browser WASM Execution Sandbox & Web Worker Jail

Mirage In-Browser WASM Execution Sandbox & Web Worker Jail

@strukto-ai/mirage·v1.1.0·sandbox

A zero-latency, client-side WebAssembly execution sandbox for DeepSeek Harness. Runs Python, JavaScript, and SQLite inside isolated Web Workers without backend server overhead.

WASM-Sandbox · In-Browser · Pyodide · Client-Side

GitHubNPM
Installation & Integration
bash
manager:
$ pnpm add @strukto-ai/mirage

Architecture

Mirage Sandbox unlocks secure, instant code execution natively within the user's browser. Typical cloud sandbox architectures demand fleet clusters of expensive Docker nodes that introduce cold-start latency and continuous hosting bills. This plugin leverages WebAssembly (WASM) and Pyodide inside sandboxed Web Workers. Autonomous agents execute data science scripts, query SQLite databases, and synthesize reactive data visualizations directly on client hardware. Sensitive customer data never leaves the browser, combining absolute privacy with zero cloud infrastructure costs.

Core Features

01

Pure Client-Side WASM Execution: Zero backend container hosting costs or cluster maintenance

02

Airgapped Data Privacy: Sensitive datasets process locally within the user's browser securely

03

Sub-Millisecond Cold Starts: Eliminates multi-second container boot lags for instantaneous feedback

04

Scientific Python Ecosystem: Full support for NumPy, Pandas, Matplotlib, and SymPy natively

Core Workflow

01

Web Worker Jail Spawning

Spawns an isolated Web Worker thread with an in-memory virtual filesystem.

02

WASM Runtime Hydration

Hydrates Pyodide or QuickJS WASM micro-kernels and standard library modules.

03

In-Memory Code Evaluation

Executes target scripts with zero access to main-thread DOM or session cookies.

04

Output & Canvas Pipe

Pipes stdout, return values, and synthesized chart images back to the chat UI.

Configuration Parameters Reference (YAML / JSON)

ParameterTypeDefaultDescription
runtimeLanguagestringpythonWASM sandbox runtime engine
executionTimeoutMsnumber10000Worker execution timeout in milliseconds
preloadStandardLibsbooleantruePre-warm scientific libraries in background