汎用LLM・AI開発⭐ リポ 3品質スコア 76/100
e2b-sandboxes
E2Bはオープンソースのクラウドサンドボックスで、AI生成コードを安全に実行できます。以下の用途で活用できます:サンドボックス内でのコード実行、E2Bの利用、コードインタプリタの実行、AIコードの実行、セキュアなコード実行、分離された環境の構築、AIコーディングエージェントの実行、信頼できないコードの実行、クラウドサンドボックス、コード実行API、クラウド上のPythonサンドボックス、AIエージェントコードランナー、安全なコード実行、Jupyterサンドボックスなど。
description の原文を見る
E2B open-source cloud sandboxes for executing AI-generated code securely. USE FOR: run code in sandbox, e2b, code interpreter, execute AI code, secure code execution, isolated environment, AI coding agent execution, run untrusted code, cloud sandbox, code execution API, python sandbox cloud, AI agent code runner, safe code execution, jupyter sandbox.
SKILL.md 本文
E2B コードインタプリタサンドボックス
AI生成コード実行のための安全で隔離されたクラウドVM。オープンソース。
インストール
pip install e2b-code-interpreter
npm i @e2b/code-interpreter
export E2B_API_KEY=your_key_here # get at https://e2b.dev/dashboard
Python使用例
from e2b_code_interpreter import Sandbox
# Basic execution
with Sandbox() as sandbox:
result = sandbox.run_code("x = 1 + 1; print(x)")
print(result.logs.stdout) # ["2"]
# Stateful multi-step session
with Sandbox() as sandbox:
sandbox.run_code("data = [1, 2, 3]")
r = sandbox.run_code("print(sum(data))")
print(r.logs.stdout) # ["6"]
TypeScript使用例
import { Sandbox } from "@e2b/code-interpreter"
const sandbox = await Sandbox.create()
const result = await sandbox.runCode("print(1 + 1)")
console.log(result.logs.stdout)
await sandbox.kill()
Claude AIエージェントでの使用
from anthropic import Anthropic
from e2b_code_interpreter import Sandbox
client = Anthropic()
sandbox = Sandbox()
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Write Python to compute fibonacci(10)"}]
)
code = response.content[0].text
result = sandbox.run_code(code)
print(result.logs.stdout)
sandbox.kill()
主な機能
| 機能 | 詳細 |
|---|---|
| 隔離 | 各サンドボックス = 新規クラウドVM |
| ステートフル | セッション内で変数が永続化 |
| 言語 | Python、JavaScript/TypeScript |
| 出力 | stdout、stderr、リッチな結果(プロット、テーブル) |
| セルフホスティング対応 | GCP(本番環境対応)、AWS(進行中)、Azure(計画中) |
セルフホスティング
# GCP (production-ready)
terraform apply -var-file=gcp.tfvars
ライセンス: MIT(寛容ライセンスのため全文を引用しています) · 原本リポジトリ
詳細情報
- 作者
- mahmoud20138
- ライセンス
- MIT
- 最終更新
- 2026/4/23
Source: https://github.com/mahmoud20138/Tradecraft / ライセンス: MIT