Skip to main content

Core sandbox functionality for the quicksand VM harness.

Project description

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 quicksand instead, which includes pre-built images.

Installation

For most users, install the main package:

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

For core-only (no bundled images):

pip install quick-sandbox

Core Exports

This package exports the core building blocks:

from quicksand_core import (
    # Main classes
    Sandbox,
    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
  • 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, invoked as a subprocess via QEMU guestfwd)
  • Performance optimizations:
    • io_uring disk AIO (~50% lower latency on Linux)
    • IOThreads for better concurrent disk I/O (all platforms)

For Most Users

Install quicksand 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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

quicksand_core-0.11.10-py3-none-any.whl (74.1 kB view details)

Uploaded Python 3

File details

Details for the file quicksand_core-0.11.10-py3-none-any.whl.

File metadata

  • Download URL: quicksand_core-0.11.10-py3-none-any.whl
  • Upload date:
  • Size: 74.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","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}

File hashes

Hashes for quicksand_core-0.11.10-py3-none-any.whl
Algorithm Hash digest
SHA256 3b22e77f52c0d0c77f00c7ef0ae399580cca8e84d283ce643fccd8ee68fe3409
MD5 905e132890d64cc0087f2cfbf6ef5041
BLAKE2b-256 fb7186fb7d2aed10fe59d4cab3ab4b2b9ea3a6e8a50d4ff0c0014b057fb54ccb

See more details on using hashes here.

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