Skip to main content

Quicksand Core

This package provides the core implementation for the quicksand VM harness.

It includes the abstractions for running VMs that AI agents can interact with, including command execution, file operations, and state checkpointing. Most users should install quick-sandbox with QEMU and image extras instead.

Installation

For most users, install the main package:

pip install 'quick-sandbox[qemu,ubuntu]'

For core-only (no bundled images):

pip install quicksand-core

Core Exports

This package exports the core building blocks:

from quicksand_core import (
    # Main classes
    Sandbox,
    SandboxUser,
    Mount,
    ExecuteResult,
    # Save support
    SaveManifest,
    # Image resolution
    ResolvedImage,
    # Runtime management
    get_runtime,
    RuntimeInfo,
    is_runtime_available,
    # Accelerator detection
    get_accelerator,
    detect_accelerator,
    AcceleratorStatus,
    Accelerator,
    # Platform configuration
    get_platform_config,
    PlatformConfig,
    # Architecture/OS types
    Architecture,
    MachineType,
    OS,
)

Usage with Custom Image

import asyncio
from quicksand_core import Sandbox

async def main():
    async with Sandbox(image="your-image-name", memory="1G", cpus=2) as sb:
        result = await sb.execute("cat /etc/os-release")
        print(result.stdout)

asyncio.run(main())

Features

  • Real VM isolation: Hypervisor-level isolation (KVM, HVF, WHPX)
  • Cross-platform: Linux, macOS, Windows
  • Streaming commands: Incremental stdin and output, with backpressure, EOF, and cancellation
  • Guest users: Create/delete OS accounts and run commands with user-specific identity and home directories inside one VM
  • Platform abstraction: Automatic detection of accelerators and machine types
  • Save and load: Save VM disk state to a directory and load it on any machine
  • File sharing: CIFS mounts via quicksand-smb (pure-Python SMB3 server — a subprocess via QEMU guestfwd on macOS/Linux, an in-process loopback TCP listener on Windows with no admin rights required)
  • Performance optimizations:
    • io_uring disk AIO (~50% lower latency on Linux)
    • IOThreads for better concurrent disk I/O (all platforms)

Streaming stdin and guest-user APIs require quicksand-ubuntu or quicksand-alpine 0.10.0 or newer, or a custom image rebuilt with the updated guest agent. Updating the host package does not update saved guest images.

For Most Users

Install quick-sandbox with a bundled image for zero-configuration usage:

pip install 'quick-sandbox[qemu,ubuntu]'
import asyncio
from quicksand import UbuntuSandbox

async def main():
    async with UbuntuSandbox() as sb:
        result = await sb.execute("ls -la /")
        print(result.stdout)

asyncio.run(main())

License

MIT

Metadata

Release files for quicksand-core 0.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for quicksand-core 0.14.0
File Interpreter ABI Platform
quicksand_core-0.14.0-py3-none-any.whl Python 3 none any Details

Release files / quicksand_core-0.14.0-py3-none-any.whl

Download URL quicksand_core-0.14.0-py3-none-any.whl
Size 91.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3a18ff38ab88534e8d43b47e2e8ca7f66e72ead1f9cf58d342d30dfc5469126
BLAKE2b-256 checksum
How to use checksums
6edbfe4c5dd3674bb0b29e6c9840b200ac735b3b9711b2e77372e6fc9cd4bdbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page