Skip to content
Glossary

A browser agent decides; a script only replays

Both drive the same engine. The difference is where the decisions live: a script encodes them in advance as selectors and waits, an agent makes them at run time from what the page currently shows.

Four properties that follow from that one difference

It reads the page instead of matching selectors


The model receives a representation of the current state, usually an accessibility tree, a filtered DOM or a screenshot, and picks an action. A redesigned button that would break a selector often costs it nothing.

The same input can produce different runs


Two executions of one task may take different paths and both be correct. Every assumption a test suite makes about determinism has to be revisited, starting with how you assert success.

Cost is per decision, not per step


Each turn spends tokens on the page representation plus the reasoning. A page that needs forty turns costs roughly forty times a page that needs one, which is why representation size dominates the bill.

The page becomes untrusted input


Text rendered by a third party arrives in the same context window as your instructions. That is an injection surface no scripted automation ever had.

Where the boundary usually falls

Stable internal application, high volume Script it. Determinism and cost both favour the selector.
Hundreds of similar portals, none identical Agent. Writing and maintaining hundreds of scripts is the expensive half.
Layout changes without notice Agent, or a script with an agent fallback when the selector misses.
Regulated workflow needing an audit trail Either, provided every action is recorded. The record matters more than the mechanism.
Typical turns for a login and one form Around 6 to 15, depending on how much of the page is sent each turn
Dominant cost driver Page representation tokens, usually well ahead of the reasoning itself

As of 2026-08-31

Common questions

Is a browser agent the same as computer use?

Related but narrower. Computer use gives a model the whole desktop, including native applications and the file system. A browser agent is scoped to one browser, which makes the action space smaller, the failures easier to reason about and the isolation story considerably simpler.

Do agents replace Playwright?

No, they sit on top of it. Almost every agent framework still issues clicks and types through Playwright, Puppeteer or the DevTools Protocol. What the model replaces is the part of your code that decided which element to click.

Why does the same task sometimes cost ten times more?

Because a run that goes wrong keeps going. A missed element leads to a retry, the retry adds a turn, and every turn resends the page. Capping turns per task is the single most effective cost control most teams are missing.

How do I test something non-deterministic?

Assert on outcomes rather than paths. Whether the invoice was downloaded is checkable; whether the agent clicked the third menu item is not a useful assertion when a different route is equally valid.

Give your agent a browser it cannot break

Sessions that isolate a bad run, keep credentials out of the model context, and record what happened.