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.
- E2B
- Built into ADK, plus a plugin
- e2b-adk
- Python
Get started
Paste the prompt into your coding agent, or follow the steps yourself.
Paste this into your coding agent
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
2. Set your API keys
3. Create the plugin and agent
4. Run the agent
What runs in the sandbox
Tool calls your agent makes run in an isolated sandbox, away from the machine running ADK.
- run_code runs code in a stateful kernel, so variables persist across calls.
- Six tools share one sandbox: run_code, run_command, write_file, read_file, list_files and start_background_command.
- The plugin creates the sandbox on the first tool call and kills it when the runner closes. Each call extends the timeout.
- 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.
