{"slug": "microsoft-quicksand-sandbox-your-ai-agent-without-docker-or-wsl", "title": "Microsoft Quicksand: Sandbox your AI agent without Docker or WSL", "summary": "Microsoft has released Quicksand, an async Python API for launching, controlling, and snapshotting QEMU virtual machines designed to sandbox AI agents without requiring Docker, WSL, or root privileges. The tool provides pre-built Linux VMs for Ubuntu and Alpine distros, supports x86_64 and ARM64 across macOS, Linux, and Windows, and can be installed via pip. Quicksand offers features such as network isolation, disk state saving, checkpointing, and desktop images with graphical environments.", "body_md": "Quicksand is an async Python API to launch, control, and snapshot [QEMU](https://www.qemu.org) virtual machines with a particular focus on sandboxing AI agents. Quicksand provides pre-built Linux VMs for Ubuntu and Alpine distros. It works on x86_64 and ARM64 across macOS, Linux, and Windows with no root privileges, no Docker, and no system dependencies. Just `pip install quick-sandbox`\n\n.\n\n```\npip install 'quick-sandbox[qemu,alpine]'\n```\n\nOr install the core package and add QEMU/images separately:\n\n```\npip install quick-sandbox\nquicksand install qemu alpine\npython\nimport asyncio\nfrom quicksand import Sandbox\n\nasync def main():\n    async with Sandbox(image=\"ubuntu\") as sb:\n        result = await sb.execute(\"echo 'Hello from the sandbox!'\")\n        print(result.stdout)\n\nasyncio.run(main())\nresult = await sb.execute(\"apt update && apt install -y python3\")\nprint(result.stdout, result.exit_code)\n```\n\nShare host directories into the VM at boot or on the fly.\n\n```\n# At boot\nasync with Sandbox(\n    image=\"ubuntu\",\n    mounts=[Mount(\"./workspace\", \"/mnt/workspace\")],\n) as sb:\n    ...\n\n# Or dynamically on a running sandbox\nhandle = await sb.mount(\"/tmp/data\", \"/mnt/data\")\nawait sb.execute(\"ls /mnt/data\")\nawait sb.unmount(handle)\n```\n\nSandboxes are network-isolated by default. Opt in to internet access and port forwarding with `NetworkMode.FULL`\n\n.\n\n```\nasync with Sandbox(\n    image=\"ubuntu\",\n    network_mode=NetworkMode.FULL,\n    port_forwards=[PortForward(host=8080, guest=80)],\n) as sb:\n    ...\n```\n\nSave the VM's disk state to a directory. Load it later, even on a different machine.\n\n```\nawait sb.execute(\"pip install numpy pandas\")\nawait sb.save(\"my-env\")  # VM keeps running\n\n# Load later\nasync with Sandbox(image=\"my-env\") as sb:\n    await sb.execute(\"python3 -c 'import numpy; print(numpy.__version__)'\")\n```\n\nCapture the full VM state and roll back if something goes wrong.\n\n```\nawait sb.checkpoint(\"before-experiment\")\nawait sb.execute(\"apt install -y something-risky\")\nawait sb.revert(\"before-experiment\")  # the VM snaps back to the checkpoint\n```\n\nDesktop images provide a full Xfce4 graphical environment with a browser. Install one with `quicksand install ubuntu-desktop`\n\nor `quicksand install alpine-desktop`\n\n.\n\n```\nasync with Sandbox(image=\"ubuntu-desktop\", enable_display=True) as sb:\n    await sb.screenshot(\"screen.png\")\n    await sb.type_text(\"hello world\")\n    await sb.press_key(Key.RET)\n    await sb.mouse_move(500, 300)\n    await sb.mouse_click(\"left\")\n```\n\nHere are all of the Sandbox configuration options:\n\n```\nSandbox(\n    # Image or save name to boot\n    image=\"ubuntu\",\n    # Guest RAM (default: \"512M\")\n    memory=\"2G\",\n    # Virtual CPU cores (default: 1)\n    cpus=4,\n    # Host directories shared into the VM at boot\n    mounts=[Mount(\"/host\", \"/guest\")],\n    # NONE, MOUNTS_ONLY (default), or FULL internet access\n    network_mode=NetworkMode.FULL,\n    # Forward host TCP ports into the guest\n    port_forwards=[PortForward(host=8080, guest=80)],\n    # Expand the guest filesystem on boot\n    disk_size=\"10G\",\n    # Attach virtual GPU, keyboard, and mouse for screenshot/type_text/mouse control\n    enable_display=True,\n    # Auto-save VM state on stop\n    save=\"my-save-name\",\n)\n```\n\n| Image | Type | Wheel size | Install command | What is it |\n|---|---|---|---|---|\n`ubuntu` |\nBase | ~341 MB | `quicksand install ubuntu` |\nUbuntu 24.04 headless |\n`alpine` |\nBase | ~78 MB | `quicksand install alpine` |\nAlpine 3.23 headless (faster boot) |\n`ubuntu-desktop` |\nOverlay (`ubuntu` ) |\n~263 MB | `quicksand install ubuntu-desktop` |\nUbuntu 24.04 + Xfce4 + Firefox |\n`alpine-desktop` |\nOverlay (`alpine` ) |\n~310 MB | `quicksand install alpine-desktop` |\nAlpine 3.23 + Xfce4 + Chromium |\n`quicksand-agent` |\nOverlay (`ubuntu` ) |\n~304 MB | `quicksand install quicksand-agent` |\nUbuntu + Python 3.12, uv, build-essential, requests, pyyaml, ddgs, markitdown |\n`quicksand-cua` |\nOverlay (`quicksand-agent` ) |\n~445 MB | `quicksand install quicksand-cua` |\nAgent Sandbox + Xvfb, x11vnc, noVNC, Playwright, Chromium |\n\n```\ngit clone https://github.com/microsoft/quicksand.git\ncd quicksand\nuv sync\nuv run uvr build --all-packages\n```\n\n| Topic | Guide | Under the Hood |\n|---|---|---|\n| Installation |\n|\n\n[QEMU binaries, kernels, qcow2 disks](/microsoft/quicksand/blob/main/docs/under-the-hood/01-installation.md)[Creating and configuring sandboxes](/microsoft/quicksand/blob/main/docs/user-guide/02-sandbox-lifecycle.md)`-m`\n\n, `-smp`\n\n, `-accel`\n\n, machine types`execute()`\n\n, streaming, exit codes[Kernel boot, agent tokens,](/microsoft/quicksand/blob/main/docs/under-the-hood/03-running-commands.md)`hostfwd`\n\n[Mounts, hot-mounts, getting data in/out](/microsoft/quicksand/blob/main/docs/user-guide/04-file-exchange.md)[CIFS via](/microsoft/quicksand/blob/main/docs/under-the-hood/04-file-exchange.md)`guestfwd`\n\n, 9p via `-fsdev`\n\n[Checkpoints, reverts, persistent saves](/microsoft/quicksand/blob/main/docs/user-guide/05-save-and-rollback.md)[qcow2 overlays,](/microsoft/quicksand/blob/main/docs/under-the-hood/05-save-and-rollback.md)`savevm`\n\n, `blockdev-snapshot-sync`\n\n[Screenshots, keyboard, mouse](/microsoft/quicksand/blob/main/docs/user-guide/06-desktop-control.md)[VNC, GPU, USB tablet, QMP input injection](/microsoft/quicksand/blob/main/docs/under-the-hood/06-desktop-control.md)[Network modes, port forwarding](/microsoft/quicksand/blob/main/docs/user-guide/07-network-and-isolation.md)[SLIRP NAT,](/microsoft/quicksand/blob/main/docs/under-the-hood/07-network-and-isolation.md)`restrict=on`\n\n, `guestfwd`\n\n[What makes it fast](/microsoft/quicksand/blob/main/docs/user-guide/08-performance.md)`io_uring`\n\n, IOThreads, TCG vs KVM| Guide | When to use |\n|---|---|\n|\n\n[Extending the Sandbox](/microsoft/quicksand/blob/main/docs/contributor-guide/02-extending-the-sandbox.md)[Testing](/microsoft/quicksand/blob/main/docs/contributor-guide/03-testing.md)[Releasing](/microsoft/quicksand/blob/main/docs/contributor-guide/04-releasing.md)Full guides: [User Guide](/microsoft/quicksand/blob/main/docs/user-guide) | [Under the Hood](/microsoft/quicksand/blob/main/docs/under-the-hood) | [Contributor Guide](/microsoft/quicksand/blob/main/docs/contributor-guide)", "url": "https://wpnews.pro/news/microsoft-quicksand-sandbox-your-ai-agent-without-docker-or-wsl", "canonical_source": "https://github.com/microsoft/quicksand", "published_at": "2026-07-28 12:16:38+00:00", "updated_at": "2026-07-28 12:22:11.680478+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools"], "entities": ["Microsoft", "Quicksand", "QEMU", "Ubuntu", "Alpine", "Linux", "macOS", "Windows"], "alternates": {"html": "https://wpnews.pro/news/microsoft-quicksand-sandbox-your-ai-agent-without-docker-or-wsl", "markdown": "https://wpnews.pro/news/microsoft-quicksand-sandbox-your-ai-agent-without-docker-or-wsl.md", "text": "https://wpnews.pro/news/microsoft-quicksand-sandbox-your-ai-agent-without-docker-or-wsl.txt", "jsonld": "https://wpnews.pro/news/microsoft-quicksand-sandbox-your-ai-agent-without-docker-or-wsl.jsonld"}}