E2B Code Interpreter SDK
Secure cloud sandboxes for running AI-generated code — spin up a Python/JS interpreter in 150ms from your agent.
E2B Code Interpreter SDK
The E2B SDK provides secure, isolated cloud micro-VMs that let AI agents safely execute code generated by LLMs. Each sandbox starts in ~150ms and can run arbitrary Python, JavaScript, shell commands, and Jupyter-style notebooks — without any risk to the host system.
Key Features
- Sub-200ms cold start: VMs are pre-warmed; your agent never waits long for a sandbox
- Persistent state: variables, files, and installed packages persist for the lifetime of the sandbox session
- Code interpreter: Jupyter-compatible kernel with stdout, stderr, rich display (plots, DataFrames, HTML)
- File system: upload/download files, mount datasets, and share artifacts back to the user
- Custom images: bake in your own dependencies with a one-line template definition
- Multi-language: Python, Node.js, Java, Go, Rust — any language installable in a Debian container
Quick Start
pip install e2b-code-interpreter
from e2b_code_interpreter import Sandbox
with Sandbox() as sbx:
execution = sbx.run_code("""
import pandas as pd
import matplotlib.pyplot as plt
df = pd.DataFrame({'x': range(10), 'y': [i**2 for i in range(10)]})
df.plot(x='x', y='y')
plt.savefig('chart.png')
print('Chart saved!')
""")
print(execution.text)
sbx.files.download('chart.png', 'local_chart.png')
npx ai-supply add e2b-code-interpreter-sdk
Curated mirror of the open-source E2B SDK (Apache-2.0). Get it from the source.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/e2b-code-interpreter-sdk/check). Click a policy:
Consume E2B Code Interpreter SDK programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/e2b-code-interpreter-sdk
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/e2b-code-interpreter-sdk/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add e2b-code-interpreter-sdk
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/e2b-code-interpreter-sdk/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "e2b-code-interpreter-sdk" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.