| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
An open-source runtime for browser agents.
Bring your own model into the browser, with context assembly, typed tools, page execution, DOM verification, guardrails and reusable skills.
Browser Agent is a Chrome MV3 extension and a runtime for browser agents. It places a model inside a structured browser environment: the model interprets the task and chooses actions; the runtime provides page context, exposes tools, executes actions, verifies results, records traces and controls risk.
The repository is mainly about the infrastructure around the model:
The product surface today is a browser side panel. The core of the project is the runtime behind it: the agent loop, tool registry, page engine and verification system.
Browser Agent is designed around engineering boundaries for browser automation, not just a conversational interface.
1. A web page is a runtime environment, not only an image.
The engine captures whole-page semantic snapshots: DOM nodes, accessible names, form values, interactivity, occlusion, same-origin iframes and open shadow roots. The model receives a representation closer to the browser's actual structure than a viewport screenshot alone.
2. Tool calls go through one registry.
All tools are registered as ToolDefinition objects. Parameters are defined with Zod schemas, risk tiers are declared in the tool definition, and execution passes through validation, permission checks, site policy and audit logging. Built-in tools and MCP tools use the same entry point.
3. Page actions need explicit completion checks.
After page_act executes an action, it checks post-conditions such as value written, text present, URL matched or list count changed. Success and failure both return expected values, actual values and evidence, instead of only a natural-language summary.
4. Successful workflows should become reusable capabilities.
A verified run can be extracted into a skill. Skill replay still verifies each step and uses bounded recovery attempts when something changes. Batch execution runs the skill row by row and reconciles the report against page state.
Main modules under packages/extension/src/:
kernel/ agent loop: assemble context, stream the model, dispatch tools, feed tool results back
context/ context assembly: system prompt, current tab, open tabs, session history
tools/ tool registry: page, tabs, browser data, skills, MCP
engine/ page runtime: perception, grounding, widget adapters, execution, verification, failure handling
guardrails/ tool guardrails: risk tiers, authorization memory, site policies, confirmations, audit
storage/ local repositories: sessions, runs, skills, batches, provider configs, settings
trace/ structured events shared by the kernel and engine
llm/ model ports: OpenAI-compatible, OpenAI Responses, Anthropic, mock provider
ui/ side panel, options page, onboarding and shared components
Two runtime choices are important:
page_act is the unified entry point for page work. It turns a page-level goal into actions with checks, instead of only sending clicks and keystrokes to the page.
The execution pipeline has six layers:
For example, when creating a customer, a success toast is not the final condition. The engine also checks that the customer list gained a row and that the expected name appears in the list. If no record appears, the result includes an actionable verification failure such as list_count_delta: expected +1, got 0.
Tool definitions live in packages/extension/src/tools/. A tool declares:
After registration, a tool is available to configured model providers. Execution is wrapped with parameter validation, permission requests, guardrails, audit logging and error handling.
import { z } from 'zod';
import type { ToolDefinition } from '@/kernel/contracts/tool';
export const readClipboard: ToolDefinition<{ trim?: boolean }> = {
id: 'clipboard_read',
titleKey: 'tools.clipboard_read',
description: 'Read the current clipboard text. Use when the user refers to "what I copied".',
paramsSchema: z.object({ trim: z.boolean().optional() }),
riskTier: 'read',
requiredPermissions: ['clipboardRead'],
async execute(params) {
const text = await navigator.clipboard.readText();
return { ok: true, summary: params.trim ? text.trim() : text };
},
};Built-in packs:
| Pack | Tools |
|---|---|
| Page | page_act · page_read · page_screenshot |
| Tabs | tabs_list · tabs_open · tabs_activate · tabs_close |
| Browser data | history_search · bookmarks_search · bookmarks_add · downloads_list · downloads_save |
| Skills | skills_list · skills_run · batch_start |
| MCP | Mount Streamable HTTP MCP servers; remote tools pass through local guardrails |
A skill is a reusable workflow extracted from a successful run. It contains parameter slots, pre-bound steps and verification conditions for each step.
Batch execution passes each row of a data table into a skill. Rows run independently and are verified independently. Failed rows do not block the rest of the batch, and can be retried after data fixes. The delivery report is reconciled against page state rather than only counting attempted executions.
This logic lives in packages/extension/src/engine/batch/ and packages/extension/src/tools/skills.ts.
Model providers are implemented under llm/. Current providers include:
If an endpoint does not support native tool calling, the runtime falls back to a prompted-JSON protocol and normalizes the output into the same internal tool-call structure. The tool registry, guardrails and kernel loop do not need separate paths per provider.
git clone https://github.com/uiuing/browser-agent.git
cd browser-agent
pnpm install
pnpm buildAfter the build, open chrome://extensions, enable Developer mode, choose Load unpacked, and load:
packages/extension/.output/chrome-mv3
On first install, the onboarding page asks for a model provider. Choose a preset, enter the base URL and key, test the connection, and save.
Local practice site:
pnpm fixturesThen open http://localhost:4173.
pnpm build # build fixtures and extension, then typecheck bench/e2e
pnpm dev:ext # extension dev mode
pnpm dev:fixtures # local fixture site dev mode
pnpm test:engine # engine tests
pnpm test:e2e # extension e2e with scripted mock provider
pnpm shots # UI screenshot sweep
pnpm bench # regenerate docs/benchmark.mdOn Windows, if Playwright cannot find a browser, set PLAYWRIGHT_BROWSERS_PATH to your local ms-playwright cache directory.
pnpm test:engine covers page perception, element grounding, widget adapters, verification and failure handling.
pnpm test:e2e builds a mock version of the extension and drives the full chat and tool-call loop with a scripted mock provider. It does not need a real model API key.
pnpm bench runs a reproducible benchmark on the same fixtures. The current report is in docs/benchmark.md. It covers custom widgets, fake-success detection, injected flakiness, off-screen fields and batch delivery accuracy.
Useful contribution areas:
Before opening a PR, run:
pnpm build
pnpm test:engineIf the change affects chat, settings, permission prompts or extension loading, also run pnpm test:e2e.
| Package | Description |
|---|---|
| packages/extension | Chrome MV3 extension |
| packages/fixtures | Local practice and test pages |
| packages/e2e | Engine tests, extension e2e and screenshot sweep |
| packages/bench | Benchmark runner |
| docs/architecture.md | Architecture notes |
| docs/benchmark.md | Benchmark report |
| Back | FazBrowse Home | New Git URL |