← Back to Registry
E2B

E2B

Beta
Sandbox Mounting

Run sandboxes on E2B's cloud infrastructure for secure, ephemeral environments.

1. Install

npm install @rivet-dev/agentos-sandbox sandbox-agent

2. Add to agentOS

Mount a E2B sandbox into the VM with @rivet-dev/agentos-sandbox.

import { agentOS, setup } from "@rivet-dev/agentos";
import { createSandboxFs, createSandboxToolkit } from "@rivet-dev/agentos-sandbox";
import { SandboxAgent } from "sandbox-agent";
import { e2b } from "sandbox-agent/e2b";

// Start a E2B-backed sandbox and mount it into the VM
const sandbox = await SandboxAgent.start({ sandbox: e2b() });

const vm = agentOS({
  mounts: [{ path: "/home/agentos/sandbox", plugin: createSandboxFs({ client: sandbox }) }],
  toolKits: [createSandboxToolkit({ client: sandbox })],
});

export const registry = setup({ use: { vm } });