Skip to content

Examples

OpenSandbox provides ready-to-run examples covering SDK usage, agent integrations, browser automation, and training workloads.

TIP

All example source code is available in the examples/ directory on GitHub.

Coding Agents

Run coding CLIs and AI agent frameworks inside isolated sandboxes.

ExampleDescription
Claude CodeRun Claude Code CLI in a sandbox
Gemini CLIRun Gemini CLI in a sandbox
Codex CLIRun OpenAI Codex CLI in a sandbox
Qwen CodeRun Qwen Code CLI in a sandbox
Kimi CLIRun Kimi CLI (Moonshot AI) in a sandbox
LangGraphLangGraph state-machine workflow with sandbox
Google ADKGoogle ADK agent using OpenSandbox tools
OpenClawOpenClaw Gateway inside a sandbox
NullClawNullClaw Gateway sandbox integration

Browser & Desktop

Execute browser workloads and host desktop environments in sandboxes.

ExampleDescription
ChromeChromium sandbox with VNC and DevTools
PlaywrightPlaywright + Chromium headless testing
DesktopFull desktop environment with VNC
VS CodeVS Code Web (code-server) in a sandbox

Core Usage

Fundamental sandbox operations and SDK workflows.

ExampleDescription
Code InterpreterEnd-to-end Code Interpreter SDK workflow
AIO SandboxAll-in-One sandbox setup
Agent SandboxKubernetes agent-sandbox integration
WindowsWindows sandbox via KVM/QEMU
RL TrainingDQN CartPole reinforcement learning

Storage

Persistent and shared storage patterns for sandboxes.

ExampleDescription
Host Volume MountMount host directories into sandboxes
Docker PVC VolumeDocker named volume mounts
Docker OSSFS VolumeDocker OSSFS (OSS FUSE) mounts
Kubernetes PVCKubernetes PersistentVolumeClaim mounts

How to Run

  1. Start the OpenSandbox server (see Quick Start)
  2. Set environment variables: export SANDBOX_DOMAIN=..., export SANDBOX_API_KEY=...
  3. Add provider-specific variables as needed (e.g., ANTHROPIC_AUTH_TOKEN, OPENAI_API_KEY)
  4. Navigate to the example directory and run: python main.py

TIP

Each example includes a main.py entry point. Some also include a Dockerfile for containerized execution.

Released under the Apache 2.0 License.