PII-ka-boo for GoCalma
Track
Privacy & Open Source AI Tools
A local-first, open-source browser extension that redacts sensitive information from PDFs using on-device AI + OCR, and can safely un-redact later with the correct password.
In order to get AI productivity, we pay the cost of privacy. The current default is risky: users upload documents to cloud services before removing personal data. We built PII-ka-boo to reverse that order:
- redact locally first,
- share only safe documents,
- recover originals only with user-held credentials.
What Inspired Us
The challenge statement was immediately relatable: privacy is often lost in the first click. We were inspired by a simple idea with real-world impact:
- non-technical users need one-click redaction they can trust,
- sensitive data must stay on-device,
- “redaction” should not mean “data gone forever” for the rightful owner.
This led us to design for privacy-by-default + reversibility-by-design.
What We Built
PII-ka-boo delivers the full core workflow expected in GoCalma:
- Accept a PDF in a simple extension UI
- Detect PII locally with a hybrid engine:
- ML NER model via Transformers.js (Piiranha ONNX, local worker)
- deterministic regex overlay for strict identifiers (email, SSN, phone, IBAN, credit-card-like patterns, etc.)
- Handle both text PDFs and scanned/image-heavy PDFs using OCR (Tesseract WASM)
- Burn redactions directly into page raster output to reduce text-layer leakage risk
- Embed an encrypted original payload for owner-only restoration
- Un-redact locally with the correct password
Architecture (High Level)
- UI Orchestrator: local popup workflow for redact/un-redact
- Text + OCR Extraction: PDF.js + Tesseract to produce tokenized text with page geometry
- Hybrid PII Detection: model inference + regex overlays merged to improve robustness
- BBox Mapping: character spans mapped back to exact page regions
- Secure Packaging: redacted PDF output + encrypted original attachment
Language Support
GoCalma asks for left-to-right European languages (English, German, French, Italian, Spanish). We designed the detector accordingly:
- Chosen model class is suitable for multilingual PII-style entity detection (Supports English, Spanish, French, German, Italian, Dutch).
- Regex overlays catch language-agnostic high-risk fields (IDs, account numbers, card formats, phone/email/IBAN patterns), improving reliability across documents regardless of surrounding language.
- OCR + token mapping keeps the same pipeline valid for scanned documents where language appears as image text.
How We Built It
Stack Choices
- TypeScript + WXT + SolidJS for fast browser-extension UX
- Transformers.js in a Web Worker for local model inference
- pdf.js / pdf-lib for parsing and output pdf
- Tesseract.js + WASM for scanned-doc OCR
- AES-based encryption flow for reversible recovery
System Design Decisions
- Heavy modules are loaded on demand to keep UI responsive.
- Inference is worker-isolated to avoid blocking interaction.
- We merged ML and regex to reduce false negatives on structured fields.
- We used rasterized redaction output to make visual masking durable.
- We enforced local execution as the default privacy boundary.
Reversibility and Security Model
- Redaction produces a safe-to-share output PDF.
- The original content is encrypted and embedded for owner recovery.
- Recovery requires the exact password.
- No hardcoded key is stored.
- Cross-machine recovery is supported: a PDF redacted on one machine can be un-redacted on another machine if the user has the redacted file and the correct password.
Challenges We Faced
1) Mapping model text spans back to PDF coordinates
Model outputs operate on character spans, while redaction needs pixel/geometry coordinates. Bridging this accurately across native text and OCR text required careful token-range bookkeeping.
2) OCR + PDF coordinate system mismatch
OCR coordinates and PDF coordinates differ by origin and scale. Getting reliable alignment for burn-in redaction boxes required explicit normalization logic.
3) Practical PII coverage
Pure ML can miss rigid patterns; pure regex misses context. The hybrid strategy improved practical recall on synthetic document styles.
4) Performance in a browser extension context
Model loading and OCR are heavy. We addressed this with lazy imports, worker separation, and staged processing feedback in UI.
What We Learned
- Privacy UX matters as much as model quality. If the flow is not simple, users bypass safe behavior.
- Hybrid detection is stronger than model-only or regex-only in real document pipelines.
- Geometry mapping is the “hard middle” of document AI systems.
- Local-first AI is viable in browser environments when WASM + workers are used carefully.
What's Next
- Improve model quality with larger synthetic evaluation sets and better entity calibration for stronger recall/precision balance.
- Add a guided review/approval step before final export for more transparent redaction decisions.
- Launch an optional cloud feature for users who explicitly opt in, with strict privacy controls and no plain PII transfer by default.
- Further optimize OCR + inference performance and processing feedback for faster end-to-end UX.
- Add benchmark reporting for detection coverage, leakage checks, and un-redaction fidelity across releases.
And yes, the ultimate usability benchmark was passed: our non-techy parents could use it without calling us for tech support even once.
Built With
- bun
- solidjs
- tesseract
- typescript
- wasm
- wxt
Log in or sign up for Devpost to join the conversation.