e2b
$
npx mdskill add vm0-ai/vm0-skills/e2bExecute secure code in isolated cloud sandboxes via E2B API.
- Enables safe AI code execution in ephemeral virtual machines.
- Integrates with E2B API for sandbox creation and management.
- Decides execution based on user requests for sandboxed code.
- Delivers results through API responses containing sandbox IDs.
SKILL.md
.github/skills/e2bView on GitHub ↗
---
name: e2b
description: E2B API for creating and managing secure cloud sandboxes for AI code
execution. Use when user mentions "E2B", "code sandbox", "run code in sandbox",
or "E2B sandbox".
---
## Troubleshooting
If requests fail, run `zero doctor check-connector --env-name E2B_TOKEN` or `zero doctor check-connector --url https://api.e2b.app/sandboxes --method GET`
## How to Use
> Official docs: `https://e2b.dev/docs/api-reference`
### 1. Create a Sandbox
Create a new sandbox (ephemeral VM). The default template is a Debian-based image with common runtimes.
Write `/tmp/e2b_create.json`:
```json
{
"templateID": "base"
}
```
```bash
curl -s -X POST "https://api.e2b.app/sandboxes" --header "Content-Type: application/json" --header "X-API-Key: $E2B_TOKEN" -d @/tmp/e2b_create.json
```
**Response includes:**
- `sandboxID` — Use this in all subsequent requests
- `templateID` — Template the sandbox was created from
- `alias` — Human-readable alias
- `clientID` — Client identifier
**With a longer timeout (seconds, default 300):**
Write `/tmp/e2b_create.json`:
```json
{
"templateID": "base",
"timeout": 900
}
```
```bash
curl -s -X POST "https://api.e2b.app/sandboxes" --header "Content-Type: application/json" --header "X-API-Key: $E2B_TOKEN" -d @/tmp/e2b_create.json
```
**With metadata tags:**
Write `/tmp/e2b_create.json`:
```json
{
"templateID": "base",
"metadata": {
"purpose": "code-review",
"user": "agent"
}
}
```
```bash
curl -s -X POST "https://api.e2b.app/sandboxes" --header "Content-Type: application/json" --header "X-API-Key: $E2B_TOKEN" -d @/tmp/e2b_create.json
```
### 2. List Running Sandboxes
List all currently running sandboxes for your team:
```bash
curl -s -X GET "https://api.e2b.app/sandboxes" --header "X-API-Key: $E2B_TOKEN"
```
### 3. Get Sandbox Status
Get the status and details of a specific sandbox. Replace `<sandbox-id>` with the actual `sandboxID` from the create response:
```bash
curl -s -X GET "https://api.e2b.app/sandboxes/<sandbox-id>" --header "X-API-Key: $E2B_TOKEN"
```
### 4. Refresh Sandbox Timeout
Extend the running time of a sandbox before it auto-terminates. Replace `<sandbox-id>` with the actual sandbox ID:
Write `/tmp/e2b_refresh.json`:
```json
{
"timeout": 300
}
```
```bash
curl -s -X POST "https://api.e2b.app/sandboxes/<sandbox-id>/refreshes" --header "Content-Type: application/json" --header "X-API-Key: $E2B_TOKEN" -d @/tmp/e2b_refresh.json
```
### 5. Kill a Sandbox
Terminate a sandbox immediately. Replace `<sandbox-id>` with the actual sandbox ID:
```bash
curl -s -X DELETE "https://api.e2b.app/sandboxes/<sandbox-id>" --header "X-API-Key: $E2B_TOKEN"
```
### 6. List Available Templates
List all sandbox templates available for your team:
```bash
curl -s -X GET "https://api.e2b.app/templates" --header "X-API-Key: $E2B_TOKEN"
```
**Response includes:**
- `templateID` — Use this as `templateID` when creating sandboxes
- `aliases` — Human-readable names (e.g. `base`, `python`, `nodejs`)
- `buildID` — Current build identifier
## Prerequisites
Connect the **E2B** connector at [app.vm0.ai/connectors](https://app.vm0.ai/connectors).
> **Troubleshooting:** If requests fail, run `zero doctor check-connector --env-name E2B_TOKEN` or `zero doctor check-connector --url https://api.e2b.app/sandboxes --method GET`
## Guidelines
1. **Sandbox lifecycle**: Sandboxes are ephemeral and auto-terminate after the timeout (default 5 minutes). Always capture the `sandboxID` from the create response for subsequent operations.
2. **Timeout management**: Use the refresh endpoint to extend sandbox life if your task runs longer than expected.
3. **Template selection**: Use `base` for general-purpose sandboxes. List templates first to see all available options including specialized Python/Node.js environments.
4. **Metadata**: Tag sandboxes with metadata to track purpose, user, or task — useful for auditing and cleanup.
5. **Cleanup**: Always delete sandboxes when done to avoid unnecessary charges and hitting concurrency limits.
6. **Concurrency**: Check your plan's sandbox concurrency limit before spawning many sandboxes simultaneously.
More from vm0-ai/vm0-skills
- account-reconciliationPerform account reconciliations comparing general ledger balances against subledgers, bank statements, or external records. Use for bank reconciliation, GL-to-subledger reconciliation, intercompany reconciliation, balance sheet reconciliation, reconciling item analysis, outstanding item aging, or clearing open items.
- agentphoneBuild AI phone agents with AgentPhone API. Use when the user wants to make phone calls, send/receive SMS, manage phone numbers, create voice agents, set up webhooks, or check usage — anything related to telephony, phone numbers, or voice AI.
- ahrefsAhrefs SEO API for backlink and keyword analysis. Use when user mentions
- amplitudeAmplitude product analytics API. Use when user mentions "Amplitude",
- analysis-qaQuality-check a data analysis before sharing — verify joins, aggregations, denominators, time ranges, and metric definitions. Detect pitfalls like survivorship bias, average-of-averages, join explosion, timezone mismatches, incomplete periods, and selection bias. Includes documentation templates for reproducible analyses.
- anthropic-managed-agentsAnthropic Managed Agents API for programmatically creating, running, and streaming AI agents on Anthropic's cloud infrastructure. Use when the user mentions "Managed Agents", "Anthropic agent sessions", or needs to create/run/stream an Anthropic agent with tool use (bash, git, web), attach GitHub repositories, or inject secrets via Vault. Do NOT use for standard Claude Messages API — use the Claude API skill instead.
- apifyApify web scraping platform. Use when user mentions "scrape website",
- asanaAsana API for tasks and projects. Use when user mentions "Asana", "asana.com",
- atlassianAtlassian API for Confluence and Jira. Use when user mentions "Confluence
- attioAttio REST API for AI-native CRM operations — manage companies, people, deals, and custom objects, plus notes, tasks, lists, and comments. Use when the user mentions "Attio", "CRM record", "create company", "add person", "list entry", "CRM note", or "CRM task".