Supports Git operations within sandbox environments for source control management
Offers Node.js execution in isolated microVMs for secure running of untrusted JavaScript code
Enables AI to process data using NumPy in a secure sandbox environment
Allows data analysis with Pandas in a secure sandbox environment for processing spreadsheets and datasets
Provides a secure Python execution environment in isolated microVMs, with support for NumPy, Pandas, and other data analysis libraries
Supports running Rust code in isolated microVMs with SDK integration for secure execution
Provides access to TensorFlow for AI model training and inference within a secure sandbox
Microsandbox
Microsandbox makes it easy to run untrusted workloads within a hardware-isolated and fast startup execution environment.
Running untrusted code securely is hard. Traditional solutions—containers, VMs, or cloud sandboxes—each trade off speed, isolation, or control. Microsandbox aims to give the best of all worlds.
This project is stillexperimental. Expect breaking changes, missing features, and rough edges.
Related MCP server: Sandbox MCP
Key Features
Strong Isolation: Hardware-level VM isolation with microVMs.
Instant Startup: Boot times under 200 ms.
OCI Compatible: Runs standard container images.
Self-Hosted: Deploy within your infrastructure with autonomy.
AI-Ready: Integrates seamlessly with agent and AI workflows via MCP.
Microsandbox is designed to be the execution backbone of the agentic web—fast, secure, and flexible.
Demo
Getting Started
PREREQUISITE
1. Download microsandbox
2. Start the server
3. Pull the environment image [Optional]
BASICS
microsandbox ships with a bunch of flexible commands to make it easy to manage and access sandboxes which are highlighted below
Temporary Sandbox
For experimentation or one-off tasks, temporary sandboxes provide a clean environment that leaves no trace on exit. For example, create a sandbox based on the microsandbox/python image by running:
System-wide Sandboxes
This provides the option to run long-lived sandboxes which are automatically setup as a system-wide executable. This also makes frequently used sandboxes incredibly convenient to access — no need to navigate to specific directories or remember complex commands.
If no alias is specified, the image name is used as the default. In the example above, this will be
python. If a sandbox with similar name exists, an error will be returned.
Run msb <subcommand> --help to see all the options available for a subcommand.
For example, msb add --help.
SDK BETA
1. Install the SDK
See open issues for future language support.
Language | Instruction |
Python |
|
Rust |
|
JavaScript |
|
2. Execute the Code
The first run pulls the environment image, so it’ll take a bit longer. You can pre-pull an image it to make runs instant. For more information on how to use the SDK, refer to the SDK Readme.
Python
JavaScript
Rust
Project Sandbox BETA
Beyond the SDK, microsandbox supports project-based development with the familiar package-manager workflow devs are used to. Think of it like npm or cargo, but for sandboxes!
QUICK DEMO
SETUP GUIDE
1. Create a Sandbox Project
Each sandbox project needs a file, Sandboxfile at the root of the project directory, which serves as the configuration manifest for your sandbox environments. To initialize one, run:
2. Add a Sandbox to the Project
Proceed to register a new python sandbox named app in your Sandboxfile.
3. Inspect Sandboxfile
The newly created sandbox, app should be registered in your Sandboxfile. If there was a pre-existing Sandboxfile, it'd be appended to it. It should be similar to this:
4. Running a Project-Defined Sandbox
Next is to run a sandbox defined in your project. This would execute the default start script of your sandbox. For more control, you can directly specify which script to run e.g. msr app~start.
When running project sandboxes, all file changes and installations made inside the sandbox are automatically persisted to the
./menvdirectory. This means you can stop and restart your sandbox any time without losing your work. Your development environment will be exactly as you left it.
Uninstall
To uninstall microsandbox, run: msb self uninstall. Use the --force flag. This removes the $HOME/.microsandbox directory and all its content, effectively cleaning up all cached microsandbox data such as images, layers, and databases.
Refer to the maintenance docs for other types of cleanups.
Use Cases
Wondering how you can use microsandbox in your next project, see our sample use cases.
Contributing
Interested in contributing to microsandbox? Check out our Development Guide for instructions on setting up your development environment, building the project, running tests, and creating releases. For contribution guidelines, please refer to CONTRIBUTING.md.
License
This project is licensed under the Apache License 2.0.
Ackowledgements
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: The lightweight virtualization library that powers our secure microVM isolation