DEV Community

Komal deep
Komal deep

Posted on Edited on

I Built a Privacy Policy Explainer That Doesn't Ask for Your Privacy

What I Built

ClearCue — Understand Before You Agree.

We accept privacy policies we never read. They are long, written in legal language, and the details that matter (who gets your data, how long it's kept, whether it trains AI) are buried.

AI summarisers could help, but most of them have two problems:

  1. They produce fluent text you can't verify.
  2. They upload the entire policy to a cloud model, so a tool meant to protect your privacy asks for your trust first. ClearCue is built around the opposite idea:
  • Evidence first. Every finding links to the exact clause it came from.
  • Honest about gaps. If the policy doesn't say something, ClearCue says Not found or Unclear instead of making something up.
  • Local first. Processing happens in your browser. AI runs on-device when possible, and cloud AI needs your explicit consent.

🔗 Try it

  • Live app: https://clearcue-6ac00.web.app/ (no login needed; works best in desktop Chrome 139+)
  • Code:

    ClearCue — Understand Before You Agree

    A privacy-first, evidence-linked AI assistant that explains privacy policies before you click "I agree". It runs on-device first and uses cloud AI only with your explicit consent.

    Built for #BuildHybridAI 2026 with Firebase AI Logic hybrid inference.

    Live app https://clearcue-6ac00.web.app
    Author Komal Deep (@KomalDeep355)
    Licence MIT

    For judges: start here (60 seconds)

    1. Open https://YOUR_PROJECT_ID.web.app in desktop Chrome 139+. No login or credentials needed.
    2. Click Load sample policy (synthetic) or upload/paste any privacy policy (text or PDF).
    3. Look at the Privacy Nutrition Label. Click any finding to jump to the exact clause it came from.
    4. Ask a question the policy answers, then one it does not. Compare the two responses.
    5. Request a cloud answer and watch the consent dialog. Turn on Private mode and confirm cloud inference is blocked.
    6. Open the privacy ledger to see where each request ran…

What ClearCue does

1. A Privacy Nutrition Label. ClearCue reads a policy and gives you six categories at a glance, each marked Found, Unclear or Not found:

  • Data collection
  • Collection purposes
  • Third-party sharing
  • Retention
  • Deletion rights
  • AI-training use

2. Receipts for everything. Click any finding and the app jumps to the exact clause it came from. You don't have to trust the AI. You can check it in one click.

3. Q&A that admits what it doesn't know. Ask "Does this service share my data with third parties?" and you get an answer with citations. Ask something the policy never mentions and ClearCue says the policy doesn't specify, instead of inventing an answer.

4. Privacy controls you can see.

  • On-device first: AI runs in your browser when possible.
  • Consent for cloud: nothing goes to the cloud until you say yes.
  • Private mode: blocks cloud inference completely.
  • Privacy ledger: shows where each request ran.

How I Used Firebase AI Logic (Hybrid Inference)

Hybrid inference isn't a bolt-on here; it's the reason the product makes sense. The data being analysed is the kind people care about, so the default path should keep it local.

Question + retrieved clauses
   │
   ├─ Private mode on? ──► on-device only
   │
   ├─ On-device model available? ──► run on-device (Chrome Prompt API)
   │
   └─ Otherwise ──► ask for explicit consent ──► cloud Gemini via Firebase AI Logic
                                                  (protected by App Check)
🏆 ยอดนิยม: komal deep /i built a privacy policy explainer that doesnt ask for your privacy p - Kapook Update 2025 🏆 ยอดนิยม: komal deep /i built a privacy policy explainer that doesnt ask for your privacy p - Kapook Update 2025
  • On-device: Chrome's built-in model through the Prompt API (desktop Chrome 139+ with the feature enabled).
  • Cloud: Gemini through Firebase AI Logic, with Firebase App Check (reCAPTCHA Enterprise) to limit calls to the real deployed app.
  • Firebase Hosting for deployment. An important design rule: the model is prompted only with retrieved clauses, and an evidence-verification step decides whether there's enough support to answer at all.

Architecture

flowchart TD
    U[User] --> UI[ClearCue UI · Vite + JS]
    UI --> P[Parser: text / PDF]
    P --> S[Clause segmenter]
    S --> IDX[BM25 index]
    S --> NL[Nutrition Label engine]
    IDX --> RR[Reranker / BM25 fallback]
    RR --> EV[Evidence verifier]
    EV --> O[Inference orchestrator]
    O -->|Private mode or on-device available| OD[On-device model]
    O -->|User consent| FB[Firebase AI Logic]
    FB --> AC[App Check] --> G[Gemini]
    O --> L[(Local privacy ledger)]
    OD --> UI
    G --> UI

The pipeline in plain words:

  1. Ingest the policy in the browser. Nothing is uploaded to a ClearCue server.
  2. Segment it into clauses with stable IDs, so every citation points at something real.
  3. Index the clauses with BM25.
  4. Classify clauses into the six Nutrition Label categories.
  5. Retrieve candidate clauses for a question, with an optional learned reranker.
  6. Verify that the evidence actually supports an answer.
  7. Generate on-device or in the cloud, prompting the model with only the retrieved clauses.
  8. Present the answer with citations and log it in the ledger.

Tech Stack

JavaScript · Vite · Firebase AI Logic · Firebase App Check (reCAPTCHA Enterprise) · Firebase Hosting · Gemini · Chrome Prompt API · BM25 · Python + scikit-learn (relevance model trained on PrivacyQA)

What I Learned

  • Verifiability beats fluency. Linking every claim to a clause changes how much you can trust a result.
  • Hybrid inference shines when the data is sensitive. "On-device by default, cloud by consent" is a real product decision, not just a technical one.
  • Browser AI support varies. On-device inference needs a recent desktop Chrome, so graceful fallbacks matter more than demos.
  • App Check on a deployed domain is fiddly. I hit an HTTP 400 early on; the fix was getting the reCAPTCHA Enterprise allowed domains and local debug-token setup right.

    Limitations (honestly)

  • ClearCue is informational, not legal advice.

  • Nutrition Label classification is keyword/pattern based and can miss or misread clauses — always check the original text.

  • On-device inference isn't available in every browser.

  • Scanned PDFs aren't OCR'd.

  • The deployed app uses BM25 retrieval. I also trained an experimental PrivacyQA reranker (Recall@6 0.1267 to 0.1356, nDCG@6 0.2569 to 0.2760 on the recorded experiment), but it is not part of the deployed build.

    What's Next

Policy version comparison ("what changed?"), a sign-up-time browser extension, OCR, more languages, and a larger benchmarked classifier.

Understand before you agree.

<!-- Thanks for reading! Feedback welcome in the comments. -->.

Top comments (0)