Skip to content
My role

To be added

—Results
—Results
—Results
Screenshot 1
Screenshot 2
Screenshot 3

Browser Automation Agent (WebPilot) ​

Covers: agent orchestration, computer use, human takeover, trace replay, FastAPI + Next.js Status: not started | Priority P1 (after the "AI Document Review Pipeline" MVP is done)


1. Business scenario ​

B2B customers have many legacy systems without APIs (government filing websites, supplier portals, internal OA systems), and operations staff repeat "log in → search → fill in the form → submit → screenshot for the record" every day. Build an agent: the user describes a task in natural language (or picks a preset flow), and the agent carries it out automatically in an isolated browser. When it meets a CAPTCHA, a confirmation prompt or a field it's unsure about, it pauses and asks a human to take over, and the whole run can be replayed for audit.

It connects directly to the "AI Document Review Pipeline": approved invoice results can be entered by WebPilot into the customer's legacy web ERP automatically.


2. Architecture and technology choices ​

Next.js console ── create tasks / live view (screenshot stream) / step timeline / "Take over" button
      │ SSE/WebSocket
FastAPI ── Agent Runner (tool calling loop)
      │        ├─ Observe: page accessibility tree / trimmed DOM + screenshot
      │        ├─ Decide: the LLM picks a tool (click/type/select/scroll/wait/ask_human/done)
      │        └─ Act: Playwright (an isolated browser in Docker)
      ├─ Safety layer: domain allowlist, forced human confirmation for high-risk actions (submit/pay/delete), step and time limits
      └─ Traceability: every step stores screenshot + observation summary + model output + action + result
ComponentChoiceWhy
Browser controlPlaywright (Python)Stable, supports accessibility tree snapshots, can record traces
PerceptionHybrid: prefer accessibility tree / numbered DOM elements (cheap, accurate), fall back to screenshots + vision model coordinates (general)Being able to explain the trade-off between the two approaches is an interview highlight
Decision modelA model that supports tool calling; optionally compare against vendors' computer use tool APIsCompare success rate and cost of a "home-grown DOM agent" vs "vendor computer use"
Agent loopHand-written loop (no framework), optionally refactored with LangGraphWriting it by hand first is what lets you explain the principles; the framework is for state persistence and interrupt/resume
IsolationOne containerized browser per taskSafety and concurrency
FrontendNext.js + screenshot stream + timelineLets humans watch in real time and take over at any moment

⚠️ Vendor computer use APIs (Anthropic's computer use tool, OpenAI's related agent capabilities) are still iterating quickly; follow the official docs as of 2026-11 for parameters and model names. The mobile use direction can extend to Appium / ADB + accessibility trees on the same principles.


3. Implementation plan (about 2–3 weeks) ​

StageContentAcceptance
D1–3Wrap Playwright as a tool set: goto/click(id)/type(id,text)/select/scroll/screenshot/get_a11y_tree; number the interactive elementsA script completes a fixed flow on the demo site
D4–6Hand-written agent loop: observe → LLM decides (tool calling) → act → send the result back; max steps, per-step timeout, tool errors returned to the model for self-correctionCompletes "search for and download a report on the demo site" from natural language
D7–9Human takeover: an ask_human tool + interception of high-risk actions; the task suspends, and after "Take over" in the frontend a human acts or fills in the answer, then the agent continuesPauses automatically on a CAPTCHA and resumes
D10–12Trace replay: every step's screenshot and decision stored, timeline replay in the frontend; one-click "retry from step N" for failed tasksFor any failed task, find which step failed and why the model did what it did
D13–15Evaluation: 10–20 fixed tasks, measuring success rate, average steps and cost; compare DOM mode vs screenshot mode vs vendor computer useEvaluation report written into the README

4. Hard problems and highlights ​

Hard problemSolution
Too many page elements, context blows upOnly interactive elements + the visible area; numbered elements; summarize past steps
Actions fail / the page hasn't finished loadingAfter acting, wait for network idle or for the element to appear; send failure info back to the model; hand over to a human after the same action fails N times
The agent drifts off course or loops foreverMax steps, repeated-state detection (same page hash + same action), goal checkpoints
SafetyDomain allowlist, human confirmation for sensitive actions, credentials never in the prompt (injected by the tool layer)
ExplainabilityEvery step saves "what it saw → what it wanted to do → what it did → the result"

5. Résumé description (STAR) ​

Browser Automation Agent | Independent design and development

  • S: Many of the customer's business systems had no API, and operations staff had to repeat data entry and lookups across several web systems every day.
  • T: Build an agent that understands natural-language tasks, operates web pages automatically, and asks a human to take over when unsure.
  • A: Hand-wrote the agent execution loop on Playwright + LLM tool calling, with a hybrid perception approach based mainly on numbered accessibility tree elements and supplemented by screenshot-based visual targeting; designed ask_human and high-risk action interception for human takeover, with tasks that can suspend and resume; stored every step's screenshot and decision for replay and audit; built a fixed-task eval set to compare perception approaches.
  • R: Success rate X% on an eval set of N tasks, X steps on average, ¥X cost per task; human time on a given flow down X% after adoption. (Use measured numbers.)

  • Agent: tool calling loop, computer use, safety
  • Reliability: human takeover, timeouts and retries
  • Frontend: live view and timeline

Vin Amory · AI development × content creation · Technical notes cite official docs in each page’s sources section