OpenSandbox
Secure, Fast, and Extensible Sandbox runtime for AI agents.
What is OpenSandbox?
Secure, Fast, and Extensible Sandbox runtime for AI agents.
Overview of OpenSandbox
What it is
OpenSandbox is an Agentic AI Foundation (AAIF) project that provides AI applications with isolated environments to execute code, run commands, manage files, and operate browsers or desktops. It can be started locally with Docker and deployed on Kubernetes through a unified sandbox API.
Key features
- Fast Sandbox runtime: Firecracker creation in 64 ms P50 (serial) and 125.4 ms P99 (10 concurrent). Supports pause/resume with memory and disk state preserved.
- Agent working environments: Execute commands, manage files, and run code with built-in APIs. Integration examples include coding agents, browsers, and desktops.
- Network access control: Route inbound traffic through a unified ingress gateway and control outbound access with per-sandbox egress policies.
- Credential Vault: Let agents call external services without exposing real credentials to sandbox workloads.
- Local to cluster: Start with Docker and deploy on Kubernetes through a unified lifecycle API. Resource pools and batch creation support agent evaluation and RL training workloads.
- SDKs, CLI, and MCP: Integrate with Python, Java/Kotlin, TypeScript/JavaScript, C#/.NET, or Go SDKs. Use
osbfrom the terminal or connect agents through MCP. - Extensible sandbox protocol: Build custom runtime integrations against defined sandbox lifecycle and execution APIs.
Use cases
- Coding agents: Run coding agents in isolated environments to edit files, execute commands, and complete development tasks (e.g., Claude Code, Codex CLI, DeerFlow).
- Code execution and data analysis: Execute model-generated code and work with results through the Code Interpreter SDK.
- Browser and desktop automation: Automate web interactions and testing, or give agents access to a desktop environment (e.g., Playwright, Chrome, Desktop).
- Agent evaluation: Run evaluations with a separate sandbox for each trial (e.g., Harbor Evaluation).
Getting started
Requirements: Docker, Python 3.10+
Install and configure the sandbox server:
uvx opensandbox-server init-config ~/.sandbox.toml --example docker
uvx opensandbox-server
Install the Sandbox SDK:
uv pip install opensandbox
Create a sandbox and execute a command (Python example):
import asyncio
from opensandbox import Sandbox
async def main():
sandbox = await Sandbox.create("alpine")
try:
execution = await sandbox.commands.run("echo 'Hello OpenSandbox!'")
print(execution.logs.stdout[0].text)
finally:
await sandbox.destroy()
asyncio.run(main())
License and pricing
Apache-2.0 license. Open source. No pricing information is stated.
Based on the project's public README and repository metadata.