Inspiration

Government portals, tax filings, job applications, and multi-step business registrations are where people quietly give up. Older adults, second-language users, and first-time filers regularly hit silently disabled submit buttons or cryptic required fields with no clear path forward.

Autonomous AI browser agents try to solve this by taking over the mouse and keyboard—but that means handing sensitive form data to remote servers while teaching the user nothing for next time. We wanted the opposite: human-in-control hybrid AI that knows when you're stuck, grounds where to go on the live page, and leaves you clicking and typing every step.

What it does

Firelens is a privacy-first Chrome extension built on Firebase AI Logic that combines on-device behavioral friction detection with grounded visual guidance:

  1. Local Big Scan & Small Scans (0 Gemini calls during scanning): Activating Firelens builds a bounded in-memory page graph of controls, labels, roles, forms, and status relationships locally (37 ms Big Scan, 5 ms Small Scan, 0 extension-added site requests). Ordinary typing and scrolling leave Gemini completely idle.
  2. On-Device Friction Detection & Proactive Offer: Our custom 450-tree v3 friction classifier runs 100% inside Chrome, observing how you interact (repeated clicks on disabled controls, unproductive tab cycling)—never what you type. When sustained friction holds (and the user has opted in), Firelens surfaces a quiet, dismissible Need help? popup. Clicking Show me opens the side panel and focuses the goal field. Users can also toggle Show confusion detection to view real-time local telemetry or start guidance manually anytime.
  3. Grounded Visual Guidance & Field Speech Bubbles: Once the user enters a goal, Firelens ranks the top 16 candidate controls from the local page graph and calls Firebase AI Logic to pin a live mint-green spotlight, directional pointer, and contextual input speech bubble directly onto the blocking control. With Continue guidance throughout enabled, verified progress automatically advances to the next step until completion.
  4. Visible Recovery & Guardrails:
    • Wrong target & friction-triggered escalation: Clicking Wrong target—or sustaining post-cue friction after a Nano cue—excludes the bad target and escalates the replan to approved Cloud Gemini.
    • Grounded clarification: Ambiguous goals (e.g., "Open the tab I need") trigger one local clarifying question instead of guessing.
    • False-completion recovery watch: After marking Done!, Firelens listens locally for 9 seconds; rapid scroll reversals or a same-site backtrack surface a dismissible Resume guidance offer.
  5. Privacy-First Hybrid Boundary (scan-policy.js):
    • Sensitive fields (passwords, tax IDs, payment inputs) automatically lock guidance to On-device only or pause.
    • Cloud fallback requires explicit per-task consent, runs behind Firebase App Check, and sends only an allowlisted, redacted text map (0 screenshot bytes, 0 raw URLs, 0 typed field values), with page DOM isolated as untrusted data.
    • Navigating across origins or to a blocklisted hostname automatically pauses guidance and discards the local index.

How we built it

  • Chrome Manifest V3 Shell (root/): Side Panel UI (popup.html, popup.js), service-worker scheduler (background.js), Shadow DOM Trusted-Types-safe overlay (overlay.js, content.js), and esbuild bundler (build.mjs).
  • Local Scanner & Policy Layer (root/page-context.js, root/scan-policy.js, root/guidance-core.js): Deterministic DOM indexing, form/section relationship graph, top-16 candidate retrieval, redaction filters, and origin/blocklist enforcement.
  • Custom On-Device Friction Model (detector/): Independently trained 450-tree v3 classifier (detector/model/) with real-time interaction feature extraction (detector/src/reader.js), behavioral telemetry HUD, and local research recorder.
  • Firebase AI Logic Hybrid Inference (root/firebase-guide.js, root/practice-cloud.js, root/friction-routing.js): Unifies Gemini Nano on-device (LanguageModel API via Firebase AI Logic PREFER_ON_DEVICE) with automatic Cloud Gemini fallback and friction-triggered escalation verified through Firebase App Check (reCAPTCHA v3 on the hosted practice workspace—zero credentials or debug tokens required for judges).

