# E2B (sandboxes)

> Canonical: https://skillalmanac.com/glossary/e2b | Last verified: 2026-11-24 | Index status: not offered to search engines

E2B is open-source infrastructure, also offered as a cloud service, for running AI-generated code in isolated sandboxes. Its documentation says the sandboxes let agents execute code, process data and run tools, and it provides SDKs to start and manage them.

Also called: E2B, E2B sandbox, e2b dev, E2B code interpreter, e2b ai sandbox.

## In plain language

When an AI agent writes code, running that code on your own computer can be risky, because a mistake could delete files or leak data. E2B offers a separate, disposable computer in the cloud where the code can run instead. The agent sends its code there, gets the result back, and the sandbox, which is a walled-off space, can be thrown away afterwards. It suits developers who build agents that run code. It is a tool you call from your own program, not an app to chat with. A sandbox limits the damage but does not make the code correct, and you must still decide what the sandbox may reach, such as the internet or your files.

## Technical definition

The E2B README describes it as open-source infrastructure that runs AI-generated code in secure isolated sandboxes in the cloud, with JavaScript and Python SDKs to start and control sandboxes, and lists an Apache-2.0 licence. The documentation says the sandboxes let agents execute code, process data and run tools. A sandbox, in the general security sense, is a mechanism for separating running programs, intended to stop faults and security holes from spreading. An agent calls the SDK, which creates a sandbox, sends code or commands to it and returns the output.

## How it shows up when you use agents

E2B appears when an agent you build needs to run code it wrote. Instead of executing that code on a laptop or server you care about, the agent's program asks E2B to start a sandbox, sends the code, and reads the result. A [sandbox](/glossary/sandbox) is the general idea; E2B is one product that provides it as a cloud service. It supports [code execution](/glossary/code-execution) for agents such as a data analysis assistant, and it is aimed at developers writing their own agent, not at someone using a coding tool as it comes.

What breaks when it is misunderstood: people treat a sandbox as a full safety answer. The sandbox contains the code, but an agent can still be steered by a malicious instruction hidden in a web page or file, see [Prompt injection](/glossary/prompt-injection). If the sandbox is allowed to reach the internet or hold your credentials, those become exposed.

A next action: list what the sandbox needs to reach and give it nothing more, keep secrets out of it, and read the [risks and guardrails guide](/learn/autonomous-ai-agents-risks-and-guardrails) before letting an agent run unattended.

## Common confusions

- **E2B versus a sandbox.** A sandbox is the general mechanism for separating running programs. E2B is a specific open-source product, also run as a cloud service, that provides sandboxes for agents.
- **E2B versus a local coding agent.** A tool such as Claude Code runs commands on your machine under its permission rules. E2B is a separate service you call from your own code.
- **Isolated versus correct.** Isolation limits the damage from bad code. It does not check that the code does what you wanted.
- **Myth.** A sandbox is a safe place for secrets. The sandbox holds whatever you put in it, so keep credentials out unless the task requires them.

## Worked examples in this catalogue

### [Autonomous AI Agents: Risks and Guardrails](https://skillalmanac.com/learn/autonomous-ai-agents-risks-and-guardrails)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: What goes wrong when an AI agent acts unattended, and the limits, approvals and stopping rules that contain it.

Why it exercises the concept: Running agent-written code in an isolated sandbox is one containment measure. The guide covers the wider set of limits and approvals around it.

### [coding-agent-guardrails](https://skillalmanac.com/skills/skill-almanac/coding-agent-guardrails)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A pre-action checklist for coding agents plus a read-only audit of a repo's guardrail setup.

Why it exercises the concept: A sandbox is one guardrail among several. This checklist covers the others, such as what an agent may do before it acts.

### [Claude Code](https://skillalmanac.com/tools/claude-code)

```
/permissions
```

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Claude Code shows the permission rules that decide which commands and file edits it may run.

Why it exercises the concept: It is the local counterpart to a remote sandbox: a coding agent that runs commands on your machine is governed by its permission rules. E2B is a different product and does not configure this.

## Related terms

- [Sandbox](https://skillalmanac.com/glossary/sandbox.md)
- [Code execution (tool)](https://skillalmanac.com/glossary/code-execution.md)
- [Coding agent](https://skillalmanac.com/glossary/coding-agent.md)
- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [Prompt injection](https://skillalmanac.com/glossary/prompt-injection.md)
- [Agent harness](https://skillalmanac.com/glossary/agent-harness.md)

## Sources

- [E2B Documentation](https://docs.e2b.dev/), E2B (accessed 2026-11-24)
- [e2b-dev/E2B (README)](https://github.com/e2b-dev/E2B), GitHub (E2B) (accessed 2026-11-24)
- [Sandbox (computer security)](https://en.wikipedia.org/wiki/Sandbox_(computer_security)), Wikipedia (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
