---
title: "Google ADK integration"
description: "Give Google ADK agents an E2B sandbox for code, commands and files, with ADK's built-in E2BEnvironment or the e2b-adk plugin's sandbox tools."
url: "https://e2b.dev/integrations/google-adk"
---

# Google ADK

> Give Google ADK agents an isolated sandbox for code, shell commands and files. Use ADK's built-in E2BEnvironment, or the e2b-adk plugin to hand the model ready-made sandbox tools.

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

## About this integration

- **Maintained by:** E2B
- **How it works:** Built into ADK, plus a plugin
- **Package:** e2b-adk
- **Language:** Python
- **Upstream:** [google/adk-python · ★ 22k](https://github.com/google/adk-python)
- **Example:** [e2b-dev/e2b-adk-plugin](https://github.com/e2b-dev/e2b-adk-plugin/tree/main/packages/e2b-adk-python/examples)

## 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 Google ADK project.

1. Install e2b-adk using the project's package manager.
2. The plugin 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 Google ADK guide at https://docs.e2b.dev/agents/google-adk. Create an E2BPlugin, give my agent plugin.get_tools(), and register the plugin on the App so the runner creates and closes the sandbox.
4. Run the agent once and show me the output that came from the sandbox.
```

## Or set it up yourself

### 1. Install the plugin

```bash
pip install e2b-adk
```

### 2. Set your API keys

```bash
export E2B_API_KEY="..."
export GOOGLE_API_KEY="..."
```

### 3. Create the plugin and agent

```python
from google.adk.agents import Agent
from google.adk.apps import App

from e2b_adk import E2BPlugin

plugin = E2BPlugin()
agent = Agent(
    model="gemini-2.5-flash",
    name="data_analyst",
    instruction="You are a data analyst. Compute numbers by running real pandas with run_code.",
    tools=plugin.get_tools(),
)
app = App(name="data_analysis", root_agent=agent, plugins=[plugin])
```

### 4. Run the agent

```python
from google.adk.runners import InMemoryRunner

DATASET = """month,region,marketing_spend,revenue
2024-01,North,12000,48000
2024-02,North,15000,61000
2024-01,South,8000,26000
2024-02,South,11000,30000"""

async with InMemoryRunner(app=app) as runner:
    await runner.run_debug(
        f"Here is marketing spend and revenue as CSV:\n\n{DATASET}\n\n"
        "Save it to sales.csv, then tell me which region converts spend into "
        "revenue more efficiently and which month performed best."
    )
```

## What runs in the sandbox

Tool calls your agent makes run in an isolated sandbox, away from the machine running ADK.

- **Code:** run_code runs code in a stateful kernel, so variables persist across calls.
- **Tools:** Six tools share one sandbox: run_code, run_command, write_file, read_file, list_files and start_background_command.
- **Lifetime:** The plugin creates the sandbox on the first tool call and kills it when the runner closes. Each call extends the timeout.
- **Idle gaps:** Pass lifecycle with on_timeout pause and auto_resume to keep the sandbox across gaps longer than timeout.

## More agent frameworks

Other frameworks that run their tools on E2B.

- [Agno](https://e2b.dev/integrations/agno.md): Add Agno's built-in E2BTools so agents can run code and commands in a sandbox.
- [Pydantic AI](https://e2b.dev/integrations/pydantic-ai.md): Run Pydantic AI agent tools in E2B through the pydantic-ai-harness E2B sandbox.
- [OpenAI Agents SDK](https://e2b.dev/integrations/openai-agents-sdk.md): Use the built-in E2B sandbox client in the OpenAI Agents SDK to give agents a real machine.

## Links

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