We all know the story. You sign up for a new app. A huge wall of legal text appears. Without thinking, you scroll down and click "I Accept". As developers, we know this hides massive data collection. But we just do not have time to read 40 pages of text.
I built a solution for the Microsoft Agents League Hackathon (Reasoning Agents Track) in collaboration with Microsoft Foundry.
Meet TrustGuard AI. It is a multi-agent system. It does not just summarize policies. It uses logic to find real risks. It catches hidden tricks. It compares site safety to big tech companies.
1. Logic vs. Summaries
Most AI legal tools only summarize. But making a bad rule shorter does not make it safe. It is still a bad rule.
I wanted the AI to reason. I used Azure AI Foundry (GPT-5.4) to build a pipeline. TrustGuard acts like a factory line. Each agent has one job. It passes context to the next agent to build a final risk report.
2. The 6-Agent Pipeline
The system relies on 6 specialized agents:
- Extractor: Reads and sorts every rule (data collection, sharing, and user rights).
- Legal Reasoner: Finds real-world risks. (For example: What happens to you if this company gets hacked?).
- Dark Patterns Detector: Finds hidden tricks. It looks for forced consent and unclear words.
- Readability Analyzer: Checks how hard the text is to read. It uses Flesch-Kincaid and AI scoring.
- Rights Auditor: Checks 7 basic user rights (access, delete, etc.). It scores how easy it is to use them.
- Comparator (Policy DNA™): Compares the site to 8 big platforms.
3. Key Features
- Policy DNA™: It gives a clear risk score. Instead of random numbers, it says: "This site is 23% riskier than TikTok".
- Change Tracker: Companies change rules quietly. I built a tracker using
SHA-256. It spots hidden updates between your visits. - Global Compliance: It checks 6 major laws at the same time (GDPR, CCPA, PDPA, PIPEDA, LGPD, DPDPA).
4. Architecture & Data Flow
This is how data moves through the system:
User Input (URL or raw text)
│
▼
┌───────────────────────────────────────────────────────┐
│ TrustGuard Pipeline │
│ │
│ [Agent 1] [Agent 2] [Agent 3] │
│ Extractor → Legal Reasoner → Dark Patterns │
│ │
│ [Agent 4] [Agent 5] [Agent 6] │
│ Readability → Rights Auditor → Comparator │
│ │
│ + Change Tracker (SHA-256 diff between visits) │
└───────────────────────────────────────────────────────┘
│
▼
Tabbed Interactive Dashboard + PDF Report Export
Tech Stack:
- AI & LLM: Azure AI Foundry · GPT-5.4
- Backend: Python · Flask ·
fpdf2 - Frontend: Vanilla JS · HTML/CSS
- Processing:
BeautifulSoup4·requests· Local Flesch-Kincaid logic
5. Source Code
Building a pipeline with many agents was a fun challenge. Managing the context window and passing data between agents took a lot of work. The project is open-source for personal use under the PolyForm Noncommercial license.
Source Code
→ View on GitHub
Demo Video
→ Watch the pipeline in action
I would love to hear your thoughts. Feel free to reach out on LinkedIn or GitHub if you have built similar AI systems.