4 min read

Protecting PII in RAG with Microsoft Presidio

Enterprise RAG privacy with Microsoft Presidio

How an enterprise support team reduced exposure of personal data in its RAG assistant using Microsoft Presidio.

Client
Enterprise support operations team (anonymized)
Engagement
PII protection for an enterprise RAG assistant
Core platform
Microsoft Presidio, Docling OCR, permission-aware vector search
Key focus
Sanitizing content before indexing and controlling retrieval

The client's support team had years of resolved tickets, runbooks and internal procedures. That history held the answers agents needed every day, but finding them meant searching several systems and reading long ticket threads. Leadership wanted an AI assistant that could answer agent questions from this knowledge base in seconds.

  • The privacy blocker: The same tickets that explained how to fix a problem also contained customer names, email addresses, phone numbers, account IDs and, in scanned attachments, details buried in images and PDFs. Loading that content straight into a RAG system would have copied personal data into new places: document chunks, embeddings, prompts sent to the model, generated answers and logs. Each of those would need its own retention, access and deletion rules.
  • The condition: The security and compliance team set a clear condition: the assistant could reuse the knowledge in a ticket, but not the identity of the customer who raised it. A password-reset procedure is useful to every agent. The customer's email address in that ticket is not.

Wronit treated PII protection as part of the data pipeline, not a filter added at the end. We worked with the client's support, security and platform teams in three phases.

01

Discovery and data mapping

We sampled tickets, attachments and knowledge articles to see which personal data actually appeared, where it appeared and how often. That produced an agreed PII inventory and a decision for each entity type: remove, mask, replace with a consistent placeholder, or keep because the business genuinely needs it.

02

Sanitization before indexing

Documents were extracted inside the client's approved environment, using Docling for OCR on scanned files and attachments. Microsoft Presidio then detected PII in the extracted text, using its built-in recognizers plus custom recognizers for the client's own formats. Sensitive values were replaced with typed placeholders like <PERSON> or <EMAIL> before any chunking or embedding, so the vector index never held the raw identifiers.

03

Permission-aware retrieval

Sanitized chunks kept metadata on their source system, team and sensitivity level. At query time the retriever filtered results by the user's existing access rights, so the assistant could only draw on content that person was already allowed to see.

  • Pre-index redaction: PII is detected and transformed before embeddings are created, keeping it out of the search index.
  • Custom recognizers and allow-lists: Domain-specific IDs are caught, and product names or error codes that look like PII aren’t over-redacted.
  • Access-controlled retrieval: Document-level permissions follow content into the RAG layer.
  • Output checks: Generated answers pass through a second Presidio scan before they’re shown, as a safety net for anything the first pass missed.
  • Safe logging: Prompts and responses are logged in sanitized form, with retention aligned to the client’s policy.
  • Evaluation set: A labelled sample of real tickets measures detection recall and precision, and is re-run whenever recognizers or source systems change.
  • Human review path: Low-confidence detections and new document types go to a reviewer rather than being silently indexed.
  • Support knowledge that was previously off-limits for AI use became searchable through the assistant without copying raw customer identifiers into the vector index.
  • Acceptance testing found no raw customer identifiers in the vector index, prompts or answers under the agreed evaluation sample.
  • Security and compliance teams approved the rollout with a documented, testable control set they can audit and extend to new data sources.

The bigger outcome was trust. The client now has a repeatable pattern for bringing sensitive enterprise content into AI systems. Privacy is handled as a measured engineering control, not left to good intentions.

If your teams want an AI assistant over tickets, contracts, claims or HR records, the hard part isn’t the model. It’s making sure personal data doesn’t leak into indexes, prompts and logs that were never designed to hold it. Wronit designs and builds RAG systems with privacy, access control and evaluation in place from day one.

Talk to Wronit about secure enterprise RAG →

Related reading

Want the technical detail behind this pattern? Our guide, PII Protection in RAG: How to Use Presidio for Enterprise AI Privacy, walks through where Presidio sits in a RAG architecture, how to choose between masking, replacement and pseudonymization, and how to test detection quality.