Contree SDK
Python SDK for programmatic access to the Sandboxes API.
Contree CLI
Command-line client for sessions, branching, filesystem inspection, and scripting on top of the Sandboxes API.
Contree MCP
Model Context Protocol server for integrating Sandboxes with AI assistants.
Key features
Secure isolation
VM-level isolation ensures untrusted code cannot escape the sandbox or affect other workloads.
Git-like branching
Fork execution state at any checkpoint. Explore multiple solution paths in parallel, then score results and expand the best branches.
Instant rollback
Return to any previous state with a single API call. No need to rebuild or re-execute from scratch.
OCI image support
Import images from any OCI-compliant registry (Docker Hub, GHCR, and others). Use your existing container images as sandbox bases.
Resource metrics
Built-in tracking of CPU time, memory usage, and I/O operations for every execution.
Async operations
All long-running operations (image imports, executions) are async with polling support and cancellation.
Quick start
Choose a base state
Start from a preloaded environment, a previously produced checkpoint, or an imported OCI image.
Make inputs explicit
Attach the files and runtime assumptions the command needs so the run can be replayed later.
Start an execution
Run code inside the sandbox from the chosen state. Long-running work is represented as an operation.
Wait for the operation
Poll through the CLI, SDK, or generated client until execution reaches a terminal state.
Inspect the resulting checkpoint
Read logs, metrics, files, and artifacts from the state produced by the run.
Use cases
AI coding agents
Let AI agents execute and test code safely. Branch to explore multiple approaches, evaluate results, and continue the most promising path.
Research and experimentation
Run experiments in isolated environments. Fork state to test variations without starting over.
Educational platforms
Provide students with safe code execution environments. Automatic cleanup and resource limits help prevent abuse.
CI/CD pipelines
Execute build steps and tests in isolated sandboxes with full resource tracking and artifact retrieval.
Resources
- Sandboxes for SWE agents — Preloaded environments and Hugging Face datasets
- Contree SDK — Python SDK for programmatic access to the Sandboxes API
- Contree CLI — Terminal client for interactive and scripted sandbox workflows
- Contree MCP — Model Context Protocol server for AI assistants