Skip to main content

Module browser

Module browser 

Source
Expand description

SOTA browser-bot harness: drive a real Chrome via the chrome-devtools MCP server, with the reliability and safety layer that makes a web agent actually work (per tasks/browser-bot-sota-2026-05-31.md).

The browser-control problem (“how to call Chrome”) is already solved: the MCP stdio client (crate::tool::mcp) turns the server’s tools into Arc<dyn Tool>, and the bundled chrome-devtools preset (crate::connect_preset) spawns it with one call. This module adds the agent-layer capabilities the research found decisive — starting with observation distillation (distill) — built on the existing agent runner, dynamic-workflow combinators, structured output, guardrails, and memory.

Built incrementally (spec §9, cheap reliability wins first):

  • B1 (this): distill — prune the a11y snapshot before it reaches the LLM.
  • B2+: stale-uid retry, post-action verification, settle, replan-loop, completion judge, browser guardrails. (See the spec.)

Re-exports§

pub use bench::BenchResult;
pub use bench::BenchTask;
pub use bench::Oracle;
pub use bench::run_bench;
pub use bench::scorecard;
pub use builder::BROWSER_SYSTEM_PROMPT;
pub use builder::BrowserAgentBuilder;
pub use builder::browser_guardrails;
pub use builder::filter_tools;
pub use builder::wrap_browser_tools;
pub use confirm::ActionRisk;
pub use confirm::ConfirmActionTool;
pub use confirm::ConfirmPolicy;
pub use confirm::classify_label;
pub use confirm::label_for_uid;
pub use distill::DistillConfig;
pub use distill::distill_snapshot;
pub use distill::interactive_uids;
pub use distill_tool::DistillingTool;
pub use guard::DomainAllowlistGuard;
pub use harness::ReliableInteractionTool;
pub use inject::InjectionRisk;
pub use inject::scan_snapshot_for_injection;
pub use judge::CompletionVerdict;
pub use judge::build_completion_prompt;
pub use judge::parse_completion_verdict;
pub use plan::Plan;
pub use plan::PlanStep;
pub use plan::ReplanAction;
pub use plan::ReplanBudget;
pub use plan::StepOutcome;
pub use plan::StepStatus;
pub use plan::replan_decision;
pub use settle::Probe;
pub use settle::SettleConfig;
pub use settle::SettleOutcome;
pub use settle::parse_dom_ready;
pub use settle::settle;
pub use verify::ActionEffect;
pub use verify::SnapshotSignature;
pub use verify::diff;
pub use verify::signature;

Modules§

bench
Live browser-agent benchmark — the “go to a real site and perform actions” smoke test, as a repeatable evaluation process.
builder
BrowserAgentBuilder — assembles a SOTA browser agent from the harness capabilities (spec §5.10, the capstone that ties the module together).
confirm
Destructive-action confirmation (capability 21 of the browser-bot spec).
distill
Snapshot distiller (capability 2 of the browser-bot spec).
distill_tool
DistillingTool — an Arc<dyn Tool> decorator that distills snapshot output before it re-enters the agent’s context (token-control wiring).
guard
Browser safety guardrails (spec capabilities 19–21).
harness
Browser reliability decorators over raw MCP tools (spec capability 4).
inject
Prompt-injection heuristic for page content (capability 20 of the spec).
judge
Task-completion judge (capability 15 of the browser-bot spec).
plan
Plan artifact + replan decision logic (capability 8 of the browser-bot spec).
settle
Wait-for-stability / network-idle settle (capability 6 of the browser-bot spec).
verify
Post-action verification via state-diff (spec capability 5).