Installation
- Node.js 18 or later
- Platform with hardware virtualization (see Installation)
Basic Execution
What’s happening:- BoxLite pulls the
python:slimOCI image (first run only) - Creates a lightweight VM with the image
- Executes the Python command inside the VM
- Streams output back to your application
- Cleans up when
stop()is called
TypeScript 5.2+ (Async Disposal)
Code Execution (AI Agents)
What’s happening:- CodeBox automatically installs required packages (requests)
- Executes the code in complete isolation
- Returns the output as a string
- Your host system remains completely safe
Running Examples
BoxLite includes 5 Node.js examples: Examples overview:| # | Example | Description |
|---|---|---|
| 1 | simplebox.js | Basic command execution |
| 2 | codebox.js | Python code execution sandbox |
| 3 | browserbox.js | Browser automation with CDP |
| 4 | computerbox.js | Desktop automation (mouse, keyboard, screenshots) |
| 5 | interactivebox.js | Interactive terminal sessions |
Next Steps
Core concepts
Understand the different box types (SimpleBox, CodeBox, BrowserBox, and more), lifecycle, images, and resource configuration.
Execute AI-generated code
Learn to use CodeBox for safe code execution — auto-install packages, run untrusted code, and capture output.
Node.js SDK Reference
Complete API reference for SimpleBox, CodeBox, BrowserBox, ComputerBox, and more.

