Skip to content

Vercel Agent Browser Setup and How to Verify the Result

Set up Vercel Agent Browser, use snapshots and refs, and verify browser outcomes with a controlled false-success test.

Browser command success separated from the durable result

TL;DR: Vercel Agent Browser is a command-line browser automation interface built for AI agents. Install the CLI and its browser, open a page, use a snapshot to get stable element references, and act through those references. Then verify the durable result separately. In our controlled settings test, every command completed and the page displayed Settings saved, but the submitted payload and reopened value stayed at 15 minutes instead of the visible 30 minutes.

Vercel Agent Browser gives an agent a compact command-line interface for opening pages, reading accessible page structure, clicking controls, entering text, inspecting console output, and capturing screenshots. Its snapshot-and-ref workflow is useful because the agent can act on concise references such as @e4 instead of repeatedly parsing a full page.

That makes browser control easier. It does not make the application outcome true.

This guide covers installation, the basic command model, sessions, snapshots, debugging commands, and a controlled experiment that catches a false success message.

What Vercel Agent Browser is

The official agent-browser repository describes it as a browser automation CLI designed for AI agents. The project exposes commands for navigation, snapshots, clicks, text input, screenshots, console inspection, network capture, traces, accessibility checks, and persistent sessions.

The core loop is simple:

  1. Open a page.

  2. Request an interactive snapshot.

  3. Act on the returned element references.

  4. Read the resulting page state.

  5. Verify the intended outcome using a source that cannot be satisfied by the click alone.

That fifth step is where a browser script becomes a trustworthy workflow.

Install Agent Browser and Chrome

The CLI is available through npm, Homebrew, and Cargo. For an npm-based setup, install the package and then install its managed Chrome binary.

vercel-agent-browser-example-1.bash

$
npm install -g agent-browser
>
agent-browser install
>
agent-browser --version

For this article, we used agent-browser 0.38.2 with its managed Chrome 154 binary on macOS.

You can also run commands through npx without keeping a global package:

vercel-agent-browser-example-2.bash

$
npx --yes agent-browser open https://example.com
>
npx --yes agent-browser snapshot -i

Use an isolated named session when several tasks may run on the same machine. The browser persists between commands through the session.

vercel-agent-browser-example-3.bash

$
export AGENT_BROWSER_SESSION=checkout-verification
>
agent-browser open https://example.com/checkout
>
agent-browser snapshot -i

Use snapshots and refs instead of guessing selectors

An interactive snapshot returns controls with references that are easy for an agent to reuse.

vercel-agent-browser-example-4.text

- button "Use 30 minutes" [ref=e4]
- button "Review changes" [ref=e5]
- button "Save timeout" [ref=e6]

The next actions can target those refs directly:

vercel-agent-browser-example-5.bash

$
agent-browser click @e4
>
agent-browser click @e5
>
agent-browser snapshot -i

Refs make the command transcript compact and readable. They are still references to the current page state. Take a fresh snapshot after navigation, a modal change, a rerender, or another meaningful state transition.

The commands that matter during investigation

The full CLI is broad, but a small set covers most browser-agent investigations.

Need

Command

What it proves

Open the target

agent-browser open <url>

The browser reached the requested page

Find interactive controls

agent-browser snapshot -i

The current accessible controls and refs

Perform one action

agent-browser click @e4

The click was issued to the referenced control

Read the page

agent-browser get text body

The current rendered text after the action

Inspect runtime messages

agent-browser console

Console output observed during the session

Preserve a visual checkpoint

agent-browser screenshot result.png

What the page looked like at that moment

Capture deeper browser evidence

agent-browser trace start and trace stop

A DevTools trace for the bounded run

End cleanly

agent-browser close

The isolated browser session was closed

Notice what the table does not say. A completed click proves the automation issued an action. A success message proves the page rendered that message. Neither proves that the intended value persisted.

A controlled false-success experiment

We built a local fake-data settings page for ticket SUP-509. The page starts with an inactivity timeout of 15 minutes. A healthy control can open 30 minutes fresh, save it, and read back 30 minutes.

The failing route adds one detour:

  1. Start at 15 minutes.

  2. Choose 30 minutes.

  3. Open Review changes.

  4. Return to settings.

  5. Save once.

The bug preserves 30 minutes on screen but silently restores 15 minutes into the save payload when the operator returns from review.

The healthy control passed

We used Agent Browser to open 30 minutes fresh and save it. The visible choice, submitted payload, and durable value all became 30 minutes. The fixture returned SAVE_OK.

vercel-agent-browser-example-6.text

VISIBLE CHOICE  30 minutes
SAVE PAYLOAD    30 minutes
DURABLE VALUE   30 minutes
SAVE RESULT     SAVE_OK

This control matters. It proves that 30 minutes is a valid option and that the save control can persist it. The failure depends on the review-and-return path.

The review detour created the first mismatch

After reset, we chose 30 minutes, opened Review changes, and returned to settings. Agent Browser read this state:

vercel-agent-browser-example-7.text

VISIBLE CHOICE  30 minutes
SAVE PAYLOAD    15 minutes
DURABLE VALUE   15 minutes
ROUTE           settings

