Browser Automation for AI Agents: What Actually Works Dylan Worrall, founder of Froots, shares engineering patterns for reliable browser automation in AI agents. He advocates structured commands over eval, condition-based waiting instead of sleep, and confirming writes with reads to avoid silent failures. Techniques like reusing existing sessions via in-page fetch and using vision models for hostile DOMs improve robustness. Originally published at dylanworrall.com. Most agent demos that involve a browser are shot in one take for a reason. The moment you try to make browser automation reliable — running unattended, across sites you don't control, hundreds of times — it stops being a demo and starts being an engineering problem. I've spent a lot of time on that problem building the browser layer inside Froots https://froots.ai , and a handful of patterns made the difference between "works in the video" and "works at 3am while I'm asleep." eval It's tempting to give the agent one giant escape hatch: run arbitrary JavaScript in the page and parse whatever comes back. It works right up until it doesn't, and when it fails it fails opaquely. A small vocabulary of structured commands beats one omnipotent one: navigate