Menu

Categories

Tags

Tencent Cloud's Cube Sandbox is a Rust-built AI agent playground that's fast and frugal

April 21, 2026 | Source: qq | Tencent | 14,709 views 0 comments

Tencent Cloud just open-sourced Cube Sandbox, an AI agent sandbox written in Rust and released under the Apache 2.0 license.

TencentCloud/CubeSandboxTencentCloud/CubeSandboxTencentCloud/CubeSandbox · github.com

A sandbox is the isolated environment where an AI agent runs its code, preventing model-generated scripts from accidentally deleting files or gaining unauthorized access to the host machine. It's a critical piece of infrastructure, and products like OpenAI's Agents SDK, Manus, Perplexity, and Hugging Face all use similar architectures. The de facto standard interface for these systems is E2B. Cube is fully compatible with the E2B API, meaning developers can switch their agents from E2B's own service to a self-hosted Cube deployment by changing just one environment variable—no code changes required.

Tencent Cloud released some impressive performance figures. A single, cold-start sandbox launches in under 60 milliseconds. With 50 concurrent launches, the average time is 67ms, with a P95 of 90ms and a P99 of 137ms. A single instance uses less than 5MB of resident memory (measured with sandbox specs up to 32GB), allowing a single 96-core server to run over 2,000 sandboxes simultaneously. For comparison, launching a Docker container in a similar scenario takes about 200ms and shares the host kernel, while a traditional virtual machine takes seconds to boot and consumes at least 20MB per instance.

Cube's approach is to give each agent its own independent guest OS kernel, using hardware-level isolation while keeping startup times under a few hundred milliseconds. It achieves this speed through resource pool pre-provisioning, snapshot cloning, and low-level lock optimizations. The tiny memory footprint comes from a rewrite in Rust, copy-on-write (CoW) memory reuse, and reflink disk sharing. The project also includes CubeVS, which uses eBPF for network isolation between sandboxes.

The system has been validated at scale in two cases. Cube originally ran within Tencent Cloud's serverless infrastructure, handling over ten billion calls. After migrating its Yuanbao AI programming scenario to Cube, resource core-hour consumption dropped by 95.8%. An external customer, MiniMax, used Cube to schedule hundreds of thousands of sandbox instances per minute for its Agentic Reinforcement Learning training. The next step in the roadmap is to open-source event-level snapshot rollback, providing state reversion in the hundred-millisecond range.

Tags: #Github

Leave a Reply

Your email address will not be published. Required fields are marked *