High-Speed, Zero-Token-Waste Autonomous Browser Engine for AI Agents
Описание и применение
Модуль agent-browser-mesh снижает токенов и время выполнения автономных браузерных агентов, заменяя снимки экрана и большие DOM‑дампы семантически сжатой передачей изменённых узлов, при этом обеспечивает защиту от внедрения запросов.
Задача
Full-page screenshots for vision LLMs consume ~1,500 tokens per action and 3–6 s per step, creating a Vision Token Tax that hinders multi-step web scraping, form filling, and research tasks.
Результат
Agent-browser-mesh reduces token consumption by 92 % and step latency by 95 % compared to screenshots or raw HTML dumps, while adding robust prompt‑injection protection.
Рабочий процесс
- Install agent-browser-mesh via pip
- Instantiate BrowserMesh with BrowserConfig(headless=True, block_trackers=True)
- Navigate to target URL with mesh.navigate
- Retrieve semantically grounded interactive elements via page.get_interactive_elements()
- Execute actions (e.g., click_element) with safety inspection
Доказательства
When building autonomous browser agents with Playwright, Selenium, or Puppeteer, taking full-page screenshots and feeding them to vision LLMs burns over 1,500 tokens per action and takes 3 to 6 seconds per step.
Only transmits DOM nodes that actually changed between agent steps, cutting token consumption by over 92%.
Sub-Millisecond Security Gate (<0.4ms): Intercepts indirect prompt injection payloads hidden inside HTML comments, hidden divs, and image alt tags before they enter the LLM reasoning loop.
Token Cost per Step: ~1,600 tokens (screenshots) vs ~180 tokens (agent-browser-mesh) (-92%)
Step Latency: 3,200ms (screenshots) vs 140ms (agent-browser-mesh) (-95%)
- Дата записи: 2026-11-04T01:14:00.292Z