A

A local-first, reversible PII scrubber for AI workflows

Hacker News

A local-first, reversible PII scrubber for AI workflows

Hi HN, I’m one of the maintainers of Bridge Anonymization. We built this because the existing solutions for translating sensitive user content are insufficient for many of our privacy-concious clients (Governments, Banks, Healthcare, etc.). We couldn't send PII to third-party APIs, but standard redaction destroyed the translation quality. If you scrub "John" to "[PERSON]" , the translation engine loses gender context (often defaulting to masculine), which breaks grammatical agreement in languages like French or German. So we built a reversible, local-first pipeline for Node.js/Bun. Here is how we implemented the tricky parts: 0. The Mapping We use XML-like tags with ID’s that uniquely identify the PII, `<PII type=”PERSON” id=”1”>`. Translation models and the systems around them work with XML data structures since the dawn of Computer Aided Translation tools, so this improves compatibility with existing workflows and systems. A `PIIMap` is stored locally for rehydration after translation (AES-256-GCM-encrypted by default). 1. Hybrid Detection Engine Obviously neither Regex nor NER was enough on its own. - Structured PII: We use strict Regex with validation checksums for things like IBANs (Mod-97) and Credit Cards (Luhn). - Soft PII: For names and locations, we run a quantized `xlm-roberta` model via `onnxruntime-node` directly in the process. This lets us avoid a Python sidecar while keeping the package ‘lightweight’ (still ~280MB for the quantized model, but acceptable for desktop environments). 2. The "Hallucination" Guard (Fuzzy Rehydration) LLMs often "mangle" the XML placeholders during translation (e.g., turning `<PII id="1"/>` into `< PII id = « 1 » >`). We implemented a Fuzzy Tag Matcher that uses flexible regex patterns to detect these artefacts. It identifies the tag even if attributes are reordered or quotes are changed, ensuring we can always map the token back to the original encrypted value. 3. Semantic Masking We are currently working on "Semantic Masking"—adding context to the PII tag (like `<PII type="PERSON" gender="female" id="1" />` ) to preserve (gender) context for the translation. For now, we are relying on a lightweight lookup-table approach to avoid the overhead of a second ML model or the hassle of fine tuning. So far this works nicely for most use cases. The code is MIT licensed. I’d love to hear how others are handling the "context loss" problem in privacy-preserving NLP pipelines! I think this could quite easily be generalized to other LLM applications as well.

Share card

Actual performance

38points
14comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
82%82% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: model, user, computer · Missing: mac, agents, macos
78%78% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: exist, existing, ide · Missing: https docs, excited, just released
50%50% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
40%40% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
33%33% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
11%11% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Pi
Pipelex – Declarative language for repeatable AI workflows66%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Pipelex – Declarative language for repeatable AI workflows

Hacker News122
Tersa
Tersa76%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Visualize your AI workflows

Product Hunt+237Open Source
Vi
Videopython – local-first video processing, editing and AI workflows61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Videopython – local-first video processing, editing and AI workflows

Hacker News4
Finyuus
Finyuus81%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A code-first language for durable, governed AI workflows

Product Hunt+81Open Source
Fl
Floneum, a graph editor for local AI workflows62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Floneum, a graph editor for local AI workflows

Hacker News61
LLMGraph
LLMGraph24%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

No-code builder for LLM & AI workflows

Indie Hackers
Co
ContextUI open sourced – Local first AI workflows for humans and agents61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

ContextUI open sourced – Local first AI workflows for humans and agents

Hacker News4
Pa
Paraglide: Create no-code automated AI workflows in minutes50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Paraglide: Create no-code automated AI workflows in minutes

Hacker News3
MailJunky AI
MailJunky AI54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Simplify Email Automation with AI Workflows

Indie Hackerscommitment-side-project
Im
Implement repetitive multi-step AI workflows with no code49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Implement repetitive multi-step AI workflows with no code

Hacker News1