T&C Guardian is a sophisticated AI-driven tool designed to demystify complex "Terms and Conditions" documents. Using state-of-the-art LLMs and agentic workflows, it scans legal pages in real-time, identifies hidden risks, and provides a clear safety grade—all within your browser.
Most users skip Terms & Conditions because they are long, complex, and filled with "legalese." This often leads to unknowingly agreeing to invasive data sharing, hidden fees, or unfair arbitration clauses. T&C Guardian acts as your personal legal advisor, highlighting what actually matters before you click "Agree."
- One-Click Analysis: Scan any website's T&C page directly from the extension.
- Agentic AI Pipeline: Powered by LangGraph, it handles scraping and analysis with deterministic reliability.
- Risk Scoring: Get an instant safety score (0-100) and a letter grade (A-F).
- Categorized Findings: Risky clauses are grouped into Privacy, Financial, Legal, and Data Rights.
- Real-Time Summaries: Concise explanations of complex legal jargon.
T&C Guardian is built using a production-ready Agentic RAG stack. Unlike standard "wrapper" extensions that simply pass text to an LLM, this project implements a state-of-the-art orchestration layer.
| Component | Standard AI Extension | T&C Guardian |
|---|---|---|
| Orchestration | Linear/Sequential: A single request-response loop to the LLM. | Agentic (LangGraph): Iterative loops where agents evaluate, critique, and refine findings. |
| Data Retrieval | Context Window Stuffing: Sends whole page text at once, hitting token limits. | RAG Pipeline: Intelligently fetches and transforms specific sections (XML/Markdown). |
| Processing | Black Box: Processing happens on proprietary servers (data may be logged). | Local/BYO-Key: Processing logic is transparent; users provide their own keys. |
| Output Logic | Generative Summary: Produces a general "vibe" of the terms. | Deterministic Triage: Maps findings to specific risk categories with a weighted Safety Score. |
The system moves beyond the "Wrapper Model" (Scrape -> Send -> Summarize) and instead employs a robust, multi-stage pipeline designed for high-stakes auditing.
The system fetches legal text (ToS, Privacy Policies) and transforms it into a structured format like Markdown with YAML frontmatter. This preserves the document hierarchy and ensures that the AI understands the context of specific headers and clauses.
Instead of a single prompt, the system enters a graph-based state machine where specialized agents collaborate:
- The Auditor Agent: Scans the structured text for specific "Harmful Clauses" (Liability, Data Usage, Arbitration, etc.).
- The Triage Agent: Categorizes the severity of each flag found (Critical, High, Medium).
- The Scoring Agent: Calculates a final Safety Score based on the density and severity of the identified risks.
graph TD
A[Chrome Extension] -- URL --> B[FastAPI Backend]
B -- Initial State --> C{LangGraph Workflow}
subgraph Agentic_Core [LangGraph State Machine]
C --> D[Scraper Node]
D --> E[Auditor Node]
E --> F[Triage Node]
F --> G[Scoring Node]
end
G -- JSON Result --> B
B -- Response --> A
Every flagged clause is grounded in the actual document text using a semantic retriever. This ensures the audit is based on verifiable evidence rather than LLM hallucinations. If a clause is flagged, the system points to the exact paragraph that triggered the warning.
Because the "brain" of the project is transparent and runs using your own API credentials, your legal audits remain private. You own the logs, you own the keys, and you own the data.
| Component | Technology |
|---|---|
| Backend | FastAPI (Python) |
| Orchestration | LangGraph (Stateful Agents) |
| LLM | Groq (Llama 3.3 70B) |
| Scraping | Crawl4AI / BeautifulSoup |
| Frontend | Chrome Extension (Manifest V3, Vanilla JS/CSS) |
- Python 3.10+
- A Groq API Key
- Google Chrome (or any Chromium-based browser)
git clone https://github.com/your-username/t-c-guardian.git
cd t-c-guardian- Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Linux/macOS .venv\Scripts\activate # On Windows
- Install dependencies:
pip install -r requirements.txt
- Configure Environment Variables:
Create a
.envfile in the root directory:GROQ_API_KEY=your_groq_api_key_here
- Run the server:
The backend will be available at
uvicorn backend.main:app --reload
http://localhost:8000. You can visit/docsfor the interactive API documentation.
- Open Chrome and navigate to
chrome://extensions/. - Enable "Developer mode" (toggle in the top right).
- Click "Load unpacked".
- Select the
extensionfolder from the root of this project. - Pin the T&C Guardian icon to your toolbar for easy access.
- Navigate to any website's Terms of Service (e.g., Google Terms).
- Click the T&C Guardian extension icon.
- Click "Scan This Page".
- Wait a few seconds for the AI to analyze the content and present the findings.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Built with consideration for a safer internet.