Skip to main content

Agent-native sandbox service. Run code, build projects, deploy environments.

Project description

Treadstone

Agent-Native sandbox. Run code, build projects, deploy environments.

[!NOTE] Treadstone is in early development. The vision and CLI examples below reflect the direction we are building toward — not all features are implemented yet. See Status for what works today.

Why Treadstone?

AI agents need isolated environments to execute code, install packages, run tests, and build software. Existing sandbox solutions are either designed for human developers to self-host (requiring a Kubernetes cluster and significant ops work) or locked behind proprietary APIs with no self-deploy option.

Treadstone takes a different approach: an agent-native sandbox service that agents interact with directly via CLI and SDK, while remaining fully open source and self-hostable.

Self-host sandbox platforms Proprietary sandbox APIs Treadstone
Audience Developers building platforms Developers integrating SDKs AI agents operating autonomously
Setup Deploy K8s + controllers + CRDs Sign up for API key treadstone run "print('hello')"
Self-host Yes No Yes
Managed option No Yes Yes
Multi-tenant Build it yourself Built-in Built-in

Quick Start

Install

pip install git+https://github.com/earayu/treadstone.git

CLI

# Register and get an API key
treadstone auth register --email you@example.com --password YourPass123!
treadstone auth login --email you@example.com --password YourPass123!
treadstone api-keys create --name my-key

# Set your API key
export TREADSTONE_API_KEY="sk-..."
export TREADSTONE_BASE_URL="http://localhost:8000"

# List available templates
treadstone templates list

# Create a sandbox
treadstone sandboxes create --template aio-sandbox-tiny --name my-sandbox

# List and inspect sandboxes
treadstone sandboxes list
treadstone sandboxes get <sandbox_id>

# Create a persistent sandbox with storage
treadstone sandboxes create --template aio-sandbox-large --persist --storage-size 20Gi

# Lifecycle management
treadstone sandboxes stop <sandbox_id>
treadstone sandboxes start <sandbox_id>
treadstone sandboxes delete <sandbox_id>

# All commands support JSON output for automation
treadstone --json sandboxes list

Python SDK

from treadstone_sdk import Client

client = Client(base_url="http://localhost:8000")

# All API operations are available as typed methods
# See sdk/python/ for the full generated SDK

Sandbox Templates

Treadstone ships with five built-in size tiers — all powered by the same AIO (All-in-One) image with different resource allocations. No ecosystem to maintain, no marketplace to curate.

Template CPU Memory Use Case
aio-sandbox-tiny 0.25 core 512 Mi Code execution, script running
aio-sandbox-small 0.5 core 1 Gi Simple development tasks
aio-sandbox-medium 1 core 2 Gi General-purpose development
aio-sandbox-large 2 cores 4 Gi Full-featured + browser automation
aio-sandbox-xlarge 4 cores 8 Gi Heavy workloads
# Quick code execution (ephemeral, WarmPool-accelerated)
treadstone run --template aio-sandbox-tiny "import math; print(math.pi)"

# Full development environment with persistent storage
treadstone create --template aio-sandbox-large --persist --storage 20Gi

Architecture

┌──────────────────────────────────────────────────────┐
│  CLI / Python SDK / REST API                         │
├──────────────────────────────────────────────────────┤
│  Platform Service Layer          (Treadstone)        │
│  Auth · API Keys · RBAC · Rate Limiting · Billing    │
├──────────────────────────────────────────────────────┤
│  Orchestration Layer                                 │
│  Kubernetes · agent-sandbox CRD · WarmPool           │
├──────────────────────────────────────────────────────┤
│  Sandbox Runtime Layer                               │
│  Container · gVisor Isolation · Persistent Volumes   │
└──────────────────────────────────────────────────────┘

Platform Service Layer — Authentication, multi-tenancy, API key management, rate limiting, and usage metering. This is what turns an open-source sandbox runtime into a production-ready service.

Orchestration Layer — Kubernetes-native scheduling via agent-sandbox CRDs with warm pool pre-provisioning for fast startup.

Sandbox Runtime Layer — Isolated container execution with gVisor secure runtime. Supports both ephemeral (no storage) and persistent (PVC-backed) sandbox modes.

Tech Stack

Component Technology
Backend Python 3.12+, FastAPI, SQLAlchemy (async), asyncpg
Database Neon Serverless PostgreSQL
Orchestration Kubernetes, agent-sandbox CRD
Isolation gVisor (K8s RuntimeClass)
Runtime agent-infra/sandbox
Package manager uv
CI/CD GitHub Actions → GHCR

Status

Treadstone is under active development. Here is what works today and what is coming next.

Phase Scope Status
Phase 1 User auth (JWT, OAuth, API keys), RBAC, invitation system Done
Phase 2 Sandbox CRUD, lifecycle management, K8s sync, HTTP proxy, subdomain routing Done
Phase 3 CLI, Python SDK, agent-facing developer experience Done
Phase 4 Usage metering, billing (Stripe), quotas Planned
Phase 5 Managed hosting, production hardening, monitoring Planned

Design documents and implementation plans are available in the docs/ directory.

Development

make help             # Show all available commands
make dev              # Start local dev server (hot reload)
make test             # Run tests
make lint             # Lint check
make format           # Auto-format
make migrate          # Run database migrations
make migration MSG=x  # Generate a new migration
make build            # Build Docker image
make up               # Spin up local Kind cluster + deploy
make down             # Tear down local environment

License

Apache License 2.0

Project details


Download files

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

Source Distribution

treadstone-0.2.0.tar.gz (337.3 kB view details)

Uploaded Source

Built Distribution

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

treadstone-0.2.0-py3-none-any.whl (54.7 kB view details)

Uploaded Python 3

File details

Details for the file treadstone-0.2.0.tar.gz.

File metadata

  • Download URL: treadstone-0.2.0.tar.gz
  • Upload date:
  • Size: 337.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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 treadstone-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dde69cb4002470ee08c1a5e28839d2094fa7d924db37c946fc964d7ad4b31b28
MD5 dbf8479472bd1b4811439d209b3b59c9
BLAKE2b-256 0a93904bb124b412ccb1b0b8a948244df90cfa6a953ec72a864846f336346e26

See more details on using hashes here.

File details

Details for the file treadstone-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: treadstone-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 54.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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 treadstone-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 621024f8b107e763ca05e19830eb6cd5ca67e190bb7e9fd95e625f2591cff43b
MD5 bb092707ee746e8169074ec0554f6fcc
BLAKE2b-256 baee5a3b71a242e244d00c2196026a543880d196f7f4dc75d1b46a2683427661

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