Quicksand
An async Python API to launch, control, and snapshot QEMU virtual machines, focused on sandboxing AI agents.
At a Glance
About Quicksand
Quicksand is an open-source project from Microsoft that provides an async Python API for launching, controlling, and snapshotting QEMU virtual machines, with a particular focus on sandboxing AI agents. It ships pre-built Ubuntu and Alpine Linux images and supports x86_64 and ARM64 on macOS, Linux, and Windows. The latest GitHub release listed is quick-sandbox v0.13.1.
What It Is
Quicksand is a Python library and CLI for running real virtual machines as disposable sandboxes. Each sandbox is a full VM with its own kernel, started from Python via an async context manager. Running sandboxes needs no root privileges and no Docker, and the QEMU and image extras can be installed through pip for a bundled runtime on supported platforms.
Workflow and Capabilities
A typical workflow installs the package with QEMU and an image extra, then opens a Sandbox and calls execute() to run shell commands and receive stdout, stderr, and exit code. Host directories can be mounted into the VM at boot or on the fly using CIFS or 9p. Guest OS users can be created so multiple agents get independent accounts inside a single VM, and stdin can be streamed to commands.
State management includes saving a VM's disk state to a directory and loading it later, as well as checkpointing full VM state and reverting if an operation goes wrong. Desktop images provide an Xfce4 environment with a browser, and the API supports screenshots, typing text, key presses, and mouse movement and clicks.
Networking and Images
Sandboxes are network-isolated by default, with opt-in modes for mounts-only or full internet access. Port forwards work in both directions, so a guest port can be exposed on the host or a host service can be reached from the guest. Available images include headless Ubuntu 24.04 and Alpine 3.23, desktop overlays for each, an agent image with Python 3.12 and common tooling, and a computer-use image adding Xvfb, VNC, noVNC, Playwright, and Chromium.
Community Discussions
Be the first to start a conversation about Quicksand
Share your experience with Quicksand, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Quicksand core Python library is released under the MIT License, free to use, copy, modify, and distribute.
- Async Python API to launch, control, and snapshot QEMU VMs
- Run commands, file mounts, save/rollback, desktop control, network isolation
- No root, no Docker, no cloud account required
- Cross-platform: macOS, Linux, Windows
Capabilities
Key Features
- Async Python API for QEMU virtual machines
- Run shell commands with stdout, stderr, and exit code
- Streaming stdin to commands
- Multiple guest Linux users per sandbox
- Host directory mounts at boot or dynamically (CIFS and 9p)
- Save and load VM disk state
- Checkpoint and revert of full VM state
- Desktop control: screenshots, typing, key presses, mouse
- Network isolation by default with optional full access
- Bidirectional port forwarding
- Pre-built Ubuntu and Alpine images
- No root or Docker required
- Cross-platform with x86_64 and ARM64 support
