Agent-readable docs index: /docs/llms.txt. Full docs in one file: /docs/llms-full.txt. Download /docs/docs.zip to grep all markdown files locally.

Quickstart

Install libretto-browser-tools and run a first agent browser loop.
libretto-browser-tools is an SDK that gives any agent framework tools to open a real browser (local or cloud), inspect pages via accessibility snapshots, and drive them with Playwright code. Pick a provider, wrap the tools with an adapter (or use the framework-agnostic factory), and call dispose() when the loop ends.
It is not the Libretto CLI and does not run workflow files. For CLI workflows, see Quickstart.

Agent prompt

Use this prompt with a coding agent to set up the Browser Tools SDK:
Install libretto-browser-tools with the Vercel AI SDK adapter and LocalBrowserProvider. Wire createAiSdkBrowserTools into a generateText (or ToolLoopAgent) loop, install Playwright Chromium for local sessions, run a short task that opens a page and answers a question about it, and always call dispose() when the loop ends.

Manual

Install the package into the Node.js project that will run your agent. Use your package manager's equivalent of:
pnpm add libretto-browser-tools ai @ai-sdk/anthropic npx playwright install chromium
Local sessions need a Chromium binary (LocalBrowserProvider). Cloud providers attach over CDP and do not need a local browser download.
ai is an optional peer dependency. Install it when you use the AI SDK adapter.
  1. Create the browser toolkit
    import { createAiSdkBrowserTools } from "libretto-browser-tools/ai-sdk"; import { LocalBrowserProvider } from "libretto-browser-tools"; const { tools, dispose } = createAiSdkBrowserTools( new LocalBrowserProvider({ headless: true }), );
    The agent can call browser_open, browser_connect, browser_exec, browser_snapshot, browser_status, and browser_close.
  2. Run a short agent loop
    import { anthropic } from "@ai-sdk/anthropic"; import { generateText, stepCountIs } from "ai"; try { const result = await generateText({ model: anthropic("claude-sonnet-4-5"), tools, stopWhen: stepCountIs(20), prompt: "Go to news.ycombinator.com and tell me the top story", }); console.log(result.text); } finally { await dispose(); // close any sessions the agent left open }
    Always call dispose() when the loop ends. Prefer a finally block so sessions close after failures too.
Next: Tools
Learn the inputs and outputs for each browser tool.

What to try next