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 needUse
Indian users, chats, résumés, KYC, LLM promptspiilite
A small bundle, the browser, edge runtimes or streaming LLM outputpiilite
IDs from many countriespiilite with the OpenRedaction bridge, or OpenRedaction
PDF, DOCX, OCR or XLSX inputpiilite with the OpenRedaction bridge, or OpenRedaction
An audit database, RBAC, multi-tenancy or webhooksOpenRedaction

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%.

MetricpiiliteOpenRedaction 1.1.5
Recall84.3%45.7%
Precision99.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?

FeaturepiiliteOpenRedaction
Indian IDs with checksums (Aadhaar, PAN, GSTIN, UPI …)Yes, 20+ typesAadhaar and IFSC
Hinglish and Indian scriptsYesNo
Patterns for other countriesThrough the bridge (110 types)570+ patterns, 50+ countries
SizeAbout 28 KB gzippedAbout 500 KB of core code
Fuzzy restore of placeholdersYesExact only
Streaming for LLM token streamsYesChunked streaming detector
PDF, DOCX, OCR, XLSXThrough the bridgeYes
PresetsDPDP, KYC, fintech, PCI, healthcare, HR, secrets, GDPR, HIPAAGDPR, HIPAA, CCPA, finance, education, healthcare, transport, PCI, SOC 2
Express and ReactYesYes, plus a REST server
Audit database, RBAC, multi-tenancy, webhooksNo (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.

diff
- 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.

bash
npm install piilite @openredaction/core
js
import { 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