Skip to content

ClauseGuard is a Chrome extension that analyzes terms, privacy policies, and contracts to flag hidden risks, simplify legal jargon, and help users make smarter choices before clicking “I Agree.”

Notifications You must be signed in to change notification settings

0x-stone/ClauseGuard

Repository files navigation

ClauseGuard Logo

ClauseGuard

🚨 Spot hidden risks before you click “I Agree.”

ClauseGuard is a Chrome extension that scans Terms & Conditions, Privacy Policies, and legal contracts to flag hidden risks that could impact your rights, finances, or privacy. With instant alerts and plain-language summaries, you’ll always know what you’re agreeing to — before you click “I agree.”


✨ Why ClauseGuard?

  • 🛡 Protect yourself from unfair terms and hidden fees
  • Save time with intelligent AI-powered risk detection
  • 🧠 Understand legal jargon in plain English
  • 📄 Stay informed and in control of every agreement

Sign smart. Stay protected. Every time.


🚀 Quick Start

📽️ Demo Video

ClauseGuard.Demo.mp4

⬇️ Install from Chrome Web Store


🔍 How It Works

  1. Smart Popup → On signup, login, checkout, or account setup pages, ClauseGuard automatically displays an icon. Click it to instantly analyze all legal links (Terms, Privacy, Policies) on that page.
  2. Scan Options → From the extension, you can:
    • Upload a contract for instant analysis
    • Paste or enter any link for review
    • Scan the current page with one click
  3. Backend Magic → ClauseGuard sends the request to the backend (via the extension), where analysis happens.
  4. Plain-Language Results → Risky clauses are flagged, explained in simple terms, and highlighted back in the extension.

🏗️ Architecture

High-Level Flow

flowchart TD
    A[User Action in Extension] -->|Send Document/Link| B[FastAPI Backend]
    B -->|Link| C[Playwright Scraper]
    B -->|Document| D[Doc Processor]
    D -->|Chunking + Keyword Filtering| E[LLM Analyzer - LangChain + Gemini]
    C -->|Extracted Text Chunks| E
    E --> F[Risk Flags + Summaries]
    F --> G[Return Results to Extension]
    G --> H[Display to User]
Loading

⚙️ Backend Architecture

  • FastAPI → Lightweight, async API server
  • Playwright → Scrapes and extracts text from URLs
  • Document Processor → Handles uploaded contracts (max 10 MB), splits into chunks, keyword-filters, and routes only relevant sections for analysis
  • LangChain + Gemini → LLM-powered analyzer that flags risks with custom prompts
  • MongoDB → Stores cached results for links (24h) to optimize cost/performance
  • Caching → Prevents re-analyzing the same link within 24 hours
  • Privacy-first → No documents are permanently stored; everything is deleted immediately after analysis

🖥️ Frontend Architecture

  • Chrome Extension:

    • Auto-detects Terms & Privacy links on pages
    • Smart Popup icon shows up when relevant
    • Options to scan current page, upload documents, or paste links
    • Displays analysis results in a clean, user-friendly panel

☁️ Infrastructure

  • AWS EC2 → Hosts backend
  • Docker + Docker Compose → Containerized deployment
  • GitHub Actions → CI/CD pipeline for seamless updates
  • AWS Application Load Balancer (ALB) → Balances traffic and provides HTTPS termination

🛡️ Privacy & Security

  • No data stored — all documents are deleted immediately after analysis
  • 24h cache only for links — saves compute costs without exposing sensitive info
  • 🔒 User-first design — transparency and privacy are core principles

🛠️ Tech Stack

  • Frontend: Chrome Extension (JavaScript/HTML/CSS)
  • Backend: FastAPI (Python)
  • Scraping: Playwright
  • LLM Framework: LangChain
  • AI Model: Google Gemini
  • Database: MongoDB (caching only)
  • Infrastructure: AWS EC2, Docker, ALB, GitHub Actions

🤝 Contributing

Got ideas or spotted something we can improve?
Open an issue or reach out — contributions and feedback are always welcome!


⚖️ License

All rights reserved © 2025 ClauseGuard.

About

ClauseGuard is a Chrome extension that analyzes terms, privacy policies, and contracts to flag hidden risks, simplify legal jargon, and help users make smarter choices before clicking “I Agree.”

Topics

Resources

Stars

Watchers

Forks