Why I built a 100% offline, single-file PII scrubber for LLMs (zero dependencies)
DEV Community

Why I built a 100% offline, single-file PII scrubber for LLMs (zero dependencies)

If you use ChatGPT, Claude, or Gemini for work, you've probably hit the same annoying bottleneck: pasting client contracts, invoices, or CSVs without leaking real names, emails, and budgets.

Manually finding and replacing sensitive terms every time is tedious and error-prone. On the other hand, most online PII scrubbers are either monthly SaaS tools or require sending your confidential text to another third-party server - which completely defeats the point of privacy.

So I built MaskBack - a 100% client-side, single-file browser utility that masks sensitive data locally and restores the AI's reply back 1:1.

👉 Try the free web version here: https://ringng.github.io/maskback/

How the Reversible Workflow Works

  • Mask: Paste your text (or click Load Sample Contract). MaskBack detects emails, phone numbers, currency amounts, dates, IDs, IPs, and your custom terms, replacing them with deterministic tokens like [EMAIL_1], [AMOUNT_1], or [TERM_1].
  • Prompt AI: Paste the masked text into any LLM. Because the tokens preserve structure and context, the AI still summarizes, rewrites, or analyzes accurately.
  • Restore: Paste the AI's response back into Step 2. MaskBack uses an in-memory mapping vault to swap every token back to its original value.

Under the Hood (Why Zero Dependencies?)

To make the privacy guarantee verifiable, I kept the architecture intentionally minimal:

  • Single standalone HTML file: Zero external CDNs, zero analytics, zero network calls. You can open DevTools (Network tab), switch to airplane mode, and it still works.
  • Overlap resolution: Regex detection handles overlapping matches cleanly so tokens don't break each other during the round-trip.
  • In-memory vault: Mappings live only in your active browser tab - hit Clear Session or close the tab, and everything is gone.

Free vs. Offline Pro

The web version at ringng.github.io/maskback is free to use (500-word cap, 3 custom terms, copy-paste).

For anyone who needs unlimited length, RFC-4180 cell-safe .csv / .txt / .md file masking, saveable localStorage term presets, and a standalone HTML file to keep offline forever, I also packaged a $9 one-time Pro version (no subscriptions) linked inside the app.

If you test it out and spot any regex edge cases or formatting quirks, I'd love to hear your feedback in the comments!

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.