That is the first useful mismatch. The screen tells the operator that the new choice survived. The action input says otherwise.

The command completed but the result was wrong

We clicked Save timeout once. The page displayed Settings saved, and the Agent Browser command returned successfully. The final page state was still wrong:

vercel-agent-browser-example-8.text

SAVE RESULT     SAVE_READBACK_MISMATCH
TOAST           Settings saved
VISIBLE CHOICE  30 minutes
SAVE PAYLOAD    15 minutes
DURABLE VALUE   15 minutes

The console preserved the ordered transition:

vercel-agent-browser-example-9.text

timeout_choice_changed · visible=30 · payload=30
timeout_review_opened · visible=30 · payload=30
timeout_review_returned_stale · visible=30 · payload=15 · durable=15
timeout_save_readback_mismatch · visible=30 · payload=15 · durable=15

The browser agent did not malfunction. It clicked the intended control. The application accepted a stale value and displayed a misleading success message.

Verify outcomes at three levels

A useful browser-agent run separates three questions.

Did the action happen

Confirm that the intended control existed and the command targeted it. A current snapshot, ref, and command transcript answer this question.

Did the browser show the expected transition

Read the page after each meaningful state change. Preserve the first point where the visible state, form value, route, request, or console output diverges from the expected path.

Did the result persist

Reload, reopen, query a read-only endpoint, or use another independent source of truth. The verification source should be difficult for the original action to satisfy accidentally.

For a settings change, the final check might be a reopened form. For a created record, it might be a search or read-only API. For a permission change, it might be a fresh session under the affected role.

Add a verification contract before the run

Do not ask an agent to “update the setting” and decide success from its final sentence. Define the contract first.

Include:

  • the exact environment, account role, URL, and starting value;

  • the permitted actions and actions that require human approval;

  • the expected visible transition;

  • the expected durable result;

  • the independent readback source;

  • the evidence to retain when the run fails;

  • the cleanup or rollback step.

Our controlled task contract was narrow: use fake data, submit once, change no external account, and verify the durable timeout after the save.

Debug the failure without turning logs into a verdict

Agent Browser can expose console messages, network requests, screenshots, traces, and page text. Use them to explain the path, not to declare root cause prematurely.

A practical order is:

  1. Capture the known start state.

  2. Take a fresh snapshot.

  3. Perform one action.

  4. Read the page state.

  5. Repeat until the first mismatch appears.

  6. Inspect console or network evidence around that moment.

  7. Verify the durable result.

  8. Rerun one healthy control.

In our experiment, the console named the stale transition. In another application, the useful evidence might be a request body, disabled control, route change, or authorization response. The browser transcript narrows the investigation. It does not guarantee automatic root-cause diagnosis.

When to use Agent Browser, Playwright, or MCP

Use Agent Browser when an AI agent benefits from a compact CLI, accessible snapshots, refs, and direct debugging commands. Use Playwright tests when you want a maintained test suite with assertions, fixtures, projects, retries, and CI integration. Use Playwright MCP when a model needs browser tools through the Model Context Protocol.

These options can coexist. The important boundary is between controlling the browser and verifying the consequence. Our browser-agent testing guide covers the broader release gate, negative cases, repeated trials, and false-success scoring.

What changes when solving agents consume the incident

Over the next 6 to 18 months, solving agents will increasingly consume browser incidents directly, so a successful command transcript will need to be paired with ordered state transitions, permission boundaries and an independently verified readback.

A solving agent should receive the known start state, exact action order, expected and actual results, first mismatch, selected browser evidence, controls, and final readback. A screenshot or success message can support the incident, but it cannot replace the transition that produced it.

Teams can prepare now by defining the known start state, permitted actions, expected and actual result, first mismatch, durable verification source and one bounded rerun before accepting an agent's completion claim.

This is a system requirement, not a claim that today’s browser agents can identify the root cause or repair the defect without independent review.

Preserve the browser path for the fixing teammate

When the difficult part is the route into the failure, deliberately record that route before handing it to engineering. A Samelogic recording can preserve the ordered browser steps, the failing moment, affected page context, and final state for playback and review. The teammate still needs an independent readback to confirm what persisted.

Install CSS Selector & XPath Finder by Samelogic and start one bounded recording before repeating the browser path that produced the contradiction.

Sources

Related workflows

Related workflows

Move from editorial context into the selector, Playwright, and bug-reproduction pages that turn exact UI evidence into action.

Capture browser proof before the handoff gets vague.

Select the exact element, record the replay, and give QA, product, and engineering a test artifact they can act on without another clarification loop.

Install the Chrome Extension
Visual
Semantic
Behavioral

Used by teams at

  • abbott logo
  • accenture logo
  • aaaauto logo
  • abenson logo
  • bbva logo
  • bosch logo
  • brex logo
  • cat logo
  • carestack logo
  • cisco logo
  • cmacgm logo
  • disney logo
  • equipifi logo
  • formlabs logo
  • heap logo
  • honda logo
  • microsoft logo
  • procterandgamble logo
  • repsol logo
  • s&p logo
  • saintgobain logo
  • scaleai logo
  • scotiabank logo
  • shopify logo
  • toptal logo
  • zoominfo logo
  • zurichinsurance logo
  • geely logo