Judge Instructions (How to Test in 60 Seconds)

  1. Download and unzip Firelens-Evaluator.zip.
  2. Open desktop Google Chrome (139+), navigate to chrome://extensions, enable Developer mode, click Load unpacked, and select the inner Firelens folder containing manifest.json.
  3. Open the hosted practice portal: https://firelens-practice.vercel.app/.
  4. Click the Firelens toolbar icon and allow site access.
    • Proactive offer demo: Before starting guidance, toggle ON Offer help when I’m stuck (and optionally Show confusion detection), then click the disabled Submit registration button twice quickly. Click Need help? → Show me.
    • Hybrid guidance demo: Keep Automatic hybrid selected, check Continue guidance throughout and Allow redacted task context to go to cloud Gemini, and start with Complete the sample business registration form. Enter Apex Innovations LLC and [email protected] as the field bubbles appear, then click the highlighted Submit registration to reach Registration complete.
    • Check inference provenance: Expand Scan & inference activity in the side panel to see live Big scans, Small scans, Model calls, and the actual inference source (Gemini Nano on compatible Nano-enabled desktop Chrome profiles, or automatic Cloud Gemini fallback via hosted App Check on profiles where Nano is unavailable).

Challenges we ran into

  • Keeping Gemini idle during routine browsing: Naive DOM observers fire continuously while a user types or scrolls. Building bounded Big/Small Scans with dirty-region coalescing and state fingerprinting reduced scanner overhead to 37 ms / 5 ms with 0 extra website requests.
  • Zero-credential judge testing with App Check: Requiring judges to paste Firebase configs or App Check debug tokens creates friction. Hosting the practice portal with production App Check + reCAPTCHA v3 lets any judge verify the real Cloud Gemini fallback path in a clean Chromium profile with zero setup secrets.
  • Hardware availability variance for Gemini Nano: Not every desktop GPU meets Chrome's built-in AI VRAM threshold (for example, our 4 GB RTX 3050 test profile reports LanguageModel.availability() === "unavailable"). Building true hybrid routing through Firebase AI Logic ensures Firelens works reliably both on Nano-ready machines and via approved Cloud Gemini fallback.

Accomplishments & Rigorous Benchmarking (Both Models)

Rather than relying on anecdotal demos, we built reproducible offline, Playwright, and live-site benchmark harnesses for both models, froze our baselines, kept failed runs in the counts, and archived all 16 JSON result files and compressed browser traces in benchmark/results/ and detector/benchmark/results/.

1. Confusion Detection Model (v1 → v2 → v3)

  • Controlled Feature Ablation (1,920 held-out examples across 20 profiles, cutoff 0.65): | Model | Exact Class | Help Precision | Help Recall | Unwanted / 960 Quiet | Average Precision | | --- | ---: | ---: | ---: | ---: | ---: | | Frozen v1 | 658 / 1,920 | 59.2% | 65.9% | 436 | 0.719 | | Retrained on original 43 features | 1,641 / 1,920 | 95.4% | 78.1% | 36 | — | | v2 (450 trees, all 96 features) | 1,919 / 1,920 | 100% | 100% | 0 | 1.000 |
  • Byte-Identical Reproducibility & Runtime Speed: Pinned Python trainer regenerates byte-identical model weights (SHA-256 verified). Warm v2 inference runs in 0.039 ms p50 (0.148 ms p50 including full feature calculation; 31.4 ms p50 cold page-to-ready).
  • Real-Browser Checkpoints (W3C, IKEA, Wikipedia, IRCC): v2 matched 18 / 18 scripted checkpoints (13/13 quiet, 5/5 help) vs. v1's 4 false triggers and 2 misses, and completed 20 / 20 local offer-to-completion trials.
  • v3 Loop Refinement (40-Task Scripted Pilot + Fresh Frozen Holdout): To catch navigation backtracks and unproductive keyboard widget cycling exposed by our 40-task pilot, we added two lightweight logistic classifiers (no URLs or form values) on top of the 450-tree v2 base (500 ms sustained hold). On a fresh frozen Chromium holdout (16 runs on Python Docs, MDN, and W3C, with GOV.UK & USAJOBS reserved from fitting), v3 jumped from 1 / 7 → 5 / 7 help episodes matched (median delay 2.20 s) with 1 false alarm across 9 quiet runs, while maintaining 960 / 960 synthetic recall (0 quiet false alarms).

2. Visual Guidance / Annotation Model (6 Iterative Live Head-to-Head Rounds)

We benchmarked our refined text-grounded guide head-to-head against our frozen screenshot-based prototype (0c434b3) on live public websites (YouTube, W3C, Python Docs, MDN) in fresh 1250×860 Chromium contexts. Playwright hit-tests and clicks the exact center of each rendered highlight and verifies the real site state change: | Metric | Frozen Prototype (0c434b3) | Refined Firelens Guide | | --- | --- | --- | | Live 7-task public-site completion | 1 / 7 (full run) | 6 / 7 full run (7 / 7 with focused YouTube transcript retest verifying visible transcript rows) | | Cloud screenshot bytes sent | 607,812 bytes | 0 bytes (allowlisted, redacted text map only) | | First usable cue latency (Python Docs) | 1,423 ms (up to 6,411 ms in click-point run) | 962 ms (1,398 ms in click-point run) | | Vague goal ("Open a tab") | Guessed wrong tab | Asked clarifying question locally in 22 ms (0 Gemini calls), then highlighted the chosen tab | | Strict Trusted Types (YouTube) | Overlay blocked before model call | Passed (static TrustedHTML-safe DOM construction) |

  • 6 documented live iteration cycles (initial-live → refined-live → final-live → scroll-live → click-point-live → transcript-live + youtube-normal-live) caught and fixed real failures: YouTube Trusted Types blocking, fixed-header occlusion (scroll cues), dialog state verification, removing highlight position animation to keep click hit-testing accurate, and Wrong target exclusion.

3. Integrated Extension & Scanner Verification (Current main Branch)

  • 60 / 60 passing unit tests (npm test) covering v3 friction detection, scan-policy.js redaction, compaction, clarification, and hybrid escalation routing.
  • 15 / 15 passing Chromium behavior & unpacked extension tests (npm run test:browser + benchmark/native-extension.mjs), measuring 37 ms Big Scan, 5 ms Small Scan, and 0 extension-added site requests across navigations.
  • Verified live judge flow (benchmark/evaluator-browser.mjs): clean Chromium profile reaches Registration complete through hosted Firebase App Check + Cloud Gemini with zero debug tokens.
  • Honest scope limits documented in docs/evaluation.md: All browser evaluations measure reproducible scripted behavior; human usability recall and live Nano vs. Cloud human task speed remain clearly separated as next-step consented user studies (supported by our built-in local research recorder).

What we learned

Hybrid AI shines when each runtime does what it is uniquely suited for: a tiny local classifier + in-memory page graph handle continuous behavioral sensing and privacy boundaries with zero latency or data egress; Gemini Nano handles fast, private on-device guidance (including sensitive pages); and Cloud Gemini via Firebase AI Logic + App Check guarantees universal availability and heavier recovery reasoning whenever Nano is unavailable or a user remains stuck.

What's next

  • Expanding site-wide multi-page memory while preserving strict origin boundaries and zero-PII compaction.
  • Running consented human usability studies comparing unassisted vs. Firelens-guided completion times on real government and onboarding portals using our built-in local research recorder.
  • Adding optional on-device multimodal visual retry on complex canvas/SVG interfaces where semantic DOM labels are sparse.

Pre-Existing Work Disclosure

Firelens integrates and builds upon two earlier component prototypes created by the author (annotation-test at commit c0db1695 and reverse-engineering-test at commit 0c094eb9), both documented in docs/evaluation.md. During the #BuildHybridAI 2026 submission period, we unified both halves into one Manifest V3 extension, built the Big/Small Scan page graph (root/page-context.js), implemented scan-policy.js privacy guardrails and sensitive-page locking, wired Firebase AI Logic hybrid routing (Gemini Nano + Cloud Gemini + hosted App Check) with friction-triggered escalation, added contextual input speech bubbles, proactive Need help? → Show me handoff, vague-goal clarification, false-completion recovery watch, the hosted judge practice portal, and 60 unit + 15 Chromium/unpacked browser tests.

Built With

Share this project:

Updates

Submission history