Using AgentKit with E2B
Develop Coding Agents using E2B Sandboxes as tools
E2B is an open-source runtime for executing AI-generated code in secure cloud sandboxes. Made for agentic & AI use cases.
E2B is a perfect fit to build Coding Agents that can write code, fix bugs, and more.
Setup
Install AgentKit and E2B
Within an existing project, Install AgentKit and E2B from npm:
Setup your Coding Agent
Create a Agent and its associated Network:
Create the E2B Tools
To operate, our Coding Agent will need to create files and run commands.
Below is an example of how to create the createOrUpdateFiles
and terminal
E2B tools:
You will find the complete example in the E2B Coding Agent example.
Designing useful tools
As covered in Anthropic’s “Tips for Building AI Agents”, the best Agents Tools are the ones that you will need to accomplish the task by yourself.
Do not map tools directly to the underlying API, but rather design tools that are useful for the Agent to accomplish the task.
Examples
Replicate Cursor's Agent mode
This examples shows how to use E2B sandboxes to build a coding agent that can write code and run commands to generate complete project, complete refactoring and fix bugs.
AgentsToolsNetworkIntegrations
Code-based Router
AI-powered CSV contacts importer
Let’s reinvent the CSV upload UX with an AgentKit network leveraging E2B sandboxes.
AgentsToolsNetworkIntegrations
Code-based Router