Lightweight, secure Linux sandboxes for untrusted processes. Runs in the browser and on the server.
Live demo • Getting Started • Documentation • Issues • Contributing
A vpod is a lightweight, portable sandbox that gives an untrusted process an instant Linux environment. It uses a RISC‑V architecture and runs entirely inside WebAssembly.
A vpod runs a complete RISC‑V system (RV64GC, single vCPU) compiled to WebAssembly. Inside it boots a real Linux kernel with a real userspace, so shells, tools and daemons all behave like they would on actual hardware.
Snapshots. Instead of booting Linux from scratch, a vpod restores a snapshot: a saved machine state (CPU registers, RAM, filesystem) captured right after boot. Restoring one takes well under a second. Suspend works the same way in reverse, only dirty memory pages are written back to disk, so you can pause a sandbox and resume it later, even from another process.
Ahead-of-time translation. Pure instruction-by-instruction emulation is slow, and WebAssembly rules out a runtime JIT. So at snapshot build time, the hottest guest code paths are translated from RISC‑V into native code that gets compiled into the WASM module itself. At runtime the emulator dispatches into these translated blocks when the guest code matches, and falls back to the interpreter when it doesn't. This is worth roughly 5x on CPU-bound work, with zero effect on isolation: translated code goes through the same MMU and memory checks as interpreted code.
The WASI boundary. The WASM component talks to the host exclusively through WASI 0.2. The guest never sees host file descriptors, sockets, or memory: filesystem access goes through explicitly mounted directories, and networking goes through a user-mode network stack inside the component that only ever asks the host for plain outbound sockets. Everything else (guest kernel, processes, memory) lives inside the WASM linear memory and dies with it.
C (Compressed instructions) Reduces code size by 30%, improving instruction fetch speed and memory efficiency. This matters when running a full Linux userspace inside our memory-constrained WASM environment.
[!NOTE] The V (vector) extension is not implemented. RVV instructions would execute as emulated RISC-V; there is no SIMD passthrough to the host CPU. Adding V would increase emulation overhead without any performance benefit for vectorized workloads.
[!IMPORTANT] The first call to Sandbox.create() downloads the default snapshot (alpine) and caches it locally if not already present.
pip install vpod root@kitploit:~from vpod import Sandbox # Run a command sandbox = Sandbox.create() result = sandbox.commands.run("whoami") print(result.stdout) # root sandbox.close() # Persistent session — state preserved across calls with Sandbox.create() as sandbox: sandbox.commands.run("export API_KEY=secret") result = sandbox.commands.run("echo $API_KEY") print(result.stdout) # secret # Python REPL — variables persist with Sandbox.create() as sandbox: sandbox.code.run("import requests") sandbox.code.run("data = [1, 2, 3]") result = sandbox.code.run("print(sum(data))") print(result.text) # 6 CLI root@kitploit:~curl -fsSL https://install.vpod.sh | sh Or install via PowerShell (windows) root@kitploit:~irm https://install.vpod.sh | iex root@kitploit:~# Pull a snapshot vpod pull alpine:latest # Start an interactive shell vpod Documentation Visit Vpod documentation.
Contributions are welcome, from bug reports to new device support. Open an issue to discuss anything substantial before building it.
# One-time: generate the AOT stub (a fresh clone has no translated blocks) ./scripts/aot-stub.sh # Build the WASM component (library + CLI). Copies both tiers into sdks/python/vpod/ ./scripts/build-wasm.sh # Install the host CLI cargo install --path crates/vpod # Install the Python SDK in dev mode pip install -e "sdks/python[dev]" # Build the TypeScript SDK. Picks the component up from the Python SDK directory cd sdks/typescript && npm install && npm run build npm run build defaults to --tier aot; CI pins --tier base. The build refuses a component older than the newest file under crates/, so rerun ./scripts/build-wasm.sh after touching the emulator. An emulator change only surfaces through the guest, so a stale component compiles and passes almost everything.
CI runs these on every PR, so run them before pushing:
cargo fmt --all -- --check # formatting cargo clippy --all-targets --all-features -- -D warnings cargo test --all # Rust tests # Python SDK integration tests (needs the WASM library in place) cp target/wasm32-wasip2/release/vpod_wasi_lib.wasm sdks/python/vpod/ pytest sdks/python/tests/ -v -m integration # TypeScript SDK (from sdks/typescript) npm run typecheck npm test # unit npm run test:all # unit + integration, needs a local snapshot npm run test:perf # guest-time regressions, exact constants The TypeScript tests import the built dist/, not src/, so build before running them. They look for a snapshot in the shared cache directory; VPOD_TEST_SNAPSHOT=/path/to/x.snap points them somewhere else.
To exercise the browser end to end, npm run dev serves the page with COOP/COEP on and node dev/run-network.mjs --browser chrome drives it headless.
The SDKs pull from registry.vpod.sh by default. To run one you built yourself, hand it over directly instead of a registry name:
// TypeScript: a file on disk (Node), or bytes (anywhere) await Sandbox.create({ snapshot: { path: "./dist/alpine-3.23.0-256mb.snap" } }); await Sandbox.create({ snapshot: { bytes, name: "alpine-3.23.0-256mb.snap" } }); root@kitploit:~# Python: VPOD_SNAPSHOT=/path/to/x.snap Keep the RAM size in the file name either way, because the emulator reads it from there.
The project uses pre-built Alpine snapshots from registry.vpod.sh, so you normally don't need this. To build one locally:
./scripts/build-default-snapshot.sh # dist/alpine-3.23.0-256mb.snap ./scripts/build-data-snapshot.sh # 512 MB variant with numpy/pandas/scipy [!TIP] To use a locally built snapshot in the CLI, uncomment the lines in resolve_snapshot() in crates/vpod/src/main.rs.
Snapshot builds can also run the AOT pass (scripts/aot-snapshot.sh ), which traces a representative workload, translates the hot blocks, and rebuilds the emulator with them baked in. It takes a while; the stub from aot-stub.sh is fine for everyday development, everything works the same, just slower.
Custom snapshots can also be built from a Dockerfile. The builder uses Apple's container CLI on macOS and Docker Buildx on Linux. A fresh macOS install needs its runtime configured once, otherwise the build waits on a builder that never starts:
container system kernel set --recommended container builder start On Linux, install Docker with the Buildx plugin and register riscv64 emulation once if the host is not already configured for cross-platform builds:
docker run --privileged --rm tonistiigi/binfmt --install riscv64 root@kitploit:~./scripts/build-custom-snapshot.sh -f Dockerfile -n my-image # dist/my-image-256mb.snap # optionally: --aot --trace-cmd ' ' to bake AOT blocks The Dockerfile is built for linux/riscv64 (BuildKit executes RUN steps under emulation), its flattened rootfs replaces the Alpine minirootfs, and the rest of the pipeline is identical: vpod overlay, boot, --snapshot-save.
Only the filesystem survives the export. ENV, CMD and ENTRYPOINT from the image config are discarded, so persist environment through /etc/profile.d/ in a RUN step. Python warm-start is applied automatically for musl-based images that ship python3 in /usr/bin or /bin.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.




