SmolVM
SmolVM gives your app or AI agent a private sandbox to run code safely. You can execute shell commands, start a real browser, or let a language model drive a full desktop — all inside an isolated environment that never touches your host machine. SmolVM is available as a Python SDK and a CLI. Sandboxes spin up in under a second and clean themselves up when you are done.What you can do
Run code safely
Execute shell commands or scripts in a clean sandbox instead of on your host machine
Start a browser
Launch a real Chromium session you can automate with Playwright or watch live through noVNC
Power your agents
Plug SmolVM into any agent framework — Agentor, PydanticAI, OpenAI Agents, LangChain, and more
Quick example
with block handles the full lifecycle: it creates the sandbox when you enter and tears it down when you exit.
Where to start
| What you want to do | Where to go |
|---|---|
| Run your first sandbox | Quickstart |
| Build an agent with a sandboxed shell | AI agent integration |
| Start a disposable browser session | Browser sessions |
| Let a model click and type on websites | Computer-use with OpenAI |
| Pass configuration into a sandbox | Environment variables |
| Save and restore sandbox state | Snapshots |
SDK or CLI?
Use the SDK when SmolVM is part of your application or agent loop and you need to create sandboxes from Python code. Use the CLI when you want to manage sandboxes from the terminal, start a browser session, or script local workflows:Start a browser from the CLI
You can launch an isolated browser session directly from the terminal. This is useful for quick testing, scripting, or handing the CDP endpoint to an external tool.session_id and local browser URLs. Use the session ID to manage the session:
cdp_url in the response can be passed to any Chrome DevTools Protocol client. For example, the PydanticAI agent-browser integration extracts the localhost port from that URL and hands it to agent-browser --cdp.
To open the live browser view in your default browser:
How isolation works
Each sandbox runs inside its own virtual machine, completely separated from your host. On Linux, SmolVM uses Firecracker — lightweight microVMs backed by KVM hardware virtualization. On macOS it uses QEMU. Unlike containers, which share the host kernel, microVMs give every sandbox its own kernel. An escape would require a hypervisor exploit, not just a kernel vulnerability. You get the convenience of a simple Python API, but every command runs in its own isolated environment.Performance
Typical lifecycle timings (p50) on a standard Linux host:| Phase | Time |
|---|---|
| Create + Start | ~572ms |
| SSH ready | ~2.1s |
| Command execution | ~43ms |
| Stop + Delete | ~751ms |
| Full lifecycle (boot, run, teardown) | ~3.5s |
Measured on AMD Ryzen 7 7800X3D (8C/16T), Ubuntu Linux, KVM/Firecracker backend.
Get started
Quickstart
Set up SmolVM and run your first sandbox in minutes
Installation
Detailed installation instructions for Linux and macOS
AI agent integration
Plug SmolVM into PydanticAI, OpenAI Agents, LangChain, and more
API reference
Explore the complete API documentation