Anonymizer icon indicating copy to clipboard operation
Anonymizer copied to clipboard

feat: support PII detection and redaction in images and multimodal inputs

Open afourniernv opened this issue 4 weeks ago • 0 comments

Priority Level

Medium (Nice to have)

Is your feature request related to a problem?

We have a team asking whether Anonymizer can protect PII in images. Screenshots, scanned documents, and image attachments can contain names, email addresses, account numbers, and IDs that a text-only workflow will miss.

This also matters for multimodal agent requests: inspecting the text fields alone leaves the attached images unchecked. We need a way to detect sensitive content for privacy routing and, separately, produce redacted images for sharing or observability.

Describe the solution you'd like

Start with text PII in PNG/JPEG images, including requests containing both text and images:

  • Accept in-memory images with stable caller IDs, alongside text records.
  • Extract text through OCR, apply Anonymizer's configured entity labels, and map detections back to regions in the original image. Define coordinates and orientation handling so callers can mask the correct pixels.
  • Offer detection-only results for callers making routing decisions, and an option to return a redacted copy. Preserve the original input.
  • Report which images were inspected and distinguish a successful check with no detections from unreadable, unsupported, or failed input. Document input limits and timeout behavior.
  • Add an example and evaluation using synthetic screenshots and scanned documents, checking both missed PII and unnecessary redaction. Include rotated images, multilingual text, and OCR failures.

Use input and result types that can accommodate additional modalities later. Faces, license plates, audio, and video need their own detection and evaluation; OCR-based text redaction should not imply those are covered. The first implementation can stay focused on images while documenting that boundary.

Describe alternatives you've considered

  • Presidio Image Redactor already combines OCR, text PII detection, and image masking.
  • Compose NVIDIA Image OCR with Anonymizer's text detection. Applications would currently need to own the mapping from text spans to image regions and the pixel redaction themselves.

Additional context

Related: #289 (online entity detection) and #286 (Relay observability integration).

For Relay, image redaction would apply to copied observability data. For Switchyard or another gateway, detection would inform routing before the request reaches a model. Anonymizer would own detection/redaction; each integration would own request extraction and routing or export policy.

afourniernv avatar Nov 04 '26 19:11 afourniernv