Building client-side reflection mechanisms into modern AI chat interfaces requires balancing zero-friction user experience with robust intent classification. MindShield v1.2.0 introduces a fundamental rework of our local inference runtime, intent triage architecture, cross-platform DOM interception, and Firefox Manifest V3 compliance.
Previous iterations relied on binary pass/flag logic that proved overly restrictive on non-surrender queries. Blueprint v2.0 establishes a nuanced 3-tier triage hierarchy executed locally:
Bypasses all delays for factual lookups, concept breakdowns, comparative analysis, collaborative reviews, and context dumps exceeding 400 characters.
Renders a glassmorphic amber toast without blocking execution. Targeted at cognitive offloading like basic math (15 * 42), social drafting, and action requests.
Enforces a 5-second reflection timer specifically for direct problem-solving surrender, homework evasion, and puzzle shortcuts.
^ start-of-prompt regex anchors, allowing the model to catch offloading intent embedded midway through multi-sentence prompts (e.g., "Database crashed. Tell me exactly what to do.").MindShield is a privacy-first browser extension designed to help people maintain critical thinking while using AI. It introduces a brief moment of reflection when a prompt appears to ask AI to perform a simple task the user could reasonably think through themselves.
MindShield does not try to stop people from using AI. Instead, it is designed to make AI use more intentional by distinguishing between requests that benefit from AI assistance and requests that may simply outsource reasoning, problem-solving, or decision-making.
MindShield currently supports AI interfaces including ChatGPT, Claude, Google Gemini, and Grok. Prompt evaluation is performed locally in the browser using an on-device machine-learning model, rather than sending prompts to an external classification server.
Version 1.2.0 focuses on improving this system through a three-tier intent classification system, local AI inference, cross-browser compatibility, and more reliable prompt interception.
Running zero-shot classification via @xenova/transformers locally inside the browser presents strict memory and latency boundaries.
[Native Chat Input] ──> [Capture Event] ──> [Warm Offscreen / Service Worker RAM]
│
(DistilBERT-MNLI / ONNX WASM)
│
┌──────────────────┴──────────────────┐
▼ ▼
< 50ms Triage > 400 Chars Auto-Pass
Chrome's background service worker previously terminated the offscreen document post-eval, triggering full 28MB model re-downloads and re-compilations on subsequent queries (~10s latency). Implementing chrome.offscreen.hasDocument() checks keeps the offscreen document permanently warm in memory, bringing inference evaluation down to <50ms.
Candidate labels and hypothesis templates for distilbert-base-uncased-mnli were recalibrated for high-contrast output:
Handling Single Page Application (SPA) state transitions across ChatGPT, Claude, Gemini, and X.com (Grok) required refactoring event capture strategies:
div[role="button"] structures and [data-testid="grok-send-button"], attaching listeners to pointerdown, mousedown, and click phases.popstate and navigation events. Changing conversation threads immediately dismisses lingering toasts, clears active timers, and flushes state flags.Firefox MV3 does not support Chrome's offscreen API. To achieve full cross-browser feature parity, the Firefox build was re-engineered for direct in-process WebAssembly execution within the background module.
host_permissions for HuggingFace and jsDelivr CDN endpoints to eliminate network aborts. Set env.allowLocalModels = false; and constrained WASM threads (env.backends.onnx.wasm.numThreads = 1) to bypass SharedArrayBuffer cross-origin isolation requirements.innerHTML assignments in showToast() with strict document.createElement() and textContent DOM nodes. Manifest configurations updated with "data_collection_permissions": { "required": ["none"] } and a strict_min_version of 112.0.Explore the MindShield project, previous development work, source code, release information, and the Firefox extension: