packages/@agent-browser/sandbox/README.md
Helpers for installing and running agent-browser inside sandbox runtimes.
This package does not define model tools. Use it from framework-specific tools, agents, route handlers, or jobs that already decide what the browser should do.
For eve agents, use @agent-browser/eve — it mounts the full browser tool set and exposes the sandbox bootstrap helpers from @agent-browser/eve/sandbox, with this package as an internal dependency.
Install @vercel/sandbox in the consuming app:
pnpm add @vercel/sandbox
Then use the Vercel provider entry:
import { runAgentBrowserCommand, withAgentBrowserSandbox } from "@agent-browser/sandbox/vercel";
const snapshot = await withAgentBrowserSandbox(async (sandbox) => {
await runAgentBrowserCommand(sandbox, ["open", "https://example.com"]);
const result = await runAgentBrowserCommand(sandbox, ["snapshot", "-i", "-c"], {
json: false,
});
return result.stdout;
});
The Vercel helpers install browser system dependencies by default. Pass installSystemDependencies: false only when the sandbox image already provides Chromium's required libraries.
Set AGENT_BROWSER_SNAPSHOT_ID to boot from a prebuilt Vercel Sandbox snapshot. Without a snapshot, the helper installs system dependencies, agent-browser, and Chrome on first boot.
By default, this package installs the matching agent-browser version:
agent-browser@0.30.1
Pass installSpec: "latest" or another npm spec to override that default.