---
title: "Agno integration"
description: "Give Agno agents an isolated E2B sandbox with the official E2BTools toolkit, so the Python they write runs in E2B instead of on your machine."
url: "https://e2b.dev/integrations/agno"
---

# Agno

> Give Agno agents an isolated sandbox for code. Agno's official E2BTools toolkit runs the Python your agents write in E2B, not on the machine running Agno.

Agent frameworks & SDKs · [All integrations](https://e2b.dev/integrations.md)

## About this integration

- **Maintained by:** Agno
- **How it works:** Built into agno as E2BTools
- **Package:** agno
- **Language:** Python
- **Upstream:** [agno-agi/agno · ★ 43k](https://github.com/agno-agi/agno)
- **Docs:** [docs.e2b.dev/agents/agno](https://docs.e2b.dev/agents/agno)

## Get started

Paste the prompt into your coding agent, or follow the steps yourself.

### Paste this into your coding agent

```text
Add E2B sandboxes to this Agno project.

1. Install agno and e2b_code_interpreter using the project's package manager.
2. The toolkit needs the E2B_API_KEY environment variable. If it isn't set, ask me for my API key from https://console.e2b.dev/?tab=keys. Never hardcode it.
3. Follow the Agno guide at https://docs.e2b.dev/agents/agno and give my agents E2BTools with an explicit include_tools allowlist, so the Python they write runs in an E2B sandbox. Call shutdown_sandbox() in a finally block.
4. Run the agent once and show me the output that came from the sandbox.
```

## Or set it up yourself

### 1. Install the dependencies

```bash
uv pip install agno e2b_code_interpreter openai
```

### 2. Set your API keys

```bash
export E2B_API_KEY="e2b_..."
export OPENAI_API_KEY="..."
```

### 3. Give the toolkit to an agent

```python
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.e2b import E2BTools

e2b_tools = E2BTools(
    timeout=600,
    sandbox_options={"allow_internet_access": False},
    include_tools=["run_python_code"],
)

agent = Agent(
    name="Code Execution Sandbox",
    model=OpenAIResponses(id="gpt-5.4-mini"),
    tools=[e2b_tools],
    instructions=[
        "Use the E2B sandbox to execute Python code for calculations.",
        "Verify the result before responding.",
    ],
)
```

### 4. Run your agent

```python
try:
    agent.print_response(
        "Write Python code to generate the first 10 Fibonacci numbers."
    )
finally:
    e2b_tools.shutdown_sandbox()
```

## What runs in the sandbox

The code your agents write runs in an isolated sandbox, away from the machine running Agno.

- **Code:** Python and commands the agent runs through E2BTools, executed in an E2B Code Interpreter sandbox.
- **Tools:** include_tools limits which functions the agent can call. Leave out the host file-transfer helpers for untrusted agents.
- **Lifetime:** One sandbox per E2BTools instance, reused across calls. timeout bounds it; shutdown_sandbox() ends it.
- **Network:** sandbox_options={"allow_internet_access": False} cuts outbound access when the task doesn't need it.

## More agent frameworks

Other frameworks that run their tools on E2B.

- [CrewAI](https://e2b.dev/integrations/crewai.md): Give CrewAI agents E2B tools for shell commands, Python, and files with the crewai-tools[e2b] extra.
- [Pydantic AI](https://e2b.dev/integrations/pydantic-ai.md): Run Pydantic AI agent tools in E2B through the pydantic-ai-harness E2B sandbox.
- [Google ADK](https://e2b.dev/integrations/google-adk.md): Use E2B as the code execution environment for Google ADK agents in Python.

## Links

- [Get API key](https://console.e2b.dev/?tab=keys)
- [Read the docs](https://docs.e2b.dev/agents/agno)
- [E2B documentation](https://docs.e2b.dev)
