Treadstone
Agent-Native sandbox. Run code, build projects, deploy environments.
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
Metadata
Release files for treadstone 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| treadstone-0.2.0.tar.gz | 337.3 kB | Without provenance | Details for treadstone-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| treadstone-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for treadstone-0.2.0-py3-none-any.whl |
Total release size: 392.0 kB
Release files / treadstone-0.2.0.tar.gz
| Download URL | treadstone-0.2.0.tar.gz |
|---|---|
| Size | 337.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dde69cb4002470ee08c1a5e28839d2094fa7d924db37c946fc964d7ad4b31b28
|
|
BLAKE2b-256 checksum How to use checksums |
0a93904bb124b412ccb1b0b8a948244df90cfa6a953ec72a864846f336346e26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / treadstone-0.2.0-py3-none-any.whl
| Download URL | treadstone-0.2.0-py3-none-any.whl |
|---|---|
| Size | 54.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
621024f8b107e763ca05e19830eb6cd5ca67e190bb7e9fd95e625f2591cff43b
|
|
BLAKE2b-256 checksum How to use checksums |
baee5a3b71a242e244d00c2196026a543880d196f7f4dc75d1b46a2683427661
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Security for treadstone 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.