Are you the author? Sign in to claim
🧱 easy fast local-first microVM library and toolkit
Microsandbox runs untrusted workloads inside fast, local microVMs: AI agents, user code, plugins, CI jobs, dev environments, scrapers, and automation.
hljs language-shcargo add microsandbox # 🦀 Rusthljs language-shuv add microsandbox # 🐍 Pythonhljs language-shnpm i microsandbox # 🟦 TypeScripthljs language-shgo get github.com/superradcompany/microsandbox/sdk/go # 🐹 Go
Boot a microVM in a single command:
hljs language-shnpx microsandbox run debianOr install the
msbcommand globally:hljs language-shcurl -fsSL https://install.microsandbox.dev | sh # 🍎 macOS / 🐧 Linuxhljs language-powershellirm https://install.microsandbox.dev/windows | iex # 🪟 WindowsWe also support other package managers →
hljs language-shbrew install superradcompany/tap/microsandboxhljs language-shnpm i -g microsandboxhljs language-shuv tool install microsandboxhljs language-shcargo install microsandboxThen you can run
msbdirectly:hljs language-shmsb run debian
Requirements:
macOS: Apple Silicon.
Linux: KVM enabled.
Windows: WHP enabled.
Warning: Microsandbox is still beta software. Expect breaking changes, missing features, and rough edges.
The SDK lets you create and control sandboxes directly from your application. Sandbox::builder("...").create() boots a microVM as a child process. No infrastructure required.
hljs language-rsuse microsandbox::Sandbox; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let sandbox = Sandbox::builder("my-sandbox") .image("python") .cpus(1) .memory(512) .create() .await?; let output = sandbox .exec("python", ["-c", "print('Hello from a microVM!')"]) .await?; println!("{}", output.stdout()?); sandbox.stop().await?; Ok(()) }Python Example →
hljs language-pythonimport asyncio from microsandbox import Sandbox async def main(): sandbox = await Sandbox.create( "my-sandbox", image="python", cpus=1, memory=512, ) output = await sandbox.exec("python", ["-c", "print('Hello from a microVM!')"]) print(output.stdout_text) await sandbox.stop() asyncio.run(main())TypeScript Example →
hljs language-typescriptimport { Sandbox } from "microsandbox"; await using sandbox = await Sandbox.builder("my-sandbox") .image("python") .cpus(1) .memory(512) .create(); const output = await sandbox.exec("python", [ "-c", "print('Hello from a microVM!')", ]); console.log(output.stdout());Go Example →
hljs language-gopackage main import ( "context" "fmt" "log" microsandbox "github.com/superradcompany/microsandbox/sdk/go" ) func main() { ctx := context.Background() // Downloads the microsandbox runtime to ~/.microsandbox/ on first run. if err := microsandbox.EnsureInstalled(ctx); err != nil { log.Fatal(err) } sandbox, err := microsandbox.CreateSandbox(ctx, "my-sandbox", microsandbox.WithImage("python"), microsandbox.WithCPUs(1), microsandbox.WithMemory(512), ) if err != nil { log.Fatal(err) } defer sandbox.Stop(ctx) output, err := sandbox.Exec(ctx, "python", []string{"-c", "print('Hello from a microVM!')"}) if err != nil { log.Fatal(err) } fmt.Println(output.Stdout()) }
The first call to
create()pulls the image if it isn't cached locally, so it may take longer depending on your connection. Subsequent runs reuse the cache.
The msb CLI provides a complete interface for managing sandboxes, images, and volumes.
hljs language-shmsb run python -- python3 -c "print('Hello from a microVM!')"
hljs language-sh# Create and start a named sandbox msb create --name app pythonhljs language-sh# Execute commands msb exec app -- python -c "import this" msb exec app -- curl https://example.comhljs language-sh# Lifecycle msb stop app msb start app msb rm app
hljs language-shmsb pull python # Pull an image msb image ls # List cached images msb image rm python # Remove an image
hljs language-shmsb install ubuntu # Install ubuntu sandbox as 'ubuntu' command ubuntu # Opens Ubuntu in a microVM msb uninstall ubuntu # Uninstall the ubuntu sandbox
hljs language-shmsb ls # List all sandboxes msb ps app # Show sandbox status msb inspect app # Detailed sandbox info msb metrics app # Live CPU/memory/network stats
[!TIP]
Run:
·msb --helpfor quick help menu.
·msb --treefor complete command hierarchy and descriptions.
·msb <command> --treefor a specific command tree.
Teach any AI coding agent how to use microsandbox by installing the Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot, and more.
hljs language-shnpx skills add superradcompany/skills
Connect any MCP-compatible agent to microsandbox with the MCP server. Provides structured tool calls for sandbox lifecycle, command execution, filesystem access, volumes, and monitoring.
hljs language-sh# Claude Code claude mcp add --transport stdio microsandbox -- npx -y microsandbox-mcp
For guides, API references, and examples, visit the microsandbox documentation.
Interested in contributing to microsandbox? Check out our CONTRIBUTING.md for guidelines and DEVELOPMENT.md for build, test, and release instructions.
This project is licensed under the Apache License 2.0.
Special thanks to all our contributors, testers, and community members who help make microsandbox better every day! We'd like to thank the following projects and communities that made microsandbox possible: libkrun and smoltcp
Boot time refers to guest boot on an M1 machine. ↩
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows