Agent skill

E2b Sandbox

by agent-sandbox in agent-sandbox/agent-sandbox

Create, manage, and use E2B sandboxes — run commands, manage files, use git, persist state, and configure networking.

Apache-2.0Auto-check passedDevelopment

Install E2b Sandbox

skills CLI
$ npx skills add agent-sandbox/agent-sandbox --skill e2b-sandbox -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install agent-sandbox/agent-sandbox e2b-sandbox --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/agent-sandbox/agent-sandbox.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/e2b-sandbox .claude/skills/e2b-sandbox && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
e2b-sandbox
GitHub stars
218
Token cost
~2.6k tokens
SKILL.md length
191 words
Files
2 (incl. references)
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

Create, manage, and use E2B sandboxes — run commands, manage files, use git, persist state, and configure networking.

  • Building agent workflows that need isolated execution environments
  • SKILL.md covers Quick Start, Package Choice, Sandbox Creation Options and Running Commands, plus 5 more sections
  • Calls npm and pip; reaches github.com and 3000-i62mff4aht.e2b.app; needs GIT_TOKEN and E2B_API_KEY
  • Tasks that involve Building AI agents

What it does

E2b Sandbox is an agent skill from agent-sandbox/agent-sandbox. Create, manage, and use E2B sandboxes — run commands, manage files, use git, persist state, and configure networking. Use when building agent workflows that need isolated execution environments.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/networking.md`).

It sits in Development, covering Building AI agents and Git workflow. It works with Git and Model Context Protocol. The repository describes itself as: Agent-Sandbox is an easy-to-use, enterprise-grade sandbox platform for AI Agents — letting them securely run untrusted LLM-generated code, Browser use, Computer use, and deploy… The licence is Apache-2.0.

When your agent uses it

  • Building agent workflows that need isolated execution environments
  • Tasks that involve Building AI agents
  • Tasks that involve Git workflow

Example prompts

  • “/e2b-sandbox”

Requirements

  • Python 3
  • Node.js
  • A credential in E2B_API_KEY
  • A credential in API_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 6f7b273. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com
    • 3000-i62mff4aht.e2b.app

    Also links to:

    • e2b.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GIT_TOKEN
    • E2B_API_KEY
    • API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

E2b Sandbox loads about 2.6k tokens when it runs, and up to ~3.5k if it reads all its reference files. Until then it costs about 52 tokens; SKILL.md has 191 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from agent-sandbox/agent-sandbox at commit 6f7b273, republished under its Apache-2.0 licence (© agent-sandbox). 191 words, ~2,632 tokens.

Download SKILL.mdSave it as .claude/skills/e2b-sandbox/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
e2b-sandbox
description
Create, manage, and use E2B sandboxes — run commands, manage files, use git, persist state, and configure networking. Use when building agent workflows that need isolated execution environments.

E2B Sandbox — Lifecycle & Operations

Quick Start

Install the SDK and set your API key:

bash
# JavaScript/TypeScript
npm install @e2b/code-interpreter

# Python
pip install e2b-code-interpreter

Set E2B_API_KEY in your environment (get one at https://e2b.dev/dashboard).

Create a sandbox and run a command
typescript
import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('echo "Hello from E2B"')
console.log(result.stdout) // Hello from E2B
await sandbox.kill()
python
from e2b_code_interpreter import Sandbox

sandbox = Sandbox.create()
result = sandbox.commands.run('echo "Hello from E2B"')
print(result.stdout)  # Hello from E2B
sandbox.kill()

Package Choice

NeedPackageJS importPython import
Code execution (runCode)Code Interpreterimport { Sandbox } from '@e2b/code-interpreter'from e2b_code_interpreter import Sandbox
MCP gatewayBase SDKimport Sandbox from 'e2b'from e2b import Sandbox
Templates onlyBase SDKimport { Template } from 'e2b'from e2b import Template

Recommendation: Use Code Interpreter by default — it includes all base features plus runCode()/run_code().

Sandbox Creation Options

typescript
const sandbox = await Sandbox.create({
  template: 'my-template',       // Custom template name or ID
  timeoutMs: 5 * 60_000,         // Sandbox lifetime (default: 5 min)
  metadata: { user: 'alice' },   // Custom metadata for filtering
  envs: { API_KEY: 'secret' },   // Runtime environment variables
  secure: true,                   // Enable HTTPS-only mode
  allowInternetAccess: false,     // Disable outbound network (default: true)
  network: {                      // Fine-grained network control
    denyOut: [ALL_TRAFFIC],
    allowOut: ['api.example.com'],
  },
})
python
sandbox = Sandbox.create(
    template='my-template',
    timeout=300,                    # Sandbox lifetime in seconds
    metadata={'user': 'alice'},
    envs={'API_KEY': 'secret'},
    secure=True,
    allow_internet_access=False,
    network={
        'deny_out': [ALL_TRAFFIC],
        'allow_out': ['api.example.com'],
    },
)

Running Commands

typescript
const repoPath = '/home/user/repo'

// Simple command
const result = await sandbox.commands.run('ls -la')
console.log(result.stdout)

// With options
const result = await sandbox.commands.run('npm start', {
  cwd: repoPath,
  envs: { NODE_ENV: 'production' },
  user: 'root',
  timeoutMs: 30_000,
  onStdout: (data) => console.log(data),
  onStderr: (data) => console.error(data),
})

// Background process
const proc = await sandbox.commands.run('npm start', { background: true })
// Later...
await proc.kill()

// List running processes
const processes = await sandbox.commands.list()

// Send input to a process
await proc.sendStdin('yes\n')
python
repo_path = '/home/user/repo'

# Simple command
result = sandbox.commands.run('ls -la')
print(result.stdout)

# With options
result = sandbox.commands.run(
    'npm start',
    cwd=repo_path,
    envs={'NODE_ENV': 'production'},
    user='root',
    timeout=30,
    on_stdout=lambda data: print(data),
    on_stderr=lambda data: print(data, file=sys.stderr),
)

# Background process
proc = sandbox.commands.run('npm start', background=True)
# Later...
proc.kill()

# List running processes
processes = sandbox.commands.list()

# Send input to a process
proc.send_stdin('yes\n')

File Operations

typescript
// Read a file
const content = await sandbox.files.read('/home/user/config.json')

// Write a single file
await sandbox.files.write('/home/user/hello.txt', 'Hello, World!')

// Write multiple files at once
await sandbox.files.write([
  { path: '/home/user/file1.txt', data: 'Content 1' },
  { path: '/home/user/file2.txt', data: 'Content 2' },
])

// List directory contents
const entries = await sandbox.files.list('/home/user')

// Create a directory
await sandbox.files.makeDir('/home/user/new-dir')

// Remove a file or directory
await sandbox.files.remove('/home/user/old-file.txt')

// Rename / move
await sandbox.files.rename('/home/user/old.txt', '/home/user/new.txt')

// Watch for changes
const watcher = await sandbox.files.watch('/home/user', (event) => {
  console.log(event)
})
python
# Read a file
content = sandbox.files.read('/home/user/config.json')

# Write a single file
sandbox.files.write('/home/user/hello.txt', 'Hello, World!')

# Write multiple files at once
sandbox.files.write_files([
    {"path": "/home/user/file1.txt", "data": "Content 1"},
    {"path": "/home/user/file2.txt", "data": "Content 2"},
])

# List directory contents
entries = sandbox.files.list('/home/user')

# Create a directory
sandbox.files.make_dir('/home/user/new-dir')

# Remove a file or directory
sandbox.files.remove('/home/user/old-file.txt')

# Rename / move
sandbox.files.rename('/home/user/old.txt', '/home/user/new.txt')

# Watch for changes
watcher = sandbox.files.watch('/home/user', lambda event: print(event))

Git Operations

Authentication

Three options for private repositories:

1. Inline credentials — pass with each command:

typescript
await sandbox.git.push(repoPath, {
  username: process.env.GIT_USERNAME,
  password: process.env.GIT_TOKEN,
})
python
sandbox.git.push(
    repo_path,
    username=os.environ.get("GIT_USERNAME"),
    password=os.environ.get("GIT_TOKEN"),
)

2. Credential helper — authenticate once, reuse across commands:

typescript
await sandbox.git.dangerouslyAuthenticate({
  username: process.env.GIT_USERNAME,
  password: process.env.GIT_TOKEN,
})
// Now HTTPS git operations use stored credentials
python
sandbox.git.dangerously_authenticate(
    username=os.environ.get("GIT_USERNAME"),
    password=os.environ.get("GIT_TOKEN"),
)

3. Keep credentials in remote URL — pass dangerouslyStoreCredentials: true / dangerously_store_credentials=True to clone().

Common git workflows
typescript
const repoPath = '/home/user/repo'

// Clone
await sandbox.git.clone('https://github.com/org/repo.git', {
  path: repoPath, branch: 'main', depth: 1,
})

// Configure identity
await sandbox.git.configureUser('Bot', 'bot@example.com')

// Branch workflow
await sandbox.git.createBranch(repoPath, 'feature/my-change')
// ... make changes ...
await sandbox.git.add(repoPath, { files: ['README.md', 'src/index.ts'] })
await sandbox.git.commit(repoPath, 'Add feature')
await sandbox.git.push(repoPath, { remote: 'origin', branch: 'feature/my-change', setUpstream: true })

// Check status
const status = await sandbox.git.status(repoPath)
console.log(status.currentBranch, status.ahead, status.behind, status.fileStatus)

// List branches
const branches = await sandbox.git.branches(repoPath)
python
repo_path = '/home/user/repo'

# Clone
sandbox.git.clone(
    'https://github.com/org/repo.git',
    path=repo_path, branch='main', depth=1,
)

# Configure identity
sandbox.git.configure_user('Bot', 'bot@example.com')

# Branch workflow
sandbox.git.create_branch(repo_path, 'feature/my-change')
# ... make changes ...
sandbox.git.add(repo_path, files=['README.md', 'src/index.ts'])
sandbox.git.commit(repo_path, 'Add feature')
sandbox.git.push(repo_path, remote='origin', branch='feature/my-change', set_upstream=True)

# Check status
status = sandbox.git.status(repo_path)
print(status.current_branch, status.ahead, status.behind, status.file_status)

# List branches
branches = sandbox.git.branches(repo_path)

Persistence (Pause & Resume)

Sandboxes can be paused and resumed later, preserving full state (RAM, disk, running processes).

typescript
import { Sandbox } from '@e2b/code-interpreter'

// Create and do work
const sandbox = await Sandbox.create()
await sandbox.commands.run('echo "state to preserve" > /tmp/data.txt')
const sandboxId = sandbox.sandboxId

// Pause
await sandbox.betaPause()

// Later: resume by connecting (auto-resumes paused sandboxes)
const resumed = await Sandbox.connect(sandboxId)
const result = await resumed.commands.run('cat /tmp/data.txt')
console.log(result.stdout) // state to preserve
python
from e2b_code_interpreter import Sandbox

# Create and do work
sandbox = Sandbox.create()
sandbox.commands.run('echo "state to preserve" > /tmp/data.txt')
sandbox_id = sandbox.sandbox_id

# Pause
sandbox.beta_pause()

# Later: resume by connecting (auto-resumes paused sandboxes)
resumed = Sandbox.connect(sandbox_id)
result = resumed.commands.run('cat /tmp/data.txt')
print(result.stdout)  # state to preserve
Auto-pause (pause when idle instead of killing)
typescript
const sandbox = await Sandbox.betaCreate({
  autoPause: true,
  timeoutMs: 5 * 60_000,
})
// Sandbox will pause (not kill) after 5 minutes of inactivity
python
sandbox = Sandbox.beta_create(
    auto_pause=True,
    timeout=300,
)
List paused sandboxes
typescript
const paginator = await Sandbox.list({
  query: { state: ['paused'] },
})
const sandboxes = await paginator.nextItems()
python
from e2b_code_interpreter import Sandbox, SandboxQuery, SandboxState

paginator = Sandbox.list(SandboxQuery(state=[SandboxState.PAUSED]))
sandboxes = paginator.next_items()

Reconnecting to a Running Sandbox

typescript
// Save the sandbox ID
const sandboxId = sandbox.sandboxId

// Later: reconnect
const sandbox = await Sandbox.connect(sandboxId)

// List all running sandboxes
const paginator = await Sandbox.list({
  query: { state: ['running'] },
})
const sandboxes = await paginator.nextItems()
python
sandbox_id = sandbox.sandbox_id

# Reconnect
sandbox = Sandbox.connect(sandbox_id)

# List all running sandboxes
paginator = Sandbox.list()
sandboxes = paginator.next_items()

Networking

See the networking reference for port exposure, public URLs, traffic access tokens, domain-based filtering, and host masking.

Quick: Get a public URL for a port
typescript
const host = sandbox.getHost(3000)
const url = `https://${host}` // e.g., https://3000-i62mff4aht.e2b.app
python
host = sandbox.get_host(3000)
url = f'https://{host}'

© agent-sandbox, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/e2b-sandbox of agent-sandbox/agent-sandbox.

  • SKILL.md
  • references/networking.md

Open the folder on GitHubat commit 6f7b273

Compare with similar skills

E2b Sandbox next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

E2b Sandbox compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
E2b Sandbox this skillagent-sandbox/agent-sandbox218—~2.6kAutomated safety check: PassApache-2.0
GitHubswarmclawai/swarmclaw688—~820Automated safety check: PassMIT
Cut Releasespiculedata/saiku1.3k—~502Automated safety check: PassApache-2.0
basemind CLI Codebase NavigatorGoldziher/basemind106—~2kAutomated safety check: PassMIT
Dashclaw Weeklyucsandman/DashClaw310—~747Automated safety check: NotesMIT
Tapd Iteration InitTencentBlueKing/bk-bcs840—~1.3kAutomated safety check: PassCustom licence

Similar skills

  • GitHub

    swarmclawai/swarmclaw

    GitHub operations via gh CLI: issues, PRs, CI runs, code review, API queries.

    688 GitHub stars~820 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Cut Release

    spiculedata/saiku

    Cut a Saiku release via Gitflow — version bump, release branch, PR to main, tag, back-merge, and post-release chores.

    1.3k GitHub stars~502 tokensUpdated today
    DevelopmentAuto-check passed
  • Drives the basemind code-intelligence tool from the command line for symbol search, callers, git history and blame, document search and web crawling, sharing its cache with the MCP server.

    106 GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Dashclaw Weekly

    ucsandman/DashClaw

    Compile the week's maintainer-log entries + git history into ONE pasteable Reddit-ready DashClaw update.

    310 GitHub stars~747 tokensUpdated 2 days ago
    Writing & ContentAuto-check: notes
  • Tapd Iteration Init

    TencentBlueKing/bk-bcs

    迭代执行流水线启动器。分三个阶段执行:信息检查(验证 git 环境、获取迭代信息、 解析迭代分支)→ 恢复检测(已有状态文件时判定恢复策略)→ 新流程初始化(创建分支、 迭代目录和 iteration-state.json)。

    840 GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Sidecar

    joshukraine/dotfiles

    Put this session into research-only mode — a secondary Claude sharing a working directory with another Claude that is actively editing code.

    429 GitHub stars~926 tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from agent-sandbox/agent-sandbox

  • AI Deploy

    agent-sandbox/agent-sandbox

    Deploy a generated project (one process or several) to agent-sandboxes with scale-to-zero: idle sandboxes pause and auto-resume (process restarted) on the next HTTP request.

    218 GitHub stars~3k tokensUpdated 18 days ago
    Auto-check: notes
  • E2b Code Interpreter

    agent-sandbox/agent-sandbox

    Execute code in E2B sandboxes and integrate with LLMs for tool calling.

    218 GitHub stars~2.3k tokensUpdated 18 days ago
    Auto-check passed
  • E2b

    agent-sandbox/agent-sandbox

    Core E2B SDK knowledge — correct imports, namespacing, terminology, and API patterns.

    218 GitHub stars~732 tokensUpdated 18 days ago
    Auto-check passed

Questions about E2b Sandbox

What does E2b Sandbox do?

Create, manage, and use E2B sandboxes — run commands, manage files, use git, persist state, and configure networking. E2b Sandbox is an agent skill from agent-sandbox/agent-sandbox. Create, manage, and use E2B sandboxes — run commands, manage files, use git, persist state, and configure networking.

When should I use E2b Sandbox?

E2b Sandbox fits situations like: building agent workflows that need isolated execution environments; tasks that involve Building AI agents; tasks that involve Git workflow.

How do I install E2b Sandbox in Claude Code?

Run `npx skills add agent-sandbox/agent-sandbox --skill e2b-sandbox -a claude-code`. Or copy the skill folder (skills/e2b-sandbox in agent-sandbox/agent-sandbox) into .claude/skills/e2b-sandbox in your project. Claude Code loads it when a task matches its description.

How do I install E2b Sandbox in Codex?

Run `npx skills add agent-sandbox/agent-sandbox --skill e2b-sandbox -a codex`. Or copy the skill folder (skills/e2b-sandbox in agent-sandbox/agent-sandbox) into .agents/skills/e2b-sandbox in your project. Codex loads it when a task matches its description.

Can I use E2b Sandbox in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agent-sandbox/agent-sandbox --skill e2b-sandbox -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/e2b-sandbox, .gemini/skills/e2b-sandbox, .github/skills/e2b-sandbox and .opencode/skills/e2b-sandbox in your project.

