Skip to content

feat(pii-audit): Autocapture PII Audit Chrome extension - #1924

Draft
djih wants to merge 13 commits into
mainfrom
danieljih/pii-audit-extension
Draft

feat(pii-audit): Autocapture PII Audit Chrome extension#1924
djih wants to merge 13 commits into
mainfrom
danieljih/pii-audit-extension

Conversation

@djih

@djih djih commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

Adds a standalone Chrome MV3 extension at pii-audit-extension/ that audits what Amplitude Autocapture would collect — entirely locally, with zero egress.

  • Channel A (network): MAIN-world interceptor patches fetch/XHR/sendBeacon at document_start to capture ingest payloads, drop real sends, and force-enable autocapture via remote-config rewrite
  • Channel B (DOM): Content script scans the full document + watches mutations, relays items to a docked side panel
  • Detection: Two-pass pipeline — deterministic regex/checksum (email, SSN, credit card, etc.) → local Piiranha ONNX classifier in a Web Worker
  • Panel: 3-tab React UI (Everything / PII only / Masking rules) with hover-highlight and exportable masking rules JSON
  • Demo page: Fake login → billing SPA with PII fields for end-to-end rehearsal

33 unit tests passing. Extension builds with Vite + @crxjs/vite-plugin.

Test plan

  • cd pii-audit-extension && npm test — 33/33 pass
  • npm run build — produces loadable dist/
  • Load unpacked extension in Chrome from dist/
  • Serve demo: cd demo && python3 -m http.server 8080
  • Open demo, click Start PII audit — page reloads, panel docks right
  • Tab 1 shows DOM + network + autocapture items; PII rows highlighted
  • Hover a row — red highlight box on matching DOM element
  • Tab 2 shows PII-only with reasons
  • Tab 3 lists masking rules; Export to file downloads JSON
  • Network tab: no successful Amplitude ingest POSTs; no Hugging Face/CDN model fetches

Notes

  • Standalone project outside the Lerna/Nx packages/ workspace (intentional per plan)
  • ONNX weights (.onnx) are gitignored — fetch via instructions in models/README.md
  • Piiranha model license is CC-BY-NC-ND-4.0 (non-commercial); GLiNER-PII (Apache-2.0) noted as commercial alternative
  • tokenizer.json is large (~1M lines) — consider git-lfs or fetch-on-build before merge

Made with Cursor

djih and others added 13 commits August 10, 2026 15:26
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…able

Co-authored-by: Cursor <cursoragent@cursor.com>
…s, force autocapture

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ay + panel mount

Co-authored-by: Cursor <cursoragent@cursor.com>
…jection

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…d-to-end)

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 61.51 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 134.97 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 215.59 KB (0%)
@amplitude/element-selector (gzipped esm) 2.67 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant