Agent or script?
Browser agents are a spectrum, not one thing. The decision axis is risk versus scale: risk pushes toward deterministic control, and scale pushes toward agency. If a wrong click costs money or fails an audit, you want a script. If you can’t enumerate the sites, layouts, or workflows ahead of time, scripting becomes a losing fight and you want an agent. The browser agent autonomy levels post covers the full spectrum.| Where you sit | What it looks like | Browserbase tool |
|---|---|---|
| Script owns the flow, AI handles individual steps | Deterministic code with self-healing act and extract calls | Stagehand |
| Script hands off to an agent for the hard steps | A scripted backbone that calls an agent for the steps that need reasoning | Stagehand + Agents |
| Agent owns the loop, you ask for a result | A fully autonomous run from a natural language goal | Agents |
Use cases and technical solutions
| Use case | Browserbase solution |
|---|---|
| Automate sites that constantly change | An Agent renders the page and reacts to popups and layout changes |
| Reach data behind logins and forms | An Agent navigates and fills forms; variables for inputs; downloads for files |
| Extract data from JavaScript-heavy apps | A real browser executes JavaScript so dynamic content renders |
| Pull the same data on a schedule | Find the underlying request, then replay it with Fetch |
| Run deep research across the web | Search to discover, Fetch for cheap context, an Agent to act |
| Scale across hundreds of sites | One reusable Agent instead of N brittle scripts |
Automate sites that constantly change
Sites like squareup.com change their markup often and throw interstitials, cookie banners, and modal popups that break selector-based scripts. A browser agent reads each page and decides what to do, so it dismisses the popup, waits for the right state, and adapts when the layout shifts. For protected sites, Agent Identity gets the agent past anti-bot systems and CAPTCHAs. Use Agents for a fully autonomous run, or Stagehand when you want self-healing steps inside your own code.Reach data behind logins and forms
When the data sits behind a login, a multi-step form, or a series of nested pages, there is no URL to fetch. A browser agent works through the flow the way a person would: it logs in, fills fields, advances steps, and opens the record. Pass dynamic inputs like URLs or instructions as variables so the agent fills them without exposing them inline. When the result is a file, the agent works with it in its sandbox and you retrieve it through Downloads. See managing files for the document workflow.Extract data from JavaScript-heavy apps
Plenty of pages load their real content after the initial HTML, through XHR or POST calls fired by JavaScript. A plain HTTP fetch sees an empty shell. A real headless browser session executes that JavaScript, so the dynamic content renders and an Agent can read it. Reach for Fetch when a simple GET already returns what you need, and a browser when it does not.Pull the same data on a schedule
When you need the same data repeatedly, such as monitoring prices or inventory, driving the full UI on every run is slow and expensive. Drive the page once in a browser and watch the network traffic through session observability to find the request that returns the data. Once you know that endpoint, replay it cheaply with the Fetch API for repeat pulls, no browser required.Run deep research across the web
Research tasks combine discovery and reading. Use the Search API to find relevant pages without a browser, the Fetch API to pull page content cheaply for recon, and then hand off to a browser Agent for the pages that need interaction or structured extraction. This keeps token usage and latency low while still reaching the parts of the web that need a real browser.Scale across hundreds of sites
Writing and maintaining one script per site stops scaling once you reach dozens of targets that each change on their own schedule. Create one reusable Agent with asystemPrompt and resultSchema and run it across hundreds of portals instead of maintaining hundreds of scripts. Deploy it with Functions for low-latency execution next to the browser, and scale across concurrent browser sessions on demand.
Agent Identity and trust
Different Agents need different levels of trust. Browserbase supports a layered identity model, so you can match the access level to your use case.| What your Agent needs | How to get it |
|---|---|
| Access Browserbase browsers | API key: standard SDK authentication |
| Log into third-party sites | 1Password: secure credential access from vaults |
| Bypass bot detection on partner sites | Web Bot Auth: Cloudflare Signed Agents |
| Prove it’s human-backed (permissionless) | AgentKit: proof-of-humanity via Tools for Humanity on x402 |
Agent Identity overview
Learn about every identity layer available to your agents
Next steps
Agents quickstart
Run your first browser agent with one API call
How it works
The execution loop, built-in tools, and run lifecycle
Stagehand
The SDK for browser agents
Agent Identity
Access any website without getting blocked
Functions
Deploy and run agents on Browserbase
Model Gateway
One API key, access to every model