Sandbox for AI Apps & Agents
Secure sandboxed cloud environments made for AI agents and AI apps
What is E2B?
E2B Sandbox is a secure sandboxed cloud environment made for AI agents and AI
apps. Sandboxes allow AI agents and apps to have long running cloud secure
environments. In these environments, large language models can use the same
tools as humans do. For example:
- Cloud browsers
- GitHub repositories and CLIs
- Coding tools like linters, autocomplete, "go-to defintion"
- Running LLM generated code
- Audio & video editing
The E2B sandbox can be connected to any LLM and any AI agent or app.
Getting Started & Documentation
Please visit documentation to get started.
To create and control a sandbox, you use our SDK:
Install SDK
npm install e2b
Start sandbox
import { Sandbox } from "e2b";
const sandbox = await Sandbox.create();
await sandbox.close();
Development
You can use the SDK with a locally running envd
(that usually runs inside the sandbox and allows the SDK to interact with it) by passing E2B_DEBUG=true
to .env
or by using debug: true
in the Sandbox.create
or Sandbox.connect
method options.
Install dependencies
pnpm install
Generating API clients used by SDK
Check out top-level README.
The API clients are not automatically publicly accessible from the SDK — we are doing some additional work to make the experience of using the APIs better by providing a more user-friendly interface.
Building
For development, you can run the following command to build the SDK on every change:
pnpm dev
Testing
Use pnpm test
to run the test suite or pnpm example
to run the example code.
Pass E2B_DEBUG=true
to .env
to run against the locally running envd (usually run via Docker).
When running with a local environment the environment is not cleaned up after every test run as when running the test againts production. This might lead to some issues when running the tests multiple times and it is good to keep in mind.