Skip to main content

Overview

E2BTools extends ToolKit and uses the E2B cloud sandbox for running code, shell commands, and managing files in an isolated environment. Supports Python, JavaScript, Java, R, and Bash.
ToolKit: E2BTools inherits from ToolKit. You get all base behavior (e.g. include_tools, exclude_tools, timeout, use_async). See Creating ToolKit for the full API.
Required: Set E2B_API_KEY (env or .env). Install: uv pip install e2b-code-interpreter.
Tools (10): e2b_run_code, e2b_run_command, e2b_install_packages, e2b_upload_file, e2b_download_file, e2b_list_files, e2b_write_file, e2b_read_file, e2b_get_sandbox_info, e2b_shutdown_sandbox. Use ToolKit’s exclude_tools / include_tools to limit which tools the agent sees.
All tools are prefixed with e2b_ (e.g. e2b_run_code, e2b_write_file) to avoid name collisions with local filesystem tools or other sandbox toolkits when used alongside AutonomousAgent.

Examples

Basic: Agent with E2B


AutonomousAgent: Local Filesystem + Remote Sandbox

The most powerful pattern: the agent edits files locally in the workspace, but all code execution happens in a secure remote sandbox.

Advanced: Custom Sandbox Options


Multi-language Code Execution


Parameters


Tools Reference

Code Execution

Sandbox File Operations

Sandbox Management