TencentCloud/CubeSandbox

Instant, Concurrent, Secure & Lightweight Sandbox for AI Agents.

What it solves

CubeSandbox provides a secure, high-performance environment for AI agents to execute code. It addresses the trade-off between the low isolation of Docker containers and the high resource overhead and slow boot times of traditional virtual machines, offering hardware-level isolation with near-instant startup speeds.

How it works

Built on RustVMM and KVM, the system creates lightweight MicroVMs that run dedicated OS kernels. It uses resource pooling and snapshot cloning to achieve cold starts in under 60ms. To ensure security, it employs an eBPF-based virtual switch (CubeVS) for network isolation and an L7 security proxy (CubeEgress) for domain filtering and credential injection, ensuring secrets never enter the sandbox itself.

Who it’s for

Developers building AI agents that require a safe, scalable, and isolated environment to run untrusted code, as well as those looking for a drop-in, self-hosted alternative to E2B Cloud.

Highlights

  • Ultra-fast Startup: Average cold start under 60ms using snapshot cloning.
  • Hardware Isolation: Each sandbox runs its own dedicated OS kernel in a MicroVM.
  • E2B Compatibility: Fully compatible with the E2B SDK, allowing seamless migration via environment variable changes.
  • High Density: Less than 5MB memory overhead per sandbox, enabling thousands of instances per server.
  • State Management: Supports high-frequency snapshots, instant cloning, and rollback to any saved state.
  • Network Security: Kernel-level egress filtering and a credential vault for secure API calls.

Related

  • Project
  • Project
  • Project
  • Project
  • Project