piilite vs OpenRedaction
piilite is far more accurate on Indian data; OpenRedaction is broader and has enterprise modules. You can use both together.
Which one should I use?
| If you need | Use |
|---|---|
| Indian users, chats, résumés, KYC, LLM prompts | piilite |
| A small bundle, the browser, edge runtimes or streaming LLM output | piilite |
| IDs from many countries | piilite with the OpenRedaction bridge, or OpenRedaction |
| PDF, DOCX, OCR or XLSX input | piilite with the OpenRedaction bridge, or OpenRedaction |
| An audit database, RBAC, multi-tenancy or webhooks | OpenRedaction |
How accurate is each on Indian data?
On the same held-out benchmark of 480 samples, piilite caught 84.3% of personal data and OpenRedaction 45.7%. OpenRedaction redacted something in 86.7% of PII-free sentences; piilite did in 6.7%.
| Metric | piilite | OpenRedaction 1.1.5 |
|---|---|---|
| Recall | 84.3% | 45.7% |
| Precision | 99.7% | 76.7% |
| False alarms on clean text (lower is better) | 6.7% | 86.7% |
OpenRedaction was run as its lite entry with default options. Its full class with NER enabled was not scored. Method and per-type results.
How do their features compare?
| Feature | piilite | OpenRedaction |
|---|---|---|
| Indian IDs with checksums (Aadhaar, PAN, GSTIN, UPI …) | Yes, 20+ types | Aadhaar and IFSC |
| Hinglish and Indian scripts | Yes | No |
| Patterns for other countries | Through the bridge (110 types) | 570+ patterns, 50+ countries |
| Size | About 28 KB gzipped | About 500 KB of core code |
| Fuzzy restore of placeholders | Yes | Exact only |
| Streaming for LLM token streams | Yes | Chunked streaming detector |
| PDF, DOCX, OCR, XLSX | Through the bridge | Yes |
| Presets | DPDP, KYC, fintech, PCI, healthcare, HR, secrets, GDPR, HIPAA | GDPR, HIPAA, CCPA, finance, education, healthcare, transport, PCI, SOC 2 |
| Express and React | Yes | Yes, plus a REST server |
| Audit database, RBAC, multi-tenancy, webhooks | No (onDetect hook) | Yes |
How do I migrate from OpenRedaction?
Change the import. piilite's detect() returns the same { redacted, detections, redactionMap } shape, still works with await, and accepts OpenRedaction custom patterns unchanged.
- import { OpenRedaction } from "openredaction";
- const shield = new OpenRedaction();
+ import { Piilite } from "piilite";
+ const shield = new Piilite();
const { redacted, detections, redactionMap } = await shield.detect(text);How do I use OpenRedaction's patterns with piilite?
Install @openredaction/core and import from piilite/openredaction. You get piilite's Indian engine plus 110 of OpenRedaction's pattern types and its document processors.
npm install piilite @openredaction/coreimport { createGlobalShield, redactDocument, redactJson, redactCsv } from "piilite/openredaction";
const shield = createGlobalShield({ preset: "gdpr" });
await redactDocument(pdfBuffer); // PDF, DOCX, image (OCR) or text
await redactJson(payload);
redactCsv(csvText, { columns: ["phone"] });The bridge adds national IDs of 45+ countries, foreign bank formats, crypto wallets, health IDs and extra secret formats. Each type was checked against 2,060 samples of Indian text and kept only if it never matched by mistake; Indian matches always win an overlap.
In OpenRedaction 1.1.5, CsvProcessor.redact() can apply detections to the wrong row when the file has a header. piilite's redactCsv uses OpenRedaction's CSV parser but redacts cells itself, so rows stay aligned.
Last updated · piilite 0.3.0