SuperAPI AI Directory

microsandbox

microsandbox is an easy-to-use, fast, programmable, local-first microVM (micro virtual machine) runtime and library for running untrusted workloads in hardware-isolated, lightweight micro virtual machines, such as AI agents, user code, plugins, CI tasks, development environments, crawlers, and automation scripts. It provides hardware-level isolation, supports forking and snapshotting of live sandboxes, cross-platform operation (Linux, macOS, Windows), compatibility with OCI container images, Docker-like workflows, an average startup time of under 100 milliseconds, and can launch VMs directly embedded in code without configuring a server or running a persistent daemon. Secrets never enter the VM, and sandboxes can run in the background for long periods. It also provides Agent Skills and an MCP server, enabling AI agents to create sandboxes on their own. It is currently in beta and may have breaking changes and missing features.

Open website

About this tool

microsandbox is a local-first microVM runtime and library for running untrusted workloads in fast, isolated micro virtual machines. Its target scenarios include AI agents, user code, plugins, CI jobs, development environments, crawlers, and automation tasks.

Key capabilities:

  • Hardware isolation: Provides hardware-level isolation using extremely small virtual machines.
  • Fork and snapshot: Can fork running sandboxes, save running state, and restore it later; provides a --cow-mem option to share unchanged memory; snapshot generations describe the advancement process, and branches describe different historical paths; the old --forked restore flag is still retained as a deprecated alias.
  • Cross-platform: Can run on Linux, macOS, and Windows.
  • OCI compatible: Can run standard container images from Docker Hub, GHCR, or any OCI registry.
  • Docker-like workflow: Provides familiar image, command, shell, and volume workflows.
  • Instant startup: Average startup time is under 100 milliseconds (this figure refers to guest startup time on an M1 machine).
  • Embeddable: Spawn VMs directly in code, with no need to set up a server or a long-running daemon.
  • Secrets cannot leak: Secret keys never enter the VM and cannot be exploited.
  • Long-running: Sandboxes can run in detached background mode, suitable for long sessions.
  • Agent-oriented: Through Agent Skills and an MCP server, AI agents can create sandboxes on their own.

Usage: After installation, you can create a sandbox. Runtime requirements: macOS requires Apple Silicon; Linux requires KVM enabled; Windows requires WHP enabled. Note: Microsandbox is still beta software, and breaking changes, missing features, and rough edges are expected. The msb CLI provides a complete interface for managing sandboxes, snapshots, images, and volumes. Run msb --help to view the quick help menu; run msb --tree to view the complete command hierarchy and descriptions; run msb <command> --tree to view a specific command tree. The SDK allows sandboxes to be created and controlled directly within applications. Sandbox.builder("...").create() will, as a subprocessStart a microVM without any infrastructure. See the Ruby SDK guide for installation, lifecycle, networking, and backend details. On the first call to create(), if the image is not cached locally, it will pull the image, so the time taken may vary depending on connection speed; subsequent runs reuse the cache.

Practical use case examples:

  • Docker in a sandbox: Run Docker without touching the host daemon.
  • OpenCode: Provide isolated project workspaces for coding agents.
  • Browser Use: Run AI browser agents inside a microVM.
  • Playwright: Run headless browser tasks inside a microVM.
  • Warm Workers: Snapshot a toolchain and start clean workers.
  • Migration rehearsal: Test a database migration and then restore to baseline.
  • GitHub Actions Runner: Run each self-hosted job in a disposable microVM.
  • Document to PDF: Convert untrusted documents in a fresh offline worker.

Community showcase:

  • Eve by Vercel: An agent framework that uses microsandbox as its sandbox backend.
  • Agentic Coding Quickstart by U.S. GSA: From zero to running an AI coding agent.
  • Condukt and Once by Tuist: An Elixir agent engine, and cacheable operations running in fresh sandboxes.
  • langchain-microsandbox by kenwoodjw: A Microsandbox integration for LangChain Deep Agents.
  • Smithers by Smithers: Agent workflows with full observability, fallback, fork, and replay.
  • AgentConnect: Bring multiple AI agents into a team's chat, issues, and pull requests.
  • wrap by Tobi Lütke: Run coding agents and project commands in an isolated Arch Linux microVM.
  • Agent VM by Wiren Board: Run AI agents in a secure VM confined to local folders.
  • h5i by h5i: Written in pure Rust,a secure and auditable AI agent browser.
  • Devsy by Devsy: Deploy devcontainers to any cloud, Kubernetes cluster, or Docker host.
  • OpenWork by Different AI: An open-source Claude Cowork alternative with a microsandbox image.
  • Awesome Microsandbox by ya-luotao: A curated list of SDKs, integrations, tools, and resources.
  • msb-omarchy by ya-luotao: Run the Omarchy desktop environment inside a microVM on Apple Silicon.

Agent integrations: By installing Agent Skills, you can teach any AI coding agent to use microsandbox, with support for Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot, and more. Through the MCP server, you can connect any MCP-compatible agent to microsandbox, providing structured tool calls for sandbox lifecycle, command execution, filesystem access, volumes, and monitoring.

Docs and contributions: For guides, API references, and examples, visit the microsandbox docs. Contribution guidelines are in CONTRIBUTING.md, and build, test, and release instructions are in DEVELOPMENT.md. The project is licensed under the Apache License 2.0. Special thanks to all contributors, testers, and community members, as well as projects such as libkrun and smoltcp. There are also demos showcasing VM suspend/resume, snapshots, and fork: Mario Never Dies and Multiverse of Madness.

Limitations: This is currently beta software, so expect breaking changes, missing features, and rough edges.