---
source: https://iinventedlight.com/library/notes/ao-security-e2b-cloud-sandboxes.md
title: "E2B runs generated code in cloud sandboxes"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (e2b-dev/E2B (GitHub)); Apache-2.0 (google-gemini/gemini-cli (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: e2b-dev/E2B (GitHub), E2B README, Apache-2.0 (https://raw.githubusercontent.com/e2b-dev/E2B/main/LICENSE); google-gemini/gemini-cli (GitHub), Sandboxing in Gemini CLI, Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). READMEs read; no E2B account, sandbox or Gemini process created."
category: agent-operations
topic_area: "agent operations: sandbox boundaries"
tags: [e2b, sandbox, generated-code, gemini-cli]
client: Librarian
sources:
  - id: S1
    title: "E2B README"
    publisher: e2b-dev/E2B (GitHub)
    url: https://github.com/e2b-dev/E2B/blob/main/README.md
    accessed: 2026-11-16
    license: "Apache-2.0"
  - id: S2
    title: "Sandboxing in Gemini CLI"
    publisher: google-gemini/gemini-cli (GitHub)
    url: https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/sandbox.md
    accessed: 2026-11-16
    license: "Apache-2.0"
---
# E2B runs generated code in cloud sandboxes
**Answer:** E2B is open-source infrastructure to run AI-generated code in secure isolated sandboxes in the cloud. Use its JavaScript SDK or Python SDK to start and control sandboxes.

## E2B example

The README example calls `Sandbox.create()`, then runs a command with `sandbox.commands.run`. For code execution it points to `runCode()` and Code Interpreter.

## Contrast with CLI sandboxing

Gemini CLI describes sandboxing as isolating shell commands and file modifications from the host. It can be enabled with `-s` or `--sandbox`, the `GEMINI_SANDBOX` environment variable, or settings.

## See also

- [ao-security-gemini-cli-sandbox](https://iinventedlight.com/library/notes/ao-security-gemini-cli-sandbox/)
- [ao-security-garak-probes](https://iinventedlight.com/library/notes/ao-security-garak-probes/)
- [ao-security-attack-taxonomy](https://iinventedlight.com/library/notes/ao-security-attack-taxonomy/)
- [ao-security-guardrail-layers](https://iinventedlight.com/library/notes/ao-security-guardrail-layers/)

## Claims

- id: C1
  claim: E2B runs generated code in cloud sandboxes.
  source: S1
  evidence: "secure isolated sandboxes in the cloud."

- id: C2
  claim: E2B offers JavaScript and Python SDKs.
  source: S1
  evidence: "or [Python SDK]"

- id: C3
  claim: Gemini isolates risky operations from the host.
  source: S2
  evidence: "from your host system, providing a security"

- id: C4
  claim: Gemini supports a sandbox command flag.
  source: S2
  evidence: "**Command flag**: `-s` or `--sandbox`"

## Sources

- [S1] E2B README. e2b-dev/E2B (GitHub). https://github.com/e2b-dev/E2B/blob/main/README.md . License: Apache-2.0. Accessed 2026-11-16.

- [S2] Sandboxing in Gemini CLI. google-gemini/gemini-cli (GitHub). https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/sandbox.md . License: Apache-2.0. Accessed 2026-11-16.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: e2b-dev/E2B (GitHub), E2B README, Apache-2.0 (https://raw.githubusercontent.com/e2b-dev/E2B/main/LICENSE); google-gemini/gemini-cli (GitHub), Sandboxing in Gemini CLI, Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
