Inspiration

I clicked "I agree" on a privacy policy again last week without reading a word. I'm not careless; the policies are just long, written in legal language, and hide the things that matter: who gets my data, how long it's kept, whether it trains AI models.

AI summarisers looked like the obvious fix, but they had two problems that bothered me. First, they give fluent answers I can't verify. Second, they ask me to send the entire policy to a cloud service, so a tool meant to protect my privacy starts by asking for my trust. I wanted to build the opposite: a tool that explains privacy policies with evidence, and that keeps my data on my device unless I say otherwise.

That's ClearCue — Understand Before You Agree.

What it does

ClearCue turns a privacy policy into a Privacy Nutrition Label covering six categories: data collection, collection purposes, third-party sharing, retention, deletion rights, and AI-training use. Each category is marked Found, Unclear, or Not found, and every finding links to the exact clause it came from.

You can also ask questions in plain language. Answers are built only from retrieved clauses and come with citations. If the policy doesn't say, ClearCue tells you that instead of inventing an answer.

How I built it

Local-first pipeline. Everything up to answer generation runs in the browser:

  1. The policy is parsed (text or PDF) and split into clauses with stable IDs, so every citation points at a real clause.
  2. Clauses are indexed with BM25, which scores a clause $D$ against a query $Q$ as

$$ \text{score}(D,Q)=\sum_{q_i \in Q}\text{IDF}(q_i)\cdot\frac{f(q_i,D)\,(k_1+1)}{f(q_i,D)+k_1\left(1-b+b\,\frac{|D|}{\text{avgdl}}\right)} $$

  1. The Nutrition Label engine classifies clauses into the six categories and attaches source clause links.
  2. An evidence verification step checks that the retrieved clauses actually support an answer before anything is generated.
  3. I also trained a relevance model with Python and scikit-learn on the PrivacyQA dataset to rerank BM25 candidates. <!-- EDIT: say whether it is active in the deployed build, or that the app uses BM25 fallback and the reranker is experimental -->

Hybrid inference with Firebase AI Logic. This is the core of the design, because the data being analysed is exactly the kind people care about:

  • On-device first: generation runs on Chrome's built-in model through the Prompt API, where supported (desktop Chrome 139+).
  • Cloud only with consent: if on-device isn't available, ClearCue asks for explicit approval before sending anything to cloud Gemini through Firebase AI Logic.
  • Private mode blocks cloud inference completely.
  • Firebase App Check with reCAPTCHA Enterprise protects cloud calls.
  • A local privacy ledger shows what ran on-device and what went to the cloud.

The model is only ever prompted with the retrieved clauses, not the whole document and not its own general knowledge. The app is built with JavaScript and Vite and hosted on Firebase Hosting.

Challenges I ran into

  • App Check on the deployed domain. Early browser tests returned an HTTP 400. It turned out to be about reCAPTCHA Enterprise allowed domains and keeping local debug tokens separate from the production key. I fixed it by testing on the public URL instead of only on localhost.
  • Keeping the AI honest. Language models love to answer. Getting ClearCue to say "the policy doesn't specify this" took an explicit evidence-verification step, not just a better prompt.
  • Uneven on-device AI support. The Prompt API needs a recent desktop Chrome, so I designed a clear fallback path rather than assuming every user has it.
  • Time. I built this on a tight timeline, so I prioritised a working, deployed core flow over adding features.

What I learned

  • Verifiability matters more than fluency. Linking every claim to a source clause changes how much a user can trust a result.
  • Hybrid inference makes the most sense when the data is sensitive. "On-device by default, cloud by consent" is a product decision as much as a technical one.
  • Fallbacks are part of the product. Browser AI capabilities vary, so graceful degradation matters as much as the happy-path demo.
  • Test on the deployed URL. Things that worked locally broke in production, especially App Check.

Limitations

ClearCue is informational, not legal advice. Its Nutrition Label classification is keyword and pattern based, so it can miss clauses or match the wrong ones, and findings should be checked against the original text. On-device inference isn't available in every browser, and scanned PDFs aren't OCR'd yet.

What's next

  • Policy version comparison: "what changed since the last version?"
  • A browser extension that analyses a policy at the moment you sign up
  • OCR for scanned documents and more languages
  • A larger, benchmarked classifier to replace keyword rules

Understand before you agree.

Built With

Share this project:

Updates

Submission history