What does E2b Sandbox need to run?

Going by SKILL.md and its folder, E2b Sandbox needs the command-line tools its instructions call (npm and pip) and credentials named GIT_TOKEN, E2B_API_KEY and API_KEY. Our summary lists: Python 3; Node.js; A credential in E2B_API_KEY; A credential in API_KEY.

Does E2b Sandbox access the network?

SKILL.md names 3 domains. In commands or code: github.com and 3000-i62mff4aht.e2b.app; the agent is likely to contact these when it follows the instructions. As links in the text: e2b.dev. This is read from the text; nothing was executed.

Is E2b Sandbox safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does E2b Sandbox use?

E2b Sandbox is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does E2b Sandbox use?

About 2.6k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 892 tokens, read only when the agent opens those files.

What are the alternatives to E2b Sandbox?

Skills that share tags, products or a category with E2b Sandbox: GitHub (swarmclawai/swarmclaw, 688 stars), Cut Release (spiculedata/saiku, 1.3k stars), basemind CLI Codebase Navigator (Goldziher/basemind, 106 stars) and Dashclaw Weekly (ucsandman/DashClaw, 310 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains E2b Sandbox?

agent-sandbox (a GitHub organization) maintains it in agent-sandbox/agent-sandbox, which has 218 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 20, 2026.

Source: agent-sandbox/agent-sandbox on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.