The current state of AI browser automation is a mess of bloated DOM dumps and rigid sleep timers that drain API budgets and miss dynamic content. Enter Agent First Browse, a new open-source project from SandeepAi369 that claims to treat the browser as a structured, verifiable environment rather than a black box. By leveraging accessibility-tree-first perception and incremental delta snapshots, the tool reports a 12.0x speed increase and a 54.8% reduction in prompt tokens per step compared to legacy methods.
Architecture and Core Innovations
The engineβs primary trick is replacing fixed 1.5-second sleeps with an adaptive DOM settle mechanism using MutationObserver quiet windows. This allows the agent to perceive changes exactly when the Single Page Application (SPA) finishes rendering, cutting perception latency significantly. Furthermore, the system employs Paint-Order Occlusion Pruning, which uses live elementFromPoint and Shadow DOM hit-testing to remove background links trapped behind modals and cookie walls. In stress tests involving blocking modals, this feature alone saved 95% of tokens by pruning 44 occluded elements.
Zero-API Control and Verification
Agent First Browse is designed for agents that need to operate without external LLM API keys for the browser control layer itself. It offers native MCP (Model Context Protocol) stdio tools and a CLI daemon, allowing direct integration with coding agents like Claude Code, Cursor, and Gemini CLI. The architecture includes a LangGraph verification brain that handles autonomous tasks, but the 'agent-first' design means external AI agents can drive the browser directly. Security is handled via defense-in-depth, masking passwords and OTPs before they ever reach the prompt, while enforcing RFC 6890 SSRF URL policies to prevent server-side request forgery.
Benchmark Performance
The project provides a detailed benchmark matrix measured on live headed Chromium instances. On Hacker News, the V2 engine reduced step time from 1,528 ms to 153 ms, while dropping token usage from ~2,194 to a range of 482β1,419 tokens depending on the delta. In scenarios with custom ARIA widgets where legacy scanners failed to find any elements, the V2 engine automatically escalated to Tier-2 Accessibility Trees, successfully identifying four interactive elements. The cumulative session average across all scenarios shows a drop from 1,164.4 ms and 754.2 tokens/step down to 96.8 ms and 341.1 tokens/step.
Key Takeaways
- Delta Snapshots: Consecutive steps on the same URL only emit added, changed, or removed controls, reducing token usage by 35β79%.
- Zero-API Integration: Native MCP and CLI support allow agents like Cursor or Claude Code to control the browser without needing separate API keys for the automation layer.
- Stale-Ref Recovery: The system semantically rebinds buttons moved by SPA re-renders, preventing the common failure mode of clicking stale coordinates.
- Robust Safety: Built-in redaction of secrets (passwords, PINs) and SSRF protection ensure that sensitive data doesn't leak into LLM prompts.
The Bottom Line
Agent First Browse finally fixes the token-burning inefficiency of browser agents by treating the DOM as a verifiable, delta-driven state machine rather than a static dump. If these benchmarks hold in production, this is the missing infrastructure layer for cost-effective autonomous web interaction.