AIToday

Microsoft releases Quicksand: Python API to sandbox AI agents via QEMU

Hacker News1h agoSend on LINE
Microsoft releases Quicksand: Python API to sandbox AI agents via QEMU

Key takeaway

Microsoft has released Quicksand, a Python API for sandboxing AI agents using QEMU virtual machines without Docker or complex setup. The tool runs on macOS, Linux, and Windows, supports checkpointing and rollback, and includes pre-built images for headless and graphical environments—letting developers isolate and control agent execution with a single pip install.

Summaries like this, in your inbox every morning.

Sign up free →

3 Key Points

  • What happened

    Microsoft has released Quicksand, an async Python library that launches and controls QEMU virtual machines for sandboxing AI agents. It runs on x86_64 and ARM64 across macOS, Linux, and Windows without requiring Docker, WSL, root privileges, or system dependencies—users can install it with a single pip command.

  • Why it matters

    AI developers need isolated execution environments to safely run agents. Quicksand removes friction by eliminating Docker and system-level setup overhead, making sandboxing accessible to Python developers who want to snapshot, checkpoint, and roll back agent workloads without complex infrastructure.

  • What to watch

    The library ships with five pre-built images (ubuntu, alpine, ubuntu-desktop, alpine-desktop, and quicksand-agent) ranging from ~78 MB to ~445 MB. It supports desktop control via Xfce4, network isolation by default with opt-in full internet access, and persistent state snapshots that can be loaded on different machines.

In Depth

Quicksand is an async Python library published by Microsoft for launching, controlling, and snapshotting QEMU virtual machines, with a specific focus on sandboxing AI agents. Installation is minimal: a single pip install 'quick-sandbox[qemu,alpine]' command handles everything, with no Docker, system dependencies, or root privileges required. The library runs on x86_64 and ARM64 processors and is compatible with macOS, Linux, and Windows.

Usage is straightforward. Developers import the Sandbox class, boot an image (e.g., ubuntu or alpine), and control it via async methods. The basic pattern is async with Sandbox(image="ubuntu") as sb:, followed by sb.execute() to run commands, sb.mount() to share host directories, and sb.screenshot() or sb.type_text() to control a graphical desktop if enabled. Results include stdout, stderr, and exit codes. Sandboxes are network-isolated by default; developers opt in to internet and port forwarding via NetworkMode.FULL and PortForward() configuration.

The library ships with five pre-built images. Base images are ubuntu (~341 MB, Ubuntu 24.04 headless) and alpine (~78 MB, Alpine 3.23 headless for faster boot). Overlay images add graphical environments: ubuntu-desktop (~263 MB) and alpine-desktop (~310 MB) both include Xfce4 and a browser (Firefox or Chromium). A specialized quicksand-agent image (~304 MB) provides Ubuntu with Python 3.12, uv, build-essential, requests, pyyaml, ddgs, and markitdown. The quicksand-cua image (~445 MB) extends quicksand-agent with Xvfb, x11vnc, noVNC, Playwright, and Chromium for advanced browser automation.

Key features include persistent snapshots (await sb.save("my-env") saves disk state and can be reloaded on a different machine), checkpointing and rollback (await sb.checkpoint("before-experiment") followed by await sb.revert() to undo risky changes), and desktop control (enable_display=True activates VNC and allows screenshots, keyboard input, and mouse control). Configuration options cover memory (default 512M), CPU cores (default 1), disk size, and port forwarding. The library is open-source; the full source code is available on GitHub at https://github.com/microsoft/quicksand with guides for installation, usage, and extending functionality.

Context & Analysis

Quicksand addresses a concrete pain point for AI agent developers: the need to safely execute untrusted or experimental code in isolation. By wrapping QEMU with a Python async API, Microsoft eliminates the typical barriers to VM-based sandboxing—no Docker daemon, no WSL layer, no root privileges. The library's pre-built images (ranging from Alpine at ~78 MB for fast boot to a full agent stack at ~445 MB) and snapshot/checkpoint capabilities make it possible to prototype, test, and roll back agent behavior without managing infrastructure.

The tool's flexibility—supporting both headless and desktop images, file mounts, port forwarding, and cross-machine snapshot restoration—suggests it is designed for both development workflows (where agents may need GUI access or browser control) and production-like scenarios (where state must be preserved and migrated). Network isolation by default aligns with security-first design; opt-in FULL mode lets developers test internet-dependent behaviors when needed.

FAQ

How do I install Quicksand?
Install with pip install 'quick-sandbox[qemu,alpine]' for a full setup, or pip install quick-sandbox followed by quicksand install qemu alpine to add QEMU and images separately.
What platforms and architectures does Quicksand support?
Quicksand works on x86_64 and ARM64 across macOS, Linux, and Windows with no root privileges required.
Can I save and restore a sandbox environment?
Yes. You can save the VM's disk state to a directory with await sb.save("my-env") and load it later on the same or a different machine, or use checkpoints to capture full VM state and revert if something goes wrong.
Are sandboxes network-isolated by default?
Yes, sandboxes are network-isolated by default. You can opt in to internet access and port forwarding by setting network_mode=NetworkMode.FULL.

Get the latest Large Language Models news every morning

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · takes 30 seconds · unsubscribe anytime

Discussion

No comments yet. Be the first to share your thoughts!

Log in to join the discussion

Related Articles

Stay ahead with AI news

Get curated AI news from 200+ sources delivered daily to your inbox. Free to use.

Get Started Free

Free · takes 30 seconds · unsubscribe anytime