CubeSandbox

Active
GitHub Go NOASSERTION

Description

A high-performance, secure sandbox service for AI agents by Tencent Cloud, built on RustVMM and KVM with hardware-level isolation, sub-60ms cold start, <5MB memory overhead, and E2B SDK compatibility.

Key Features

  • Blazing-fast cold start: sub-60ms end-to-end sandbox creation via resource pool pre-provisioning and snapshot cloning
  • Ultra-low memory overhead: less than 5MB per instance, enabling thousands of sandboxes on a single machine
  • True kernel-level isolation: each agent runs with its own dedicated Guest OS kernel based on RustVMM and KVM
  • E2B SDK drop-in replacement: swap one URL environment variable to migrate from closed-source sandboxes
  • Event-level snapshot and rollback: millisecond-granularity checkpoints with instant clone and rollback via CubeCoW CoW engine
  • Network security via CubeVS eBPF: inter-sandbox network isolation with fine-grained egress traffic filtering

Use Cases

💡 Secure code execution sandbox for AI agents generating and running untrusted LLM-generated code
💡 High-concurrency agent deployment: thousands of isolated sandboxes running simultaneously on a single node
💡 Reinforcement learning environments like SWE-bench with fast sandbox provisioning and reset
💡 Production-grade sandbox service replacing E2B with better performance and lower cost

Strengths & Limitations

Strengths

  • Actively maintained, recent updates
  • High community interest (11.7k stars)

⚠️ Limitations

  • No clear open-source license

Quick Start

pip install cubesandbox

# Single-node deployment:
cubesandbox serve

# Create a sandbox:
import cubesandbox
client = cubesandbox.Client()
sandbox = client.sandboxes.create()
result = sandbox.run_code('print("Hello from CubeSandbox!")')
print(result)

# Cluster mode: see docs at https://docs.cubesandbox.ai/

Related Projects

Sandbox Runtime

5.1k · TypeScript
Active A

An experimental lightweight isolated runtime from Anthropic for executing agent tasks in a sandboxed environment.

sandboxruntimecode-execution
  • · OS-level sandboxing without containers using native primitives (sandbox-exec on macOS, bubblewrap on Linux)
  • · Filesystem isolation with deny-then-allow read patterns and allow-only write patterns
  • · Network isolation via HTTP and SOCKS5 proxy-based domain filtering with allowlists/denylists

code-sandbox-mcp

327 · Go
Stale C

An MCP server that creates secure Docker-based sandboxes for executing untrusted code from AI applications.

mcpsandboxdocker +1
  • · Docker isolation - Each execution runs in a fresh Docker container isolated from host network and filesystem
  • · MCP-compliant API - Exposes create, execute, and cleanup tools over the Model Context Protocol
  • · Multi-language - Bundles Python, Node, and Bash runtimes that can be invoked inside the sandbox

BoxLite

2.3k · Rust
Active B

Lightweight VM compute substrate for AI agents, running OCI containers inside Boxes, embeddable as a Python library without daemon or root privileges.

microvmocisandbox +2
  • · Stateful workspaces — Boxes retain packages, files, and environment across stop/restart, avoiding rebuilds
  • · Lightweight VMs — Small footprint, fast boot, async-first API for high concurrency
  • · Hardware isolation — Each Box runs its own kernel, not just namespaces or regular containers

Cloudflare Sandbox SDK

1.1k · TypeScript
Active A

A TypeScript SDK for running sandboxed code environments on Cloudflare's edge network, designed for AI agents and untrusted code execution.

sandboxcloudflaretypescript +2
  • · Edge sandboxes - Run lightweight microVM sandboxes on the Cloudflare global network with low cold-start latency
  • · Multi-language execution - Run Python, Node.js, Java, and Bash code in isolated environments
  • · Snapshots and restore - Snapshot sandbox state and resume for long-running agents