Skip to content
Apr 2026Hackathon build

PrivacyLens

We paste sensitive stuff into AI chats without thinking twice. PrivacyLens runs a privacy model locally, in your browser, to catch the personal data before it goes, then redacts it so nothing private leaves without you knowing.

Stack
  • openai/privacy-filter (sparse MoE)
  • Transformers.js
  • ONNX / WebGPU
  • On-device token classification
  • Tesseract.js OCR
  • Gemini / Claude
  • TypeScript
  • Chrome MV3
01

Why I built it

The last time you pasted something into ChatGPT, you probably did not check what else was in there. A contract, an error log, a resume you wanted reworded, a screenshot of an email. Most people do not stop to look. The whole point of a chat box is that you type and it answers, so any friction you add feels like it is getting in the way. The trouble is that the stuff we paste is full of personal data we never meant to hand over: names, home addresses, phone numbers, account numbers, an API key someone left in a config file. Once it lands in a prompt it is gone. You cannot un-send it, and you do not really know where it went or how long it is kept. I built PrivacyLens because I did not want the answer to be "just be more careful." Being careful is work, and it is the kind of work your brain quietly refuses to do fifty times a day. So the tool does the checking for you. It looks at what you are about to send, catches the personal data on your own device, and holds the message so you can decide. You keep pasting the way you always have. The checking runs on its own, in the half second before anything leaves your browser.

02

What it does

PrivacyLens reads the text, PDFs, and images you're about to send to an AI service and runs the whole scan in your browser. When it finds personal data, it stops the message before it leaves your device. A fast regex pass gives you feedback as you type, and an on-device model (openai/privacy-filter, a 1.5B sparse mixture-of-experts classifier that runs through Transformers.js) does the deeper read on submit. Nothing is sent until you approve it or redact what it found. If you redact, it swaps the real values for placeholders like [NAME] or [SSN] and sends that instead, and in my testing the model on the other end answers just as well without the real details.

03

Where it helps

  • Pasting a work document into a chatbot to summarize or rewrite it, without shipping client names and internal figures along with it.
  • Debugging code you copied straight out of your editor, where a live API key or a real customer record is sitting three lines above the actual bug.
  • Uploading a resume, a lease, a medical form, or an invoice as a PDF or a photo, where the personal data is baked into the file and easy to forget about.
  • Anyone who uses these tools all day and does not want their own habits to be the thing that leaks their data.
04

How it works

  • Two scanners run together. A regex pass reacts to each keystroke, and an in-browser model does token classification when you submit. Their results are merged by confidence so overlapping matches resolve to one.
  • It handles more than plain text. pdfjs-dist pulls text out of PDFs, Tesseract.js runs OCR on images in the browser, and the Canvas API blacks out the detected regions so you can compare the original against the redacted copy.
  • The Ethics Logic Gate is a hard block in code. If the scan finds any personal data, the send pipeline stops and the button is disabled. You can still override it, but that takes a second confirmation.
  • The Chrome extension (Manifest V3) watches the input box on ChatGPT, Claude, Gemini, Perplexity, and Copilot, and you review what it caught in a side panel.
  • It runs two ways: as a full-stack app with an Express server behind it, or as a static build with no backend, where detection falls back to the pattern scanner and the in-browser model.
05

Key decisions

  • Detection runs locally rather than in the cloud, so the privacy guarantee comes from the architecture instead of a written policy. No content reaches a server before you approve it.
  • The gate blocks the send instead of warning about it. A warning is something you click through on autopilot, and you cannot recall a message once an AI service has it, so the safe default is to hold it until you actually decide.
  • The model is a sparse mixture of experts with 1.5B parameters total but only about 50M active per token, routed top-4 across 128 experts. That keeps semantic detection fast enough to run in the browser without a GPU.
  • Files the scanner cannot read are blocked by default, so personal data cannot slip through an unsupported format.
  • Built for the Kiro Spark Challenge on the ethics theme, under an MIT license.