Skip to main content
Pick by what the sandbox has to do. Every type inherits from SimpleBox, so exec() / copy_in() / copy_out() remain available whichever you choose, and all six are async context managers that create and start the microVM on entry.

Which type do you need?

Selection summary: choose SimpleBox to run commands; CodeBox to run Python; BrowserBox for a browser; ComputerBox for a desktop; InteractiveBox for a manual terminal; SkillBox for an AI agent. The high-level wrappers for ComputerBox and InteractiveBox are provided only in Python and Node; the other language SDKs (C / Go / Rust) currently expose only the lower-level exec(tty=...). Node uses the same six names with new and camelCase options, and await using in place of async withawait using box = new CodeBox(). Per-type Node signatures are in the Node.js SDK reference.

SimpleBox — the general-purpose base class

Use it to run any command, use your own image, or get fine-grained control over resources, volumes, ports, and networking. It is also the parent class of the other five types.
Key SimpleBox constructor arguments: image / rootfs_path (at least one required), memory_mib, cpus, name, auto_remove (default True), reuse_existing (default False). Other advanced options (volumes / ports / network / secrets / advanced, etc.) are forwarded through **kwargs to the underlying BoxOptions.

CodeBox — Python code execution

Use it to execute untrusted or AI-generated Python code, or to run computation or scripting tasks.
Note: the timeout of CodeBox.run(code, timeout=...) is an int and is not enforced. For reliable timeout control, use exec(..., timeout=<float>) inherited from SimpleBox instead. run() returns only stdout; if you also need stderr, use exec().

BrowserBox — browser automation

Use it to run Playwright in an isolated environment or connect over CDP for browser automation. BrowserBox exposes a browser endpoint to the host, and the host-side Playwright connects to it.
playwright_endpoint() (Playwright Server mode) supports chromium / firefox / webkit; endpoint() (direct CDP/BiDi) does not support WebKit. The two modes are mutually exclusive — pick one as needed.

ComputerBox — desktop automation

Use it for a computer-use agent that drives a real Linux desktop (XFCE) through mouse, keyboard, and screenshots. You can watch it live in a browser via noVNC.
ComputerBox allocates higher resources by default (cpu=2, memory=2048), and its GUI ports default to HTTP 3000 / HTTPS 3001.

InteractiveBox — interactive terminal

Use it to manually enter a sandbox shell to debug, like docker exec -it. On async with entry it automatically starts a shell and forwards stdin/stdout in both directions; type exit to leave.
When run in a non-TTY environment (a redirected pipe, some CI), tty is auto-detected as False and interactive input is not forwarded. To force interactivity, pass tty=True explicitly.

SkillBox — run Claude Code inside a sandbox

SkillBox is purpose-built for the Claude Code CLI: its image installs claude and starts it with a computer-use MCP config. To run a different agent CLI, install it into a SimpleBox yourself — see Run Codex, Run Pi, or Run OpenCode.
Use it to host an AI agent so the Claude Code CLI works in an isolated environment; you can install skills, hold multi-turn conversations, and watch live through the built-in noVNC desktop.
SkillBox allocates higher resources by default (memory_mib=4096, disk_size_gb=10); its noVNC GUI ports default to 0 at construction time (randomly assigned), and auto_remove=True.

Parameters and Returns

Key constructor arguments per type (Python)

Resource defaults: when cpus / memory_mib are left unset, the runtime applies 1 vCPU / 1024 MiB (vm_defaults in src/boxlite/src/runtime/constants.rs), not any SDK-level constant. BrowserBox and ComputerBox override with their own higher defaults (cpu=2, memory=2048). Set cpus / memory_mib explicitly for predictable capacity planning. See Compute resources.

Common capabilities (inherited by all types from SimpleBox)

ExecResult fields (Python wrapper layer)


Troubleshooting