Skip to main content

Agent frameworks & SDKs

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.

Maintained by
Flue
How it works
Blueprint from flue add
Package
e2b
Language
TypeScript

Set it up

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. 1.Install the e2b package using the project's package manager.
  2. 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. 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. 4.Run the agent once with flue run and show me the output that came from the sandbox.

Or set it up yourself

  1. 1. Add the E2B SDK

    npx @flue/cli@latest init . --target node
    npm install
    npm install e2b
  2. 2. Set your API keys

    E2B_API_KEY="e2b_***"
    ANTHROPIC_API_KEY="sk-ant-***"
  3. 3. Add the adapter

    npx flue add sandbox e2b --print | claude
  4. 4. Write and run the agent

    'use agent';
    import { useModel, useSandbox } from '@flue/runtime';
    import { Sandbox } from 'e2b';
    import { e2b } from '../sandboxes/e2b.ts';
    
    export function Analyst() {
      useModel('anthropic/claude-sonnet-4-6');
    
      useSandbox({
        async createSandbox(options) {
          const sandbox = await Sandbox.create({
            timeoutMs: 10 * 60_000,
            metadata: { framework: 'flue', agent: 'analyst' },
          });
          return e2b(sandbox).createSandbox(options);
        },
      });
    
      return 'You work in a Linux sandbox. Use bash for anything about the machine or its files.';
    }

Security

What runs in the sandbox

The agent's file and shell tools run in an isolated sandbox, away from your host.

  • Toolsread, write, edit, bash, grep and glob from useSandbox(), mapped to sandbox.files and sandbox.commands.
  • IsolationCommands run in a Firecracker microVM with a Debian toolchain, not as processes on your host.
  • StateKey the sandbox on options.id and reconnect with Sandbox.connect() to keep one workspace per conversation.
  • LifetimeThe default timeout is 5 minutes; set timeoutMs. Flue never kills the sandbox, so call sandbox.kill() yourself.

3B+ sandboxes started

Give every agent a machine