Agent frameworks that create their sandboxes with the official E2B SDK run on getrollouts.dev without code changes. Set two environment variables and the framework starts its Firecracker sandboxes here.
pip install "smolagents[e2b,litellm]" # smolagents pip install "crewai-tools[e2b]" # CrewAI pip install -U "e2b-code-interpreter>=2.11" export E2B_API_KEY=e2b_... # from getrollouts.dev/portal export E2B_DOMAIN=getrollouts.dev
Get the API key in the portal (free trial, no card). The model provider key is only needed for the agent itself.
Use e2b-code-interpreter 2.11 or newer: older versions fail with the current e2b package
('Sandbox' object has no attribute '_transport').
With executor_type="e2b" the code that a CodeAgent writes runs in a sandbox instead of on your machine.
Packages listed in additional_authorized_imports are installed in the sandbox.
from smolagents import CodeAgent, LiteLLMModel
agent = CodeAgent(
model=LiteLLMModel(model_id="anthropic/claude-sonnet-5-5"),
tools=[],
executor_type="e2b", # code runs in a getrollouts sandbox
additional_authorized_imports=["numpy"],
)
try:
print(agent.run("Use numpy to compute the standard deviation of the first 20 primes."))
finally:
agent.cleanup()
Call agent.cleanup() when you are done, so the sandbox stops right away instead of at its timeout.
crewai-tools ships three E2B tools: E2BExecTool (shell), E2BPythonTool (Jupyter-style Python)
and E2BFileTool (files). Their domain argument falls back to E2B_DOMAIN.
from crewai import Agent, Crew, Task
from crewai_tools import E2BExecTool, E2BPythonTool
coder = Agent(
role="Python developer",
goal="Write small, correct Python and prove it by running it",
backstory="You test everything in the sandbox before you answer.",
tools=[E2BPythonTool(), E2BExecTool()],
llm="anthropic/claude-sonnet-5-5",
)
task = Task(description="Return the first 15 Fibonacci numbers and show the output.",
expected_output="Code and printed result.", agent=coder)
print(Crew(agents=[coder], tasks=[task]).kickoff())
By default each tool call gets a fresh sandbox. Use persistent=True when an agent should keep files and state
across calls; the sandbox is removed when the process exits.
A code tool for any LangChain agent and the official Deep Agents backend (langchain-e2b) are covered in the
LangChain guide.
Anything that uses the e2b or e2b-code-interpreter packages reads E2B_API_KEY and
E2B_DOMAIN from the environment. If a framework asks for the domain explicitly, pass getrollouts.dev.
Sessions last up to 24 hours on paid accounts and 1 hour on the trial; the trial allows 5 sandboxes at a time.
Sandbox side tested on 2026-12-02 with smolagents 1.26, crewai and crewai-tools 1.15, langchain-e2b 0.0.7, e2b 2.64 and e2b-code-interpreter 2.11. Runnable versions: github.com/getrollouts/examples (12_smolagents.py, 13_crewai.py). More: docs, comparison with E2B.