Skip to main content
How to pick one. Find the outcome you want in the tables below. Guides are grouped by how your system uses the sandbox:
  • The box is a tool the model calls — your orchestration stays on the host, and untrusted code runs inside.
  • The agent lives in the box — an autonomous agent works inside the sandbox with its own filesystem, browser, or desktop.
  • Multi-tenant platform — you hand isolated environments to users or workloads.
Every guide is self-contained and copy-runnable. Placeholders such as <YOUR_API_KEY> mark the values you must supply. Each guide starts from a box that already runs on your machine — see Installation and a quickstart.

The box is a tool the model calls

The agent lives in the box

Multi-tenant platform


Recipe index: single-purpose snippets

When you need one call rather than a whole guide, the tables below map a goal to its entry point and to the runnable example in the BoxLite repository. The tables below are organized by goal task. Each row gives the recommended box type, the matching repository example file (relative to the repository root boxlite/), and the related concept page on this site.

Getting started: execute code and commands in a sandbox

Configure the sandbox: resources / volumes / network / ports / secrets

Lifecycle: stop / restart / reuse across processes / snapshots

Interactive terminal (PTY)

Note: InteractiveBox / ComputerBox provide high-level wrappers only in Python and Node; C / Go / Rust only have the low-level exec(tty=...).

Browser and desktop automation

AI agents: let an LLM operate a sandbox

Advanced and remote REST

C SDK examples

The C SDK ships its own example set under examples/c/ (build with CMake; see examples/c/README.md). It exposes both a Simple API and a lower-level Native API with structured error handling (every function returns a BoxliteErrorCode).
The C SDK uses BoxliteErrorCode for control flow rather than exceptions. Common codes: Ok (0), NotFound (2), InvalidState (4), InvalidArgument (5), Image (8, image pull failed), Execution (10, command failed). Always initialize CBoxliteError error = {0}; and call boxlite_error_free(&error) on failure.
Link convention: the “concept page” column above links only to pages that already exist within docs-v2; the “repository example” entries are real file paths in the BoxLite source repository under boxlite/ (not pages on this site), so open and run them inside the repository. A few capabilities without a standalone example script (such as Secrets) are marked with — ; see the corresponding concept page.