superradcompany/microsandbox

🧱 Easy fast local-first microVM runtime and library

microsandbox – Fast, local micro‑VMs for untrusted code

What it is – microsandbox is a lightweight runtime that lets you spin up hardware‑isolated micro‑virtual‑machines (microVMs) on your own laptop or server. It’s built for running untrusted workloads – AI agents, user‑provided scripts, CI jobs, browser automation, etc. – with Docker‑like ergonomics but without needing a long‑running daemon or a full container engine.

Why it matters for AI – Many modern AI agents need a safe place to execute arbitrary code (e.g., a coding assistant that runs user snippets, a web‑scraper, or a tool that builds and tests code). microsandbox gives those agents a fast, hardware‑isolated sandbox that starts in < 100 ms, can be controlled from any language, and guarantees that secrets never leave the host.


Key Features (as described in the README)

Feature What it means
Hardware Isolation Uses microVM technology (KVM on Linux, WHP on Windows, Apple‑Silicon hypervisor) to give VM‑level security without the overhead of full VMs.
Cross‑platform Runs on macOS (Apple Silicon), Linux (KVM), and Windows (WHP).
OCI‑compatible images Pulls any standard container image from Docker Hub, GHCR, or any OCI registry and runs it inside a microVM.
Docker‑like workflow Same concepts as Docker – images, commands, volumes, named containers – so the learning curve is tiny.
Instant startup Typical boot time under 100 ms, making it practical for per‑request sandboxing.
Embeddable SDK Available for TypeScript, Rust, Python, Ruby, and Go; you can create and control sandboxes directly from your application code.
Secrets that can’t leak Secrets are injected via the runtime without ever being written into the VM’s filesystem.
Long‑running & detached mode Sandboxes can stay alive after the CLI exits, enabling persistent sessions or workers.
Agent‑ready Provides “Agent Skills” and an MCP server so AI agents can request sandbox creation, command execution, and monitoring via structured tool calls.

Getting started (quick‑start)

  1. Install the SDK – pick the language you use:
    npm i microsandbox          # TypeScript/JavaScript
    cargo add microsandbox      # Rust
    uv add microsandbox         # Python
    go get github.com/superradcompany/microsandbox/sdk/go  # Go
    
  2. Install the CLI (optional but handy):
    npx microsandbox run debian          # one‑off run
    # or install the persistent command
    curl -fsSL https://install.microsandbox.dev | sh   # macOS/Linux
    irm https://install.microsandbox.dev/windows | iex   # Windows
    
  3. Run a command
    msb run python -- python -c "print('Hello from a microVM!')"
    
  4. Use the SDK – example in TypeScript:
    import { Sandbox } from "microsandbox";
    const sandbox = await Sandbox.builder("demo")
        .image("python")
        .cpus(1)
        .memory(512)
        .create();
    const out = await sandbox.exec("python", ["-c", "print('hi')"]);
    console.log(out.stdout());
    
    (Similar snippets are provided for Rust, Python, Ruby, and Go.)

Typical use‑cases for AI / automation

  • AI coding agents – give a LLM a private workspace where it can compile, run tests, or invoke git. The agent never touches the host filesystem.
  • Browser automation – run Playwright or Selenium inside a sandbox, keeping any malicious page content isolated.
  • CI/CD runners – each GitHub Actions job can be executed in a fresh microVM, reducing “dirty” state between runs.
  • Data‑migration rehearsal – spin up a sandboxed copy of a database, apply migrations, and verify results before touching production.
  • Plugin execution – safely evaluate third‑party plugins or user‑provided scripts for platforms that expose extensibility.

Ecosystem & community

  • Agent integrations – Vercel’s Eve framework, LangChain‑microsandbox, Smithers, and many others ship microsandbox as their sandbox backend.
  • Tools built on toph5i (secure browser for agents), devsy (devcontainer deployment), openwork (Claude‑style coworking UI).
  • Showcase repos – Awesome‑microsandbox list, example projects for Docker‑in‑sandbox, warm workers, GitHub Actions runner, etc.
  • Support – Discord community, extensive docs, and contribution guides.

License & maturity

  • Licensed under Apache 2.0.
  • Marked as beta – expect breaking changes and missing features, but the core functionality (booting a microVM, executing commands, SDK bindings) is stable.

TL;DR

microsandbox lets developers and AI agents run arbitrary code in a secure, hardware‑isolated micro‑VM that starts in milliseconds. It works on all major OSes, supports any OCI image, and provides SDKs for the most common languages, making it a practical building block for safe AI‑driven automation and tooling.

Related

  • Project
  • Project
  • Project
  • Project
  • Project