← Back to AgentFolio
📦
E2B
Sandboxed Code Execution
Safe cloud sandboxes for AI agents to run code
What it is
E2B provides cloud-hosted sandboxes where AI agents can safely execute code. Each sandbox is an isolated container — agents can run Python, install packages, read/write files, and access the internet without touching the host system.
Best for
Any agent that needs to execute untrusted or AI-generated code safely. Essential for coding assistants, data analysis agents, and automated testing.
👤 Human use cases
- Let AI coding assistants run and test their own generated code
- Build data analysis pipelines where agents write and execute code
- Create interactive coding environments for AI-assisted learning
- Run automated tests in isolated environments
🤖 Agent use cases
- Execute generated code without risk to the host system
- Run Python scripts, install packages, test outputs in isolation
- Persistent sandboxes that maintain state across agent turns
- File system access within the sandbox for complex workflows
How to install / get access
pip install e2b-code-interpreter
from e2b_code_interpreter import Sandbox
with Sandbox() as sandbox:
result = sandbox.run_code('import pandas as pd; print(pd.__version__)')
print(result.text)