Flue
Point a Flue agent's file and shell tools at an E2B sandbox. The E2B blueprint adds a small adapter to your repo, so bash runs in a Firecracker microVM, not on your host.
- Flue
- Blueprint from flue add
- e2b
- TypeScript
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 Flue project.
- 1.Install the e2b package using the project's package manager.
- 2.The E2B SDK reads the E2B_API_KEY environment variable. If it isn't set, ask me for my API key from https://console.e2b.dev/?tab=keys and put it in .env. Never hardcode it.
- 3.Follow the Flue guide at https://docs.e2b.dev/agents/flue. Apply the blueprint from npx flue add sandbox e2b --print, then create the sandbox inside useSandbox's createSandbox() and wrap it with e2b(sandbox).
- 4.Run the agent once with flue run and show me the output that came from the sandbox.
Or set it up yourself
1. Add the E2B SDK
2. Set your API keys
3. Add the adapter
4. Write and run the agent
What runs in the sandbox
The agent's file and shell tools run in an isolated sandbox, away from your host.
- read, write, edit, bash, grep and glob from useSandbox(), mapped to sandbox.files and sandbox.commands.
- Commands run in a Firecracker microVM with a Debian toolchain, not as processes on your host.
- Key the sandbox on options.id and reconnect with Sandbox.connect() to keep one workspace per conversation.
- The default timeout is 5 minutes; set timeoutMs. Flue never kills the sandbox, so call sandbox.kill() yourself.
More agent frameworks
Other frameworks that run their tools on E2B.
- Vercel AI SDKGive Vercel AI SDK agents sandbox tools with @e2b/ai-sdk-sandbox. Experimental for AI SDK 7.
- MastraGive Mastra agents an E2B workspace or a full desktop with @mastra/e2b and @mastra/e2b-desktop.
- OpenAI Agents SDKUse the built-in E2B sandbox client in the OpenAI Agents SDK to give agents a real machine.
