Sandbox SDK
Run untrusted code safely. The Sandbox API gives your AI agent a real Linux environment: create it, run anything, delete it.
Each sandbox is a Firecracker microVM: hardware-isolated, not a container. Boot time is ~125ms. Everything is deleted when you're done.
What's in this section
- Quick start: install, set your API key, run your first command
- Environments: available flavors and what's preinstalled
- TypeScript SDK:
@codecapsules/sandboxon npm - Python SDK:
codecapsules-sandboxon PyPI
The three-line version
import { Sandbox } from '@codecapsules/sandbox';
await Sandbox.using(async (sb) => {
const r = await sb.exec('python -c "print(2 ** 32)"');
console.log(r.stdout); // "4294967296\n"
});
// sandbox deleted automatically
from codecapsules_sandbox import Sandbox
with Sandbox.create() as sb:
result = sb.exec('python -c "print(2 ** 32)"')
print(result.stdout) # "4294967296\n"
Access
The API is in private beta. Join the waitlist and you'll get an API key when your spot is ready.