Skip to main content

Lightweight, secure sandboxes for untrusted processes.

Project description

vpod Python SDK

A lightweight, portable sandbox that gives an untrusted process an instant Linux environment. It uses the RISC‑V architecture and runs entirely inside WebAssembly.

  • Fast startup — Boot in under a second.
  • Portable — Runs anywhere without any setup required.
  • Isolated — All execution state stays inside the WASM sandbox.

Installation

pip install vpod

Usage

Shell commands (stateless)

Each call gets a fresh VM — no shared state:

from vpod import Sandbox

sbx = Sandbox.create()
result = sbx.commands.run("echo hello")
print(result.stdout)    # hello
print(result.exit_code) # 0

Persistent session

All calls share the same running VM:

from vpod import Sandbox

with Sandbox.create() as sbx:
    sbx.commands.run("export Foo=Bar")
    sbx.commands.run("touch /tmp/data.csv")

    result = sbx.commands.run("echo $Foo")
    print(result.stdout)  # Bar

Python REPL

Run Python code with persistent state across calls:

from vpod import Sandbox

with Sandbox.create() as sbx:
    sbx.code.run("import requests")
    sbx.code.run("data = [1, 2, 3]")
    result = sbx.code.run("print(sum(data))")
    print(result.text)  # 6

Variables and imports persist for the lifetime of the session.

Snapshots

The first call to Sandbox.create() downloads the VM snapshot (~50MB) and caches it locally at ~/.local/share/vpod/snapshots/. Subsequent calls use the cache instantly.

To pre-download (e.g. in a Dockerfile or CI setup):

from vpod import snapshots

for s in snapshots.fetch_registry():
    print(s["name"], s["tag"])

path = snapshots.pull("alpine:latest")

How it works

A vpod runs a RISC‑V virtual machine compiled to WebAssembly. The core implements the RV64GCV specification:

  • G (General-purpose): I/M/A/F/D extensions for integer, multiply/divide, atomics, and floating-point
  • C (Compressed): 30% smaller code size, improving memory efficiency
  • V (Vector): SIMD operations for parallel data processing

The WASM component communicates with the host through WASI 0.2, providing controlled access to networking and I/O while keeping all execution state isolated inside the sandbox.

Limitations

  • Emulation overhead — No hardware acceleration in WASM. CPU-intensive workloads run slower than native.
  • No GPU access — CUDA, Metal, and hardware ML accelerators are not yet available.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vpod-0.0.6.tar.gz (149.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vpod-0.0.6-py3-none-any.whl (149.6 kB view details)

Uploaded Python 3

File details

Details for the file vpod-0.0.6.tar.gz.

File metadata

  • Download URL: vpod-0.0.6.tar.gz
  • Upload date:
  • Size: 149.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for vpod-0.0.6.tar.gz
Algorithm Hash digest
SHA256 2c5a4aee8b397e67cabfd064a663fb1015a1d070c78317e45128a8137a8eb79c
MD5 8e926ec19d03cb7332fdb1d9e08118d7
BLAKE2b-256 8d5d279aa0d8bd68ca6b3dd7c70d2ced71729027d21516955060f308961abfc4

See more details on using hashes here.

File details

Details for the file vpod-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: vpod-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 149.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for vpod-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f1e159e53fe3436cdf0676aa0d38c7f1a890d049e6f3808897d65952f5aa8dd8
MD5 1b0d2284ec0fb04aafea1a1d471c6113
BLAKE2b-256 6db5fe29676f13a3cb97e05fd7fb8c3abfdc8fe683c5cdeeca06826c615fadb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page