← All frameworks

E2B

Sandboxes so agents can run the code they write.

Infrastructure

An agent that writes code eventually has to run it, and running it on your machine is not an option. E2B gives you a secure cloud sandbox that starts in around a hundred milliseconds, with a filesystem and internet access.

Reach for it when

  • Your agent generates and executes code
  • You need real isolation, not a try except block
  • You want a filesystem the agent can work in

Look elsewhere when

  • Your agent only calls APIs
  • You already run your own sandbox infrastructure

What the lessons will cover

  1. 01Install and setup
  2. 02Your first sandbox
  3. 03Running code
  4. 04Files in and out
  5. 05Long running processes
  6. 06Custom templates
  7. 07Timeouts and cost
  8. 08An analyst agent

Others in infrastructure

Common questions

Is E2B free to use?

E2B is open source and free to run yourself. You still pay whichever model provider you point it at, and this tutorial is free with no signup.

Do I need to know Python to use E2B?

Basic Python is enough. Functions, dictionaries and imports cover most of what E2B asks of you.

When should I not use E2B?

Your agent only calls APIs. You already run your own sandbox infrastructure.

Lessons for E2B are being written. Meanwhile the LangGraph tutorial covers the same ground: state, tools, loops, memory and human approval. Most of it carries straight over.

Start the LangGraph tutorial →