{"slug": "show-hn-browser-tools-sdk-an-optimal-browser-harness-for-agents", "title": "Show HN: Browser Tools SDK – an optimal browser harness for agents", "summary": "Libretto has open-sourced the Browser Tools SDK, a TypeScript package that gives AI agents a production-ready browser harness with just a few lines of code. In benchmarks against agent-browser, playwright-cli, and dev-browser on 26 live-site tasks using GPT 5.6 Sol, the SDK tied for the best pass rate at 24/26 and was about 55% cheaper per successful task ($0.106 vs $0.235) while using fewer tokens (1.45M vs 2.29M+). The SDK exposes only 6 tools, with the key ones being browser_snapshot and browser_exec, and works with AI SDK and Pi out of the box.", "body_md": "We’re open-sourcing Browser Tools SDK: a small TypeScript package to give any AI agent a reliable way to control a real browser. With just a few lines of code, you can give any agent a production-ready browser harness\n\n``` js\n  import { createAiSdkBrowserTools } from \"libretto-browser-tools/ai-sdk\";\n  import { LocalBrowserProvider } from \"libretto-browser-tools\";\n\n  const { tools } = createAiSdkBrowserTools(new LocalBrowserProvider());\n\n  const result = await generateText({\n    model: anthropic(\"claude-sonnet-4-5\"),\n    tools,\n    prompt: \"Go to Hacker News and tell me the top story\",\n  });\n```\n\nWe built the Browser Tools SDK because access to a browser is one of the most important tools of a productive agent, but we found many of the existing tools lacking. Using the insights we gained building Libretto, we were able to build the SDK so that it’s significantly more context and cost-efficient than other tools:We compared Browser Tools SDK against agent-browser, playwright-cli, and dev-browser on 26 live-site tasks with GPT 5.6 Sol (best results from 3 runs). Browser Tools tied for the best pass rate at 24/26 and came in about 55% cheaper per successful task than the next alternative ($0.106 vs $0.235) while also using far fewer tokens (1.45M vs 2.29M+). Benchmark methodology is in the repo.\n\nThe Browser Tools SDK only exposes 6 tools, of which only 2 are really important: `browser_snapshot` and `browser_exec`. The snapshot tool was designed from the ground up to be extremely context-efficient and provide agents the overview they need to know what to try next. The exec tool takes and executes raw Playwright code, of which the models have been trained on heaps of, and know how to use without much direction.\n\nWorks with AI SDK and Pi out of the box, plus a custom path for anything else. More frameworks are coming soon. You can also use any browser infra provider (Libretto Cloud, Kernel, Browserbase, etc.) or use `LocalBrowserProvider` to run Chromium locally (although that will have less anti-bot protections).\n\nMIT licensed. Check out the docs: [https://libretto.sh/docs/browser-tools/quickstart](https://libretto.sh/docs/browser-tools/quickstart) and join the Discord: [https://discord.gg/NYrG56hVDt](https://discord.gg/NYrG56hVDt).\n\nWe’d love any and all feedback.\n\nComments URL: [https://news.ycombinator.com/item?id=48998262](https://news.ycombinator.com/item?id=48998262)\n\nPoints: 2\n\n# Comments: 0", "url": "https://wpnews.pro/news/show-hn-browser-tools-sdk-an-optimal-browser-harness-for-agents", "canonical_source": "https://libretto.sh/browser-tools", "published_at": "2026-07-21 21:01:57+00:00", "updated_at": "2026-07-21 21:22:24.504035+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools"], "entities": ["Libretto", "Browser Tools SDK", "AI SDK", "Pi", "Playwright", "GPT 5.6 Sol", "Claude Sonnet 4.5"], "alternates": {"html": "https://wpnews.pro/news/show-hn-browser-tools-sdk-an-optimal-browser-harness-for-agents", "markdown": "https://wpnews.pro/news/show-hn-browser-tools-sdk-an-optimal-browser-harness-for-agents.md", "text": "https://wpnews.pro/news/show-hn-browser-tools-sdk-an-optimal-browser-harness-for-agents.txt", "jsonld": "https://wpnews.pro/news/show-hn-browser-tools-sdk-an-optimal-browser-harness-for-agents.jsonld"}}