Working examples for Tenki Sandbox: disposable Linux VMs for running code and AI agents in isolation.
Each example is self-contained, with its own README, source code, and run instructions. New to Tenki? Start with Run code in a sandbox. It covers the whole create, execute, dispose lifecycle in about 15 lines of JavaScript.
You need a Tenki account, an API key, your workspace ID, and Node.js 20 or later.
git clone https://github.com/LuxorLabs/cookbook.git
cd cookbook/examples/run-code-in-a-sandbox
npm install
export TENKI_AUTH_TOKEN="your-api-key"
export TENKI_WORKSPACE_ID="your-workspace-id"
node run.mjsThe script creates a sandbox, runs Python inside it, prints 42, and cleans
up. Authentication and client setup are covered in the
Sandbox SDK guide.
| Example | What it covers |
|---|---|
| Run code in a sandbox | Create a microVM, run a command, dispose it |
| Work with files | Read, write, and list files with the TypeScript SDK |
| Expose a port | Serve a web app on a public preview URL |
| Pause, snapshot, and resume | Preserve a sandbox and pick up where it left off |
| Run code with Python | The official tenki-sandbox Python SDK |
Give an agent a sandboxed place to run the code it writes.
| Example | Framework |
|---|---|
| Vercel AI SDK | Tenki as the AI SDK's experimental_sandbox |
| LangChain (JavaScript) | Sandboxed code interpreter tool |
| LangChain (Python) | Code-execution tool for a Python agent |
| CrewAI | Run agent-generated code in a sandbox |
| OpenAI Agents SDK | Sandboxed execution as an agent tool |
| LlamaIndex | Sandboxed execution as a FunctionTool |
| Hugging Face smolagents | Remote Python executor for a CodeAgent |
| Example | Integration |
|---|---|
| MCP server | Sandbox tools for Claude, Cursor, or any MCP client |
| Composio | Tenki tools in a Composio agent |
| Covalent | Each workflow task in its own microVM |
| AgentBox | Coding-agent boxes as Firecracker microVMs |
| ComputeSDK | Tenki as a provider for the unified sandbox interface |
Run a self-hosted agent platform's sandboxes on Tenki.
| Example | Platform |
|---|---|
| DeerFlow | Community sandbox provider for ByteDance's SuperAgent harness |
Each guide has side-by-side code and an API mapping.
| Guide |
|---|
| E2B to Tenki |
| Modal to Tenki |
| Daytona to Tenki |
Every example ships a verify.mjs script that exercises it against the live
API, so you can check that it still works before building on it. With your
credentials set:
cd examples/run-code-in-a-sandbox
npm install
node verify.mjsFrom the repository root, npm run verify runs every example's script.
First-party packages you can install directly in your own project:
| Integration | Install | What it does |
|---|---|---|
| Composio tools | npm install @tenkicloud/composio-tools |
Create, execute, snapshot, and terminate tools for Composio agents |
| Covalent executor | pip install covalent-tenki-plugin |
Runs Covalent workflow tasks in Tenki microVMs |
| GitHub Actions | uses: TenkiCloud/actions/setup-cli@v1 |
Installs the Tenki CLI and builds sandbox templates in CI |
| Go SDK | go get github.com/TenkiCloud/tenki-sdk-go/sandbox |
Go client for the Tenki Sandbox API |
These open-source projects ship a Tenki provider or backend out of the box:
| Project | Tenki integration |
|---|---|
| RAGFlow | Sandbox provider for the RAG engine's code executor |
| DeerFlow | Sandbox provider for ByteDance's SuperAgent harness — example |
| AgentBox | Provider for running parallel agents in sandboxed VMs — example |
| ComputeSDK | Tenki provider for the multi-provider compute toolkit — example |
| OpenHermit | Sandboxed exec backend for AI agent fleets |
Contributions are welcome. CONTRIBUTING.md covers local setup, the example checklist, and the verification contract.