A sandbox platform that runs agent and user code in isolated Firecracker microVMs, controlled through an HTTP API.
opensandbox-group/OpenSandbox
Open-source sandbox runtime that gives AI agents isolated environments to run code, commands, files, and browsers on your own infrastructure.
- Stars
- 16,481
- Forks
- 1,555
- Open issues
- 158
- Last commit
- yesterday
What is it?
OpenSandbox provides isolated sandbox environments for AI applications to execute code, run shell commands, manage files, and operate browsers or desktops. It runs locally on Docker and can be deployed to Kubernetes, both managed through a unified sandbox API.
The project includes a Fast Sandbox runtime based on Firecracker microVMs that supports pause and resume with memory and disk state preserved. Network access is controlled through a unified ingress gateway and per-sandbox egress policies, and a Credential Vault lets agents call external services without holding the real credentials.
Client access is available through Python, Java/Kotlin, TypeScript/JavaScript, C#/.NET and Go SDKs, a terminal CLI named osb, and an MCP server for clients such as Claude Code and Cursor. Example integrations cover coding agents, code interpreters, Playwright and Chrome automation, desktop environments, and agent evaluation harnesses.
Key features
- 01Creates sandboxes from container images with a unified lifecycle API, locally on Docker or on Kubernetes.
- 02Runs commands, reads and writes files, and executes code inside isolated environments.
- 03Firecracker-based Fast Sandbox runtime supports pause and resume with state preserved.
- 04Per-sandbox egress policies and a unified ingress gateway control network access.
- 05Credential Vault injects credentials for outbound calls without exposing them to sandbox workloads.
- 06SDKs for Python, Java/Kotlin, TypeScript, C#/.NET and Go, plus the osb CLI and an MCP server.
Use cases
- Running coding agents such as Claude Code or Codex CLI in isolated environments that can edit files and run commands.
- Executing model-generated code and analyzing results through the Code Interpreter SDK.
- Automating browsers or giving agents a desktop environment for web testing.
- Running a separate sandbox per trial when evaluating agents or training with reinforcement learning.
Quick start
- 1
Generate the example server config (requires Docker)
uvx opensandbox-server init-config ~/.sandbox.toml --example docker - 2
Start the sandbox server
uvx opensandbox-server - 3
Install the Python SDK
uv pip install opensandbox
Things to know
- Local execution requires Docker, and production deployment on Kubernetes requires a cluster and operational setup.
In collections
Topics
FAQ
- What is OpenSandbox?
- Open-source sandbox runtime that gives AI agents isolated environments to run code, commands, files, and browsers on your own infrastructure. OpenSandbox provides isolated sandbox environments for AI applications to execute code, run shell commands, manage files, and operate browsers or desktops. It runs locally on Docker and can be deployed to Kubernetes, both managed through a unified sandbox API.
- Is OpenSandbox free to use? What license does it have?
- OpenSandbox is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is OpenSandbox still maintained?
- Actively maintained. The last commit to OpenSandbox was on Nov 6, 2026.
- What can I use OpenSandbox for?
- Running coding agents such as Claude Code or Codex CLI in isolated environments that can edit files and run commands. Executing model-generated code and analyzing results through the Code Interpreter SDK. Automating browsers or giving agents a desktop environment for web testing. Running a separate sandbox per trial when evaluating agents or training with reinforcement learning.
- How do I install OpenSandbox?
- Generate the example server config (requires Docker): uvx opensandbox-server init-config ~/.sandbox.toml --example docker Start the sandbox server: uvx opensandbox-server Install the Python SDK: uv pip install opensandbox
- Where can I get OpenSandbox?
- The source code and installation instructions are on GitHub: https://github.com/opensandbox-group/OpenSandbox
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Self-hosted Kubernetes-based infrastructure that runs untrusted code in lightweight VM sandboxes, controlled via a CLI, HTTP API and Python SDK.
Sub-millisecond KVM virtual machine sandboxes for running AI agent code, created by forking a pre-warmed Firecracker snapshot with copy-on-write memory.
Python library that runs LLM-generated code in isolated sandboxes through one API across Docker, Kubernetes, Podman and local Linux or Windows backends.
Open-source container and VM runtime for macOS in Rust, offering a drop-in Docker engine, microVM sandboxes for AI agents, native Kubernetes and Linux VMs.
An all-in-one Docker sandbox giving AI agents a shared browser, shell, file system, VSCode Server, Jupyter and MCP services.