Dev.to Security 🔐 Cybersecurity 👁 0 📖 2 min read

Building ClauseGuard AI: A Zero-Local-Footprint Dark-Pattern & Subscription Auditor with n8n, Olostep & Gemini 2.5

Nobody reads 20 pages of Terms & Conditions before clicking "Start Free Trial"—until a surprise annual renewal hits their card and the cancel button is buried six clicks deep. Most "AI legal analyzers" fail in real-worl

Nobody reads 20 pages of Terms & Conditions before clicking "Start Free Trial"—until a surprise annual renewal hits their card and the cancel button is buried six clicks deep.

Most "AI legal analyzers" fail in real-world usage because they force users to manually hunt down, copy, and paste walls of legal text into a chat window. For Homingo Hack Days 2026 (Theme: "Build AI that real people use"), I built ClauseGuard AI—an autonomous dark-pattern and subscription auditor that takes a single URL and handles discovery, scraping, adversarial auditing, and cancellation drafting end-to-end.

🌐 Live Web App: https://kanangandhi93.github.io/clauseguard-ai/
💻 GitHub Repository: https://github.com/kanangandhi93/clauseguard-ai

🎥 2-Minute Video Walkthrough

🏗️ Zero-Local-Footprint Architecture

Because I wanted the solution to be lightweight, reproducible, and executable with zero local compute overhead, the entire backend runs serverless in the cloud:

  1. Frontend (HTML5 + Tailwind CSS + Vanilla JS): Hosted on GitHub Pages with instant demo presets and a progressive loading stepper.
  2. Orchestration (n8n Cloud): An 8-node webhook-driven pipeline coordinating discovery, scraping, sanitization, and AI inference.
  3. Autonomous Discovery & Scraping (Olostep API):
    • /v1/maps: Recursively crawls the target domain to automatically uncover hidden /terms, /refund, /billing, and /cancellation routes.
    • /v1/scrapes: Extracts clean, JavaScript-rendered Markdown without brittle CSS selectors.
  4. Adversarial Reasoning & Security (Google Gemini 2.5 Flash):
    • Uses strict JSON responseSchema enforcement to return structured risk metrics.
    • Wraps scraped untrusted web content inside XML delimiter tags (<untrusted_legal_text>) to mitigate indirect prompt-injection attacks from malicious webpages.

🛡️ What ClauseGuard AI Outputs in <20 Seconds

  • Dark-Pattern Risk Score (0–100): Categorizes subscriptions from Low Friction to High Trap.
  • Plain-English TL;DR: Highlights silent auto-renewals, 30-day advance cancellation windows, and non-refundable lock-ins.
  • Verbatim Evidence Quotes: Every flagged trap is backed by exact quotes pulled directly from the vendor's legal pages—eliminating LLM hallucinations.
  • One-Click "Escape Hatch": Extracts buried support email addresses and pre-drafts a legally clear cancellation and auto-debit revocation notice ready to copy or launch in your mail client.

🚀 Try It & Contribute

You can test any SaaS pricing or product URL right now on the Live Demo or import the n8n-workflow.json from the GitHub Repository to run your own instance.

What's the worst subscription cancellation trap you've ever encountered? Let me know in the comments! 👇

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.