What problem does it solve?
Provide a hardened, isolated runtime for executing untrusted code, commands, and AI-generated scripts without exposing host resources or user data.
Core Features & Use Cases
- Lifecycle & Management: getSandbox, sleep/keepAlive options, and explicit destroy for resource cleanup.
- Execution APIs: exec for shell commands and runCode with persistent code contexts for interpreter-style workflows.
- File & Port Operations: read/write/list files, expose preview URLs for HTTP services, and work with Docker-based container images.
- Use Case: Run LLM-generated Python analysis in a per-session sandbox, persist state in a code context, and expose a temporary preview URL for web-based results during debugging.
Quick Start
Create a sandbox for user-123, open a Python code context, run sum([1,2,3]) in that context, and return the output.