● Build passing Java 17+ Apache 2.0 ⭐ GitHub 🔗 Playground

AI Privacy Firewall for Java

Intercept LLM prompts, detect PII using a hybrid Regex + Naive Bayes pipeline, and replace sensitive data with structured tokens — before it leaves your network.

SSN Credit Card Email Phone IPv4 / IPv6 API Keys Passwords Names (ML) Orgs (ML) IBAN
Input Text
Redacted Output
🔐
Redacted text will appear here

Reverse Map (de-tokenisation)

How It Works

Input
Raw Text
Any string: LLM prompt, email body, support ticket, log line…
Layer 1
HeuristicDetector
10 pre-compiled regexes. Luhn for cards, NANP for phones, entropy filter for API keys.
Layer 2
MLDetector
Multinomial Naive Bayes. Classifies title-cased tokens using bag-of-words context features.
Merge
CompositeDetector
De-duplicates overlapping matches. Promotes same-span matches to HYBRID source.
Output
PIITokenizer
TOKEN / MASK / BLANK modes. Reverse map for de-tokenisation after LLM response.