Skip to main content
Sandboxes is a cloud-based sandbox API by Nebius that enables secure code execution with Git-like branching capabilities. It is built for AI agents that need to explore multiple execution paths, evaluate outcomes, and backtrack when necessary. Sandboxes combines VM-level isolation with container efficiency, providing a secure environment for executing untrusted code. Unlike traditional containers, Sandboxes supports Git-like branching — fork from any checkpoint, run parallel explorations, and roll back instantly.

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

1

Choose a base state

Start from a preloaded environment, a previously produced checkpoint, or an imported OCI image.
2

Make inputs explicit

Attach the files and runtime assumptions the command needs so the run can be replayed later.
3

Start an execution

Run code inside the sandbox from the chosen state. Long-running work is represented as an operation.
4

Wait for the operation

Poll through the CLI, SDK, or generated client until execution reaches a terminal state.
5

Inspect the resulting checkpoint

Read logs, metrics, files, and artifacts from the state produced by the run.
6

Branch when needed

Fork from any useful checkpoint to try alternatives, compare outcomes, and continue from the best branch.

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