{"slug": "the-browser-agent-stack-explained", "title": "The browser agent stack, explained", "summary": "Lightpanda cofounder Katie Brown explains the four-layer browser agent stack—model, harness, browser driver, and engine—and positions Lightpanda's specialist agent as a single binary that combines the agent, driver, and engine, offering faster performance and lower memory usage than generalist alternatives.", "body_md": "# The browser agent stack, explained\n\n### Katie Brown\n\n#### Cofounder & COO\n\n## TL;DR\n\nThis post maps the browser agent stack layer by layer, and explains why we\nbuilt a specialist instead of a generalist. `lightpanda agent`\n\nis the agent, the\nbrowser drivers, and the engine compiled into one binary.\n\n## Why browser agents are hard to compare\n\nBrowser agents are hard to compare because the stack is noisy and many projects\noccupy multiple layers of the same stack. Sometimes the names complicate things\nfurther. [browser-use ](https://github.com/browser-use/browser-use) sounds like\nan instruction. [agent-browser ](https://github.com/vercel-labs/agent-browser) sounds like a browser. Both are tools that sit in\nthe middle, between an agent and a browser\nengine.\n\nThe layer a project occupies decides what it can do for you and what you still\nneed around it. Lightpanda has its [own\nagent ](https://lightpanda.io/blog/posts/introducing-lightpanda-agent-and-pandascript)\nwhich has a unique positioning in this fragmented stack, so we wanted to\nexplain how we fit in with everything else out there.\n\n## The browser agent stack\n\nEvery browser agent runs the same loop underneath. A model decides on an action, something executes that action against a browser, and the result comes back to inform the next decision. The stack that runs this loop has four layers.\n\n**The model.** A large language model (LLM): Claude, GPT, Gemini, or a local model\n(e.g. Ollama). It reads context and picks the next action. It can’t fetch a\npage or click a button on its own.\n\n**The harness.** The agent program wrapped around the model. It holds the\nconversation, exposes tools, executes tool calls, and feeds results back.\nClaude Code, Codex, OpenClaw, and Nous Research’s Hermes Agent all live here.\nThese are generalists: they read files, run shell commands, manage repos,\nanswer email. The browser is one tool among many.\n\n**The browser driver.** The harness needs hands on the browser. agent-browser,\nbrowser-use, Stagehand, and Lightpanda’s MCP server all live here, and so do\nPuppeteer and Playwright, as libraries your code imports rather than tools an\nagent calls. agent-browser is a clean example of the agent-facing shape: a CLI\nwith commands like `open`\n\n, `snapshot`\n\n, `click`\n\n, and `get`\n\n, translated into the [Chrome\nDevTools Protocol ](https://lightpanda.io/blog/posts/cdp-under-the-hood) (CDP)\nunderneath. Lightpanda’s MCP server is the exception: MCP lets a harness call\nour native tools directly, so nothing passes through\nCDP on the way to the engine.\n\n**The engine.** The browser itself. It loads pages and runs their JavaScript,\nexposing the resulting DOM (Document Object Model) to whatever sits above.\nChromium is the default everywhere. Lightpanda is the alternative: built from\nscratch in Zig with no rendering pipeline, so it runs [9x faster and uses 16x\nless memory ](https://lightpanda.io/blog/posts/from-local-to-real-world-benchmarks) than headless Chrome.\n\nEvery boundary between layers is a translation. The harness serializes a tool call, the browser driver turns it into CDP messages, the engine executes, and the result climbs back up. Each step adds latency, CPU and memory usage. Everything that reaches the model costs tokens.\n\n## Where agent-browser sits\n\nagent-browser is Vercel’s browser automation tool for AI agents, and it\noccupies the browser driver layer. You open a page, take a snapshot, and get\nback a compact accessibility tree where each element carries a short ref like\n`@e1`\n\n. The agent reads the tree, picks a ref, and acts on it. A snapshot runs\naround 200 to 400 tokens, against the 3,000 to 5,000 you’d spend dumping raw\nDOM. browser-use and Stagehand work the same layer with different surfaces:\nbrowser-use hands the model raw page HTML, and Stagehand mixes code with\nnatural language actions. Both require access to an LLM.\n\nagent-browser doesn’t have its own browser. It needs an engine below it. That engine is Chromium by default, and Lightpanda with one flag:\n\n```\nexport AGENT_BROWSER_ENGINE=lightpanda\nagent-browser open https://example.com\nagent-browser snapshot -i\n```\n\n[Our guide to running agent-browser on\nLightpanda ](https://lightpanda.io/blog/posts/using-lightpanda-with-agent-browser)\ncovers the setup in detail.\n\n## Where Lightpanda agent sits\n\n`lightpanda agent`\n\ncovers the harness, the browser drivers, and the engine in a\nsingle binary. Point it at a model provider (Anthropic, OpenAI, Gemini, Hugging\nFace, Mistral or local) and talk to it in natural language.\n\nBecause the agent runs in-process against Lightpanda’s own engine, there’s no CDP inside the loop. A click is a native function call instead of a multiple messages over a WebSocket to a separate browser process.\n\nOwning the loop has a second consequence: the LLM can run at buildtime instead\nof runtime. The agent works through a task once, then hands you a\n[PandaScript ](https://lightpanda.io/docs/usage/pandascript),\na plain JavaScript file that replays the session deterministically. Replays run\nwith no model in the loop, so they cost zero tokens. You pay for reasoning once\nand keep the script.\n\n## agent-browser vs Lightpanda agent\n\nagent-browser gives an agent you already run a way to drive a browser.\n`lightpanda agent`\n\nis a browsing agent you run directly.\n\nIf you live inside Claude Code or Codex and want to give it web access, we\nrecommend using `lightpanda mcp`\n\n: native tooling the agent uses, exposed to your\nharness directly over MCP. If the task itself is browsing (scraping, price\nmonitoring, form filling, scheduled checks), you can skip the harness and use\nthe specialist: `lightpanda agent`\n\n.\n\nAgent-browser is also a strong choice, and it gets faster when you put\nLightpanda underneath it. The two best configurations [we’ve\nmeasured ](https://lightpanda.io/blog/posts/benchmarking-native-agent) across\nour benchmarks are agent-browser on Lightpanda and Lightpanda’s native agent.\n\n## One binary\n\nLightpanda crosses three different parts of this stack, but they are all included in a single binary:\n\n`serve`\n\n: the engine speaking CDP so existing Puppeteer and Playwright scripts, or agent-browser, can drive it.`mcp`\n\n: engine plus tool layer, for an external harness that brings its own model and loop.`agent`\n\n: engine, tools, and loop together, talking to the model directly, or to no model at all.\n\nThe MCP server and the agent are inside the browser binary itself, rather than as companion processes, and the MCP door exists precisely so other tools can use Lightpanda without adopting our agent.\n\nThe native tools are shared across all three. `goto`\n\n, `click`\n\n, `fill`\n\n, `extract`\n\n,\n`evaluate`\n\n, and `search`\n\nare engine-level commands, and the same implementations\nback the MCP server and the agent’s own loop.\n\nNone of this works as a bolt-on. A Chromium setup means an automation layer in\nits own Node or a Python process plus a browser process beside it, each one\nmore thing to install and keep alive, and a protocol between them. Every call\npays the translation tax: serialize, cross the process boundary, deserialize,\nand carry the result back. Because [we built the browser from\nscratch ](https://lightpanda.io/blog/posts/why-build-a-new-browser), the\nsnapshot logic sits next to the DOM it reads and the agent loop sits next to\nthe engine it drives.\n\n## Try it\n\nThe [agent\ntutorial ](https://lightpanda.io/docs/guides/lightpanda-agent-tutorial) walks\nyou through a complete session: log in, extract data, save the script, replay\nit without a model. It takes under 10 minutes.\n\n## FAQ\n\n### What is the browser agent stack?\n\nIt’s the set of layers between a language model and a web page: the model that decides, the harness that runs the agent loop, the browser driver that executes actions, and the engine that loads web pages and runs JavaScript. Most browser agents wire four separate things together, one per layer. Lightpanda covers the bottom three layers in one binary, with the model as the only external piece.\n\n### What is agent-browser?\n\nagent-browser is Vercel’s open-source browser automation tool for AI agents. A\nharness like Claude Code shells out to it, receives pages as compact\naccessibility-tree snapshots with short element refs, and acts on those refs.\nIt drives a browser over CDP: Chromium by default, or Lightpanda via the\n`--engine lightpanda`\n\nflag.\n\n### How is Lightpanda agent different from agent-browser?\n\nagent-browser sits in the middle of the stack, with a harness above it and a browser engine below it. Lightpanda agent covers the whole column: the loop, the native browser drivers, and the engine run in one process, with no CDP between the agent and the page. It can also record a session as a PandaScript and replay it with no model involved.\n\n### Can my existing agent use Lightpanda without the built-in agent?\n\nYes. Run `lightpanda mcp`\n\nand any MCP-aware harness, Claude Code included,\nconnects to the same native tool surface the built-in agent uses. Hermes Agent\nsupports Lightpanda as a browser backend. Existing Puppeteer and Playwright\nscripts work against `lightpanda serve`\n\nover CDP.\n\n### Does Lightpanda agent use CDP?\n\nNo, deliberately. The agent calls the engine in-process, so a click is a native\nfunction call rather than a protocol message to a separate browser. CDP support\ncontinues through `lightpanda serve`\n\n, which we are actively developing for\nPuppeteer, Playwright, and agent-browser users.\n\n### Is Lightpanda competing with generalist agents like Hermes or OpenClaw?\n\nNo. Generalist agents handle many kinds of work, and browsing is one tool among many for them. Lightpanda does the browsing and composes with generalists through its MCP server. Hermes Agent already supports Lightpanda as a browser backend.\n\n### Katie Brown\n\n#### Cofounder & COO\n\nKatie led the commercial team at BlueBoard, where she met Pierre and Francis. She rejoined them on the Lightpanda adventure to lead GTM and to keep the product closely aligned with what developers actually need. She also drives community efforts and, by popular vote, serves as chief sticker officer.", "url": "https://wpnews.pro/news/the-browser-agent-stack-explained", "canonical_source": "https://lightpanda.io/blog/posts/the-browser-agent-stack-explained", "published_at": "2026-07-06 00:00:00+00:00", "updated_at": "2026-07-07 01:28:09.199541+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "developer-tools"], "entities": ["Lightpanda", "Katie Brown", "Claude", "GPT", "Gemini", "Vercel", "Chromium", "Zig"], "alternates": {"html": "https://wpnews.pro/news/the-browser-agent-stack-explained", "markdown": "https://wpnews.pro/news/the-browser-agent-stack-explained.md", "text": "https://wpnews.pro/news/the-browser-agent-stack-explained.txt", "jsonld": "https://wpnews.pro/news/the-browser-agent-stack-explained.jsonld"}}