Show HN: Libretto – Making AI browser automations deterministic
TL;DR Highlight
Give coding agents a live browser and get replayable Playwright scripts instead of runtime agents
Who Should Read
Integration or backend developers whose runtime-agent browser automations keep breaking
Core Mechanics
- Libretto is a browser toolkit for agents
- It gives a coding agent a live browser and a token-efficient CLI.
- Saffron Health built it to maintain healthcare software integrations and open-sourced it under MIT.
- Four things the agent can do
- Inspect live pages with minimal context.
- Capture network traffic to reverse-engineer site APIs.
- Record user actions and replay them as scripts.
- Debug broken workflows interactively on the real site.
- Turn UI automation into direct API calls
- It reads network requests to figure out the API and writes a script that calls it directly.
- The README says direct API calls are faster and more reliable than UI automation.
- You can also ask for a security analysis of the requests.
- Agents fix broken selectors
- They reproduce the failure, pause the workflow, inspect the live page, and fix it.
- Failed or paused workflows keep the browser open so you can see the exact page state.
- Setup and CLI are simple
- npm install libretto, then npx libretto setup creates .libretto/, installs skills and Chromium.
- Commands include open, run, snapshot, exec, and close.
- snapshot captures a screenshot plus a compact accessibility tree.
- Still early stage
- APIs may change before 1.0, so pin versions in production.
- CLI telemetry is on by default; disable with LIBRETTO_TELEMETRY_DISABLED=1 or DO_NOT_TRACK=1.
Community Reactions
- Snapshot analysis still seems to need an API key, one commenter said
- They already have a Claude Code subscription and don't want to pay extra credits.
- They suggested exporting the snapshot to a file and letting a Claude Code subagent analyze it.
- Others built similar things internally
- One commenter had the agent maintain the code while the code is just an optimization, and the agent fixes it when it breaks.
- Another found runtime agents brittle against anti-bot defenses, like debugging a black box.
- Retriever AI described a browser-extension version of the idea
- You record a task, it reverse-engineers the APIs and writes a script that runs inside the page so auth and headers are added automatically.
- They said reuse costs zero tokens once parameters are supplied.
- Concerns about PHI and determinism
- One commenter asked whether there is a BAA with Claude, since the demo may expose PHI.
- Others asked how LLMs give deterministic output, and one argued complex cases need a mix of both.
- A common Playwright workflow was shared
- One commenter explores with playwright-cli, generates code for a repeatable workflow, then wraps it as agent skills.
- They said console and network inspection are a big help for debugging.
How to Apply
- Install Libretto and generate one script today
- In an empty project, run npm install libretto and npx libretto setup.
- Ask your coding agent to scrape a public site using the Libretto skill.
- Have the agent fix a broken browser script
- Point to an integration.ts that throws selector errors and ask for a fix with the Libretto skill.
- Re-run with npx libretto run ./integration.ts --headless to verify.
- Convert a UI script into network-call script
- Pick one frequently used UI automation and ask for a direct network-request version.
- Request the security analysis to check whether this approach is safe.
- Pin the version and set telemetry before production
- Pin the libretto version in package.json.
- Set LIBRETTO_TELEMETRY_DISABLED=1 if needed.
Try It
# Paste into a coding agent like Claude Code (after: npm install libretto && npx libretto setup)
Use the Libretto skill.
Create a Playwright script that fetches {{items to collect}} from {{URL}} and save it to ./integration.ts.
If login is required, open a browser window and wait until I log in.
Afterward, analyze the network requests and tell me whether a version that calls the API directly is possible.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques