e2b@2.27.0
## Summary - Both JS and Python SDKs now validate that the configured E2B API key matches `e2b_` followed by 40 hex characters (mirroring the server-side check in [`infra/.../keys/key.go`](https://github.com/e2b-dev/infra/blob/main/packages/shared/pkg/keys/key.go#L66)) and throw `AuthenticationError` / `AuthenticationException` with an example token (`e2b_0000…`) and a link to the API Keys dashboard tab. - Validation runs inside `ApiClient` / `ApiClient.__init__` whenever an API key is present, so callers get immediate, actionable feedback instead of a generic 401 from the server. - Added unit tests (`validateApiKey.test.ts`, `test_validate_api_key.py`) and updated existing fixtures that used placeholder keys like `'test-key'` / `'base-api-key'` to use the valid format. ## Test plan - [x] `pnpm run format`, `pnpm run lint`, `pnpm run typecheck` - [x] `pnpm exec vitest run tests/api/validateApiKey.test.ts tests/api/handleApiError.test.ts tests/sandbox/abortSignal.test.ts tests/template/abortSignal.test.ts tests/sandbox/configPropagation.test.ts tests/connectionConfig.test.ts` - [x] `poetry run pytest tests/test_validate_api_key.py tests/test_api_client_transport.py tests/sync/sandbox_sync/test_config_propagation.py tests/async/sandbox_async/test_config_propagation.py tests/test_connection_config.py` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
What is E2B?
E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.
Run your first Sandbox
1. Install SDK
JavaScript / TypeScript
npm i e2b
Python
pip install e2b
2. Get your E2B API key
E2B_API_KEY=e2b_***
3. Start a sandbox and run commands
JavaScript / TypeScript
import Sandbox from 'e2b'
const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('echo "Hello from E2B!"')
console.log(result.stdout) // Hello from E2B!
Python
from e2b import Sandbox
with Sandbox.create() as sandbox:
result = sandbox.commands.run('echo "Hello from E2B!"')
print(result.stdout) # Hello from E2B!
4. Code execution with Code Interpreter
If you need to execute code with runCode()/run_code(), install the Code Interpreter SDK:
npm i @e2b/code-interpreter # JavaScript/TypeScript
pip install e2b-code-interpreter # Python
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()
const execution = await sandbox.runCode('x = 1; x += 1; x')
console.log(execution.text) // outputs 2
5. Check docs
Visit E2B documentation.
6. E2B cookbook
Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.
Self-hosting
Read the self-hosting guide to learn how to set up the E2B infrastructure on your own. The infrastructure is deployed using Terraform.
Supported cloud providers:
- 🟢 AWS
- 🟢 Google Cloud (GCP)
- Azure
- General Linux machine
Description
E2B 是开源的安全运行时环境,为企业级 AI Agent 提供真实工具支持。|GitHub 镜像 ⭐ 13.6k · 🍴 1k
https://github.com/e2b-dev/e2b
Readme
Apache-2.0
129 MiB
Languages
Python
57.1%
TypeScript
42.2%
Dockerfile
0.3%
JavaScript
0.1%
Makefile
0.1%
Other
0.1%

