ClauseLens
Privacy-First In-Browser Legal Policy & Clause Analyzer
Lightweight, zero-telemetry browser extension and web application that audits Terms of Service, Privacy Policies, and user agreements in real-time. Operates 100% client-side with deterministic heuristics, flagging high-risk clauses and stealth policy updates without uploading a single byte of user data to the cloud.
Technologies & Tools Employed
ENGINEERING STATUS: VERIFIED & SHIPPED
ClauseLens — Privacy-First In-Browser Legal Policy & Clause Analyzer
ClauseLens is a lightweight, zero-telemetry browser extension and web application that audits Terms of Service, Privacy Policies, and user agreements in real-time. It operates 100% client-side with deterministic heuristics, flagging high-risk clauses and stealth policy updates without uploading a single byte of user data to the cloud.
1. The Problem & The Solution
The Problem
Modern online agreements are dense, legalistic, and rarely read by consumers, burying predatory terms like forced arbitration waivers, automatic subscription renewals, and data broker syndication. Most AI summarizers send private legal documents to remote third-party cloud LLMs that hallucinate and track user browsing history.
The Solution
ClauseLens runs an entirely offline, deterministic heuristic engine directly in browser memory. It anchors every single finding to verifiable, verbatim text on the live webpage, guaranteeing absolute privacy and zero latency (<150ms).
+-------------------------------------------------------------------------+
| ClauseLens Engine |
| |
| [Active Webpage] |
| │ |
| ▼ |
| DOM Traversal & Text Extraction ───► In-Memory Text Normalizer |
| │ |
| ▼ |
| Deterministic Heuristic Matcher |
| │ |
| ┌─────────────────────────────────────────┴───────────────┐ |
| ▼ ▼ |
| 13+ Risk Pattern Engine SHA-256 Content |
| (Arbitration, Renewals, Tracking, etc.) Diff Fingerprint |
| │ │ |
| ▼ ▼ |
| Verbatim Grounded Clause Anchors Stealth Policy |
| (Jump directly to DOM node on page) Update Detection |
| │ │ |
| └────────────────────┬────────────────────────────────────┘ |
| ▼ |
| Dual-Surface Brutalist UI |
| (Browser Popup / SidePanel) |
+-------------------------------------------------------------------------+
2. Key Features & Highlights
- 100% Local In-Memory Analysis: Zero data collection, zero network calls, zero accounts or logins required. Document text never leaves the user’s device.
- Deterministic Risk Detection: Flags high-impact legal risks across 13+ categories (forced arbitration, class action waivers, unilateral terms modifications, automatic renewals, and data sharing).
- Grounded Clause Locators: No generative AI hallucinations—findings jump directly to exact sentences and section headings on the active webpage.
- Cryptographic Silent Change Diffing: Generates local content fingerprints to automatically highlight added, modified, or removed clauses when a user revisits updated agreements.
- Dual-Surface UX: Operates seamlessly across standard popup and modern browser SidePanel modes.
- Distinctive Brutalist Aesthetic: Clean, editorial design language engineered with sharp lines, high-contrast monospace indicators, and tactile micro-interactions.
3. Risk Categories & Detection Heuristics
ClauseLens covers 13+ critical consumer-rights risk classifications:
| Risk Category | Detection Heuristic Pattern | Potential Impact |
|---|---|---|
| Forced Arbitration | Mandatory arbitration, binding dispute resolution, AAA/JAMS rules | Forfeits right to court trial |
| Class Action Waiver | Class representative waiver, collective proceedings prohibition | Prevents collective legal action |
| Unilateral Amendments | "We reserve the right to modify these terms at any time without notice" | Sudden policy changes without consent |
| Auto-Renewals | Automatic recurring billing, negative option renewal, cancellation traps | Hidden charges and friction to cancel |
| Data Broker Syndication | Third-party ad networks, telemetry sharing, profile enrichment | Loss of identity and browse privacy |
| Governing Law / Venue | Exclusive foreign jurisdiction and distant forum clauses | Prohibitive litigation expenses |
| Limitation of Liability | Consequential damage disclaimers, fee caps equal to 1-month payment | Zero recourse for critical data breaches |
4. Technical Stack & Architecture
- Monorepo: Turborepo with Bun as package manager and high-performance runtime.
- Browser Extension (
apps/extension): WXT (Next-gen Web Extension Framework), React 19, TypeScript (Strict Mode), Tailwind CSS v4, Lucide Icons. - Web Platform (
apps/web): Next.js (App Router), React 19, TypeScript, custom brutalist design system. - Parsing & Algorithms: Client-side DOM parsing, deterministic heuristic pattern matchers, text normalization, and cryptographic hashing (
SHA-256via Web Crypto API) for version diffing.
clauselens/
├── apps/
│ ├── extension/ # WXT Browser Extension (Manifest V3)
│ │ ├── entrypoints/ # Popup, sidepanel, content scripts
│ │ └── components/ # Brutalist clause badges, risk meters
│ └── web/ # Next.js App Router Web Platform
│ ├── app/ # Landing page, policy tester, docs
│ └── lib/ # Shared client-side analysis utilities
├── packages/
│ ├── core/ # Deterministic heuristic engine & rules
│ ├── diff/ # SHA-256 fingerprinting & policy diffing
│ └── ui/ # Shared design tokens & UI components
└── turbo.json
5. Results & Lessons Learned
- Sub-150ms Deterministic Execution: Running heuristics directly in client browser memory eliminated remote network overhead and third-party API dependencies, auditing 5,000+ word agreements in under 150ms with zero telemetry.
- Grounding Outperformed Generative Summarization: LLM summarization often introduces hallucinations and false consensus. Anchoring every finding directly to verbatim DOM text nodes provided verifiable legal evidence without trust issues.
- Client-Side Cryptographic Diffing: Hashing normalized DOM text blocks with SHA-256 enabled instant detection of stealth policy modifications across visits with zero cloud persistence or telemetry.
- Monorepo DX Across Extension & Web: Standardizing on Turborepo with Bun and WXT allowed sharing parsing heuristics and design tokens across Manifest V3 side panels, popup surfaces, and Next.js web applications without code divergence.
6. Feedback & Issue Submission
Have you encountered a Terms of Service clause that was misclassified, or want to contribute new deterministic heuristic rules and risk classifications?
All issues, false-positive reports, and rule enhancement proposals are tracked publicly:
