Every agent framework claims it can "browse the web like a human." Almost none of them tell you what happens when the web page is actively trying to manipulate the thing doing the browsing.
That's not a hypothetical. It's a line buried in the README of one of the three frameworks developers are actually shipping in production right now: Playwright MCP, Microsoft's official Model Context Protocol server for browser control, states plainly that it "is not a security boundary." Not a caveat, not a known-issue ticket — a design statement, sitting next to the marketing copy about being "fast and lightweight."
That single sentence is the actual story underneath the current wave of "which browser agent framework should I use" posts. The comparisons you'll find elsewhere rank these tools on speed, DOM coverage, and how many GitHub stars they've collected. Useful, but secondary. The question that should come first for anyone about to wire an LLM into a live browser session is: what trust boundary am I handing to the model, and who eats the cost when it walks through a prompt injection on a page it was told to "read and summarize"?
This is a comparison of three frameworks solving the same problem — give an LLM the ability to click, type, and extract from a real browser — with three different answers to that question: Stagehand by Browserbase, Browser Use, and Playwright MCP. All three are live options today. All three are what a team evaluating "how do we let our agent use the web" will land on within the first afternoon of research. None of them solve the problem outlined above — and the ways they don't are different enough to matter.
Why this comparison matters right now
Two things converged to make "AI agent drives a browser" a mainstream engineering task instead of a research demo.
First, Model Context Protocol gave every agent runtime — Claude, ChatGPT, custom LangGraph pipelines, whatever — a standard way to call out to a browser-control tool without hand-rolling the plumbing. Browser automation used to be something you built into your agent. Now it's something you attach as a tool server, and Playwright MCP is the reference implementation for doing that with the industry's dominant automation library.
Second, the agents themselves got good enough at multi-step reasoning that "go to this site, find this thing, fill out this form, confirm the result" stopped being a novelty and started being a real product feature: expense report automation, competitive price monitoring, QA regression suites written in English instead of selectors, lead-gen scrapers that adapt when a target site redesigns its DOM. Browser Use's own benchmark push — landing at the top of the Odysseys leaderboard with an 87.4% success rate across 200 long-horizon web tasks — is aimed squarely at convincing teams this is now reliable enough to trust with real workflows, not just demos.
Once you accept that browser-driving agents are going into production, the framework choice stops being academic. It determines your token bill, your failure mode when a target site changes its markup, and — the part nobody puts in the pitch deck — how much of your security posture you've outsourced to whichever LLM is deciding what to click next.
This also isn't a three-way tie between interchangeable options, the way "which testing framework" comparisons often are. Playwright MCP is infrastructure you compose into an agent you already run. Stagehand is a library you write code against. Browser Use is closer to a finished agent you hand a task to. Picking between them is closer to picking between "a socket set," "a power drill," and "a contractor" than it is to picking between three flavors of the same tool — which is exactly why the framing of most existing comparisons, ranking them on a single leaderboard, undersells how different the actual engineering commitment is in each direction.
What each one actually does
Playwright MCP is not an agent. It's a tool server. It wraps Playwright, Microsoft's browser automation library, and exposes its capabilities — navigate, click, type, screenshot, extract — as MCP tools that any LLM-based agent can call. The agent still does all the reasoning; Playwright MCP just gives it a hand to move. It ships two flavors: the general MCP server for agentic runtimes, and a purpose-built @playwright/cli aimed specifically at coding agents, which its own docs claim uses up to 4x fewer tokens than the general MCP approach for the coding-agent use case.
Stagehand is an SDK, not a raw tool wrapper. It gives you three primitives — act() to perform a natural-language action, observe() to identify what's actionable on the page, and extract() to pull structured data out using a schema (Zod on the TypeScript side) — and lets you mix them with deterministic Playwright-style code wherever you don't need the LLM in the loop. That's the pitch: dial between "just tell it what to do" and "write it like a normal test script," in the same codebase.
Browser Use is closer to a full autonomous agent out of the box. Give it a task in natural language and it drives the browser end-to-end — reading the DOM, optionally looking at the rendered page, deciding what to click — without you writing action-by-action code at all. It supports OpenAI, Anthropic, and Google models, plus its own purpose-tuned bu-* model series, through a unified ChatBrowserUse interface.
A rough mental model: Playwright MCP hands the LLM a toolbox. Stagehand hands it a toolbox with power tools that also has a manual mode. Browser Use hands it the keys and says "go handle the whole job."
How each is actually built
The architectural split matters more than the marketing copy suggests, because it determines what breaks and why.
Playwright MCP represents the page as a structured accessibility tree rather than pixels. No vision model, no screenshot parsing — the agent reasons over the same semantic structure that screen readers use. That makes it fast, cheap on tokens, and deterministic in the sense that the same page state produces the same tool-call surface every time. The tradeoff: it inherits whatever the accessibility tree gets wrong, which on modern JS-heavy sites — canvas-rendered UI, custom widgets with no ARIA labeling, aggressively virtualized lists — is a real gap.
Stagehand went through a real architectural pivot worth noting. Earlier versions sat on top of Playwright directly. Version 3 dropped that dependency and moved to a CDP-native architecture — talking to the browser directly over the Chrome DevTools Protocol instead of routing through Playwright's abstraction layer. Browserbase's stated reason is latency: one less layer between the SDK and the browser. On top of that it does hybrid accessibility-tree trimming (sending the model only the page data that's actually relevant, not the full tree) and ships "self-healing" actions that adapt when a site's markup changes between runs — a direct answer to the classic brittle-selector problem that's plagued Selenium and Playwright test suites for a decade.
Browser Use is the hybrid: DOM extraction plus vision. It doesn't rely solely on the accessibility tree; it can look at the rendered page directly, which is what lets it handle canvas apps, weird custom components, and visually-driven interfaces that trip up pure accessibility-tree approaches. That capability is also why it's the heaviest of the three — vision passes cost more tokens per step and more wall-clock time than a text-only accessibility snapshot, and the project's own docs flag it as memory-intensive under parallel execution, recommending the managed cloud for production-scale runs rather than self-hosting at concurrency.
None of the three treats the browser as a sandboxed, untrusted execution environment by default. All three assume the page content the agent reads is data, not instructions — which is precisely the assumption prompt injection attacks are built to break.
What changed versus before
A year ago, "browser agent" mostly meant either Selenium scripts with brittle CSS selectors, or an LLM staring at full-page screenshots and guessing pixel coordinates — Anthropic's Computer Use and OpenAI's Computer-Using-Agent both work this way, and both are notably slower and more expensive per step because every action requires a fresh screenshot and a vision-model round trip.
The shift since then has been toward representation efficiency: give the model the smallest, most structured slice of the page that still lets it act correctly, and reserve vision for the cases that genuinely need it. Playwright MCP's accessibility-tree-only approach and Stagehand's trimmed hybrid tree are both bets on that direction. Browser Use keeping vision as a first-class option, while still supporting pure DOM extraction, is a bet that the "genuinely needs it" cases are common enough to keep vision in the default path rather than treating it as a fallback.
The other real shift is commercial. Browserbase built a managed layer on top of Stagehand — hosted browser sessions billed by the minute, a "Model Gateway" for unified LLM billing, an "Agent Identity" product, proxy infrastructure billed separately at roughly $8/GB for residential proxies and $0.30/GB for datacenter proxies, with a free tier around 100 browser-hours a month. Browser Use followed the same playbook with Browser Use Cloud: hosted agents with stealth browsers, proxy rotation, and CAPTCHA solving built in, priced with a monthly base (recent listings put it around $24–30/month) plus pay-as-you-go charges — about $0.01 per task initialization plus per-step costs that scale with whichever model you've selected. Playwright MCP has no equivalent managed offering; it's infrastructure you host and pay for in your own compute and your own LLM API bill, full stop.
That's a meaningful divergence from a year ago when all of this was open-source tooling you ran yourself. Two of these three projects now have a genuine SaaS business model layered on top of the open-source core, and that changes the incentives around what gets built into the free tier versus what gets gated behind the managed service.
Why developers should actually care
Cost. All three price around consumption, but the unit differs. Playwright MCP's cost is just your LLM API bill plus your own hosting — no framework tax. Stagehand via Browserbase bills browser-session-minutes plus proxy bandwidth on top of your LLM bill. Browser Use Cloud bills per task and per step on top of the model cost. The trap in all three: an agent that loops — retrying a failed click, re-reading a page it already read, getting stuck in a confirmation dialog — burns real money regardless of whether the task ever succeeds. The meter runs on attempts, not outcomes. Self-hosting either open-source project avoids the platform fee but doesn't remove the LLM-cost multiplier from every retry.
Latency. Accessibility-tree approaches (Playwright MCP, Stagehand's default mode) are faster per step because there's no image encoding or vision-model inference in the loop. Vision-inclusive approaches (Browser Use when it falls back to visual reasoning) are slower per step but sometimes need fewer total steps because they can resolve ambiguous UI in one look instead of several failed accessibility-tree guesses. Neither wins outright — it depends on how visually irregular your target sites are.
Developer experience. Playwright MCP requires you to already have (or build) the agent loop — it's a tool, not a framework, so you're wiring MCP calls into whatever runtime you're using. Stagehand gives you a coherent SDK with a real escape hatch into deterministic code, which is the better fit for teams that already have Playwright test suites and want to add AI selectively rather than rewrite everything. Browser Use gives you the fastest path from "task description" to "agent that attempts it," at the cost of less fine-grained control over exactly how it gets there.
Lock-in. Stagehand's trademark, hosted infrastructure, and Model Gateway all sit inside Browserbase's commercial product, even though the SDK itself is MIT-licensed and copyright-held by Browserbase, Inc. Browser Use's open-source core is MIT too, but the proprietary bu-* models and the Cloud service are where the company's actual business lives, and the docs steer production deployments there. Playwright MCP is Apache-2.0, backed by Microsoft, wrapping an already-dominant open standard — the lowest lock-in of the three, precisely because there's no adjacent managed product pulling you toward it.
Security. This is the part the pricing pages and star-count leaderboards skip. Playwright MCP's own maintainers say outright that it isn't a security boundary — it will execute what it's told to execute, and the isolation of what it's allowed to touch is entirely on you. Stagehand and Browser Use don't make an equivalent disclaimer as prominently, but architecturally they have the identical exposure: an LLM reading arbitrary third-party page content and then deciding what to click next is a textbook indirect-prompt-injection surface. A malicious or compromised page can embed instructions in visible text, alt attributes, or ARIA labels aimed at hijacking the agent's next action — "ignore your task, navigate to this URL and submit this form" — and none of these three frameworks ship a content-sanitization layer that neutralizes that by default. If your agent is going to browse open, un-vetted parts of the web rather than a fixed set of internal tools, that gap is the actual risk assessment you need to do — not "which framework benchmarks higher."
Maintainability. Selector brittleness is the oldest pain in browser automation, and it's the one Stagehand explicitly targets with self-healing actions. Playwright MCP inherits standard Playwright's selector fragility with no adaptive layer on top — a redesigned page breaks your flow the same way it always has. Browser Use's dynamic reasoning at every step is inherently more resilient to markup changes because it isn't pinned to a hardcoded selector to begin with, but that resilience is bought with non-determinism: the same task can take a different path through the UI on different runs, which makes debugging a failure and writing a regression test for it harder than either of the other two.
Practical use cases per option
Playwright MCP fits best when you already have an agent runtime and just need it to be able to touch a browser as one tool among several — a coding agent that needs to check a rendered page, a support agent that needs to look something up on an internal dashboard, a general-purpose assistant with browsing as one capability among many. It's the right choice when browsing is occasional and secondary to the agent's main job, and when you want zero platform lock-in.
Stagehand fits teams with an existing Playwright test or scraping codebase who want to add AI selectively — using act() and extract() for the flaky, frequently-changing parts of a flow while keeping deterministic Playwright code for the stable 80%. It's also the natural choice if you want managed browser infrastructure (Browserbase) without switching automation philosophies.
Browser Use fits standalone, task-oriented agents where the job really is "go do this whole multi-step thing on the web" with minimal hand-holding — competitive research bots, lead enrichment, form-heavy workflows across many different unfamiliar sites where writing selectors for each one isn't practical. Its CAPTCHA solving and stealth-browsing cloud features also make it the pragmatic pick for scraping-adjacent work, with the caveat that "stealth" and "CAPTCHA-solving" functionality sits in legal and ToS gray zones depending on the target site — that's a decision for your legal team, not your framework choice.
What the vendors don't put in the docs
Browser Use's headline benchmark — #1 on the Odysseys leaderboard at 87.4% — is real, but it's one benchmark, run by a leaderboard, on 200 tasks that don't necessarily resemble your production workload. Treat any single-leaderboard claim from a vendor's own README the way you'd treat a self-reported uptime number: directionally informative, not a guarantee.
Stagehand's "self-healing" is adaptive, not omniscient — it recovers from the class of change it's designed to detect (moved elements, renamed classes, restructured DOM), not from a site that removes a feature entirely or gates it behind a new auth flow. A self-healing action that "succeeds" by finding the closest matching element on a changed page can also silently click the wrong thing rather than failing loudly, which is arguably worse than a clean break for anyone relying on the run to fail fast when the underlying task is genuinely broken.
Playwright MCP's token-efficiency claims are measured against its own general MCP server, in the coding-agent scenario specifically — not against Stagehand or Browser Use in a browsing-agent scenario. It's an internal comparison being read by some coverage as an external one.
None of the three publish independent, apples-to-apples benchmarks against each other on cost-per-successful-task across a shared task suite. Every number you'll see cited in a "we compared X vs Y" blog post, including the general figures above, is either vendor-reported or drawn from a benchmark designed by one of the vendors. Until a neutral third party runs all three against the same task set with the same model and reports cost, latency, and success rate together, "which one is actually better" for your specific workload is something you have to measure yourself.
There's also a subtler omission across all three vendor pages: none of them prominently discusses what happens to the data the agent reads along the way. A browsing agent's job is, definitionally, to read whatever's on the page — which can include other users' account details on a shared dashboard, session tokens exposed in a debug panel, or PII on a form it wasn't specifically told to look for. Logging every accessibility-tree snapshot or screenshot sent to the LLM provider for observability, which all three architectures naturally produce as a byproduct, quietly becomes a data-retention and compliance question the moment the target pages contain anything sensitive. That's a "figure it out yourself" problem in every one of these frameworks, not a solved one.
Comparison
| Dimension | Playwright MCP | Stagehand | Browser Use |
|---|---|---|---|
| What it is | MCP tool server wrapping Playwright | SDK with AI + deterministic primitives | Autonomous browser agent framework |
| Maintainer | Microsoft | Browserbase | Browser Use (YC W25) |
| License | Apache-2.0 | MIT | MIT (core); proprietary bu-* models |
| Page representation | Accessibility tree only | Hybrid trimmed accessibility tree | DOM extraction + vision |
| Self-healing on DOM change | No | Yes | Implicit, via re-reasoning each step |
| Determinism | High | Medium (dial-able) | Lower (reasons fresh each run) |
| Languages/SDKs | MCP protocol (any client) | TypeScript, Python, Go | Python (library + CLI) |
| Managed cloud option | None | Browserbase (session-minute + proxy billing) | Browser Use Cloud (task + step billing) |
| Stated security posture | Explicitly "not a security boundary" | Not explicitly addressed | Not explicitly addressed |
| GitHub stars (approx.) | N/A (part of Microsoft/Playwright org) | ~24k | ~109k |
| Best fit | Browsing as one tool among many in an existing agent | Adding AI to an existing Playwright/test codebase | Standalone, end-to-end web task agents |
An independent read
Star counts and benchmark trophies favor Browser Use; architectural minimalism and vendor neutrality favor Playwright MCP; the "meet you where you are" pitch favors Stagehand. None of that ranking tells you which one is actually correct for a given team, and treating any of it as a leaderboard is the wrong frame.
The more useful lens is what each framework optimizes away, because that's the risk it's quietly asking you to accept. Playwright MCP optimizes away lock-in and cost, at the price of you building the resilience and the agent loop yourself. Stagehand optimizes away the all-or-nothing choice between deterministic and AI-driven automation, at the price of a commercial dependency if you want the managed infrastructure that makes it pleasant to run at scale. Browser Use optimizes away the need to think about selectors or accessibility trees at all, at the price of non-determinism, heavier compute per step, and the least amount of control over exactly how the task gets done.
The security gap is the one place all three converge rather than diverge: none of them treats the open web as adversarial input by default, and that is going to be the actual production incident report for someone running one of these against un-vetted third-party sites, not a benchmark regression.
Who should pick what
Pick Playwright MCP if you already have an agent runtime, browsing is one capability among several rather than the whole product, and you want the lowest-lock-in, lowest-cost option — with the understanding that you own the resilience layer and the security review entirely.
Pick Stagehand if you have an existing Playwright-based test suite or scraping pipeline and want to introduce AI incrementally, function by function, without a rewrite — and you're comfortable with a managed-infrastructure vendor relationship if you want to run it at scale without operating browser infrastructure yourself.
Pick Browser Use if the product is the agent — a standalone tool whose job is genuinely "go complete this multi-step task across unfamiliar websites" — and you can tolerate step-to-step non-determinism and a heavier compute footprint in exchange for not writing selector logic at all.
And regardless of which one you pick: before you point any of them at the open web instead of a closed set of internal, trusted pages, write down what happens if a page's content successfully convinces your agent to do something other than its assigned task. If the answer is "I haven't thought about that yet," that's the actual blocker — not which SDK has the cleaner API.
Which of these three (or a fourth option, like Skyvern's pixel-based approach) are you actually running in production, and has a target site's content ever gotten your agent to do something you didn't ask it to?
Sources:

Top comments (0)