Skip to content

Privacy, de-identification and sensitive data

Personal data in RAG corpora built from licensed records: retrieval-time privacy controls

Quick answer

Personal data in a RAG knowledge base is more exposed than personal data in a training set, because the retriever returns the stored text itself. Any chunk containing a name, email or account number can surface verbatim in an answer, a citation, a log or a tool call. Control it in four places: de-identify before chunking, carry access labels into the vector index, make deletion propagate to every derived store, and filter outputs and tool arguments at runtime.

By SourceX Editorial · Updated

  1. 01Your data spec
  2. 02Matched to businesses
  3. 03Rights and samples reviewed
  4. 04Licensed delivery
How it works with SourceX: Your data spec → Matched to businesses → Rights and samples reviewed → Licensed delivery.Illustrative

This page is general information, not legal advice. Confirm requirements with counsel for your jurisdiction and use case.

Why retrieval exposes every record, not just memorized ones

Retrieval turns every indexed record into a potential output, so privacy risk scales with what you index rather than with what a model happens to memorize. A fine-tuned model leaks a training record only if it memorized it and someone elicits it; the risks there are covered in our guide to training-data extraction and memorization. A RAG pipeline, by design, copies the top-k chunks into the prompt and often shows them as citations.

That changes the threat model for a licensed corpus of support tickets, contracts or engineering records. A user asking "why was the refund denied?" can receive the exact ticket text, including the customer's name and order number, if that chunk ranks well. OWASP's 2025 LLM list treats this as its own category, LLM08 Vector and Embedding Weaknesses, naming weak access control and cross-context information leakage in shared vector stores as core failure modes [1].

The practical consequence: "the model will not repeat it" is not a control. Treat the index as a database of personal data, with the same scoping, access and deletion obligations as the source system.

Embeddings are personal data when the source text is

Dense embeddings of text that contains personal data should be treated as personal data, because they can be inverted back toward the original text. Morris et al. showed with Vec2Text that iterative correction against a known embedding model reconstructs much of the input text, and recovered full names from embedded clinical notes [2]. Hashing the chunk ID or storing only vectors does not anonymize the corpus.

Three implications for platform teams:

  • Vectors inherit the source's legal status. If a licensed corpus is subject to GDPR, HIPAA or a state privacy law, the vector store is in scope too, as are its backups and snapshots.
  • Metadata is often worse than vectors. Fields like author_email, customer_id, file_path (for example /hr/2024/termination_jdoe.pdf) and free-text titles are stored in plaintext beside the vector and returned in filters and citations.
  • Re-embedding is a deletion event. When you switch embedding models, old indexes must be destroyed, not left in a cold bucket.

De-identify before chunking, and keep retrieval working

Run de-identification on the source records before chunking and embedding, because anything that reaches the index is retrievable and anything embedded is recoverable. Detection tools such as Microsoft Presidio combine pattern recognizers (emails, phone numbers, card numbers) with NER models, but the project itself warns there is no guarantee it finds all sensitive information [5]. Plan for misses: sample-check redacted chunks and keep a residual-PII rate per document type.

Choose the transformation for retrieval quality, not only privacy. Blanking names with [REDACTED] breaks questions that depend on who did what; consistent pseudonyms (CUSTOMER_0412 across all tickets for one person) preserve co-reference so the retriever can still link a complaint to its resolution. The trade-offs are covered in de-identifying a RAG corpus without breaking retrieval. Keep the pseudonym mapping table outside the RAG stack, in a separately access-controlled store, or delete it if no one needs re-linking.

For health content, de-identification must meet HIPAA's standard in 45 CFR 164.514: either removal of the Safe Harbor identifiers or an Expert Determination that re-identification risk is very small [7]. NIST SP 800-188 is a useful reference for documenting which technique was applied and how residual risk was assessed [8]. For scanned PDFs, remember that OCR text layers and document metadata carry identifiers that a visual redaction leaves intact; see redacting PII in scanned documents.

Access control has to travel with every chunk

Retrieval must be security-trimmed at query time, which means every chunk carries the access labels of its source document into the index. Enterprise search systems already do this: Microsoft Graph external connectors attach an ACL to each item, with entries that grant or deny access to a user, group or everyone, and results are filtered against the caller's identity [4]. A RAG index built by chunking a document store without copying those ACLs flattens permissions so every user can retrieve every chunk.

Implement it as a pre-filter in the vector query, not a post-filter on generated text. Post-filtering after generation is too late, since the model has already read and paraphrased the restricted chunk. Common failure modes:

  • Tenant mixing. One shared namespace for several business units or customers, separated only by a metadata field that a query bug can omit. Use separate namespaces or indexes per tenant where licenses or contracts require it [1].
  • Stale ACLs. Labels copied at ingest and never refreshed, so a user removed from a group keeps access. Sync ACL changes on the same schedule as content changes.
  • Agent identity. Tools that query the index with a service account instead of the end user's identity, bypassing trimming entirely.

For licensed corpora, add a second dimension: the license scope. A corpus licensed for internal support use should not be retrievable from a customer-facing assistant, even for authorized employees. Encode license_id and permitted_surface as filterable fields; our guide to RAG content license terms covers the clauses that define those scopes.

Deletion must reach the index, caches and logs

Deleting personal data from a RAG system means removing it from every derived store, not just the source document. A vector store exposes explicit delete operations keyed by vector ID; Amazon S3 Vectors, for example, deletes vectors from an index by key [3]. That only works if your ingestion pipeline recorded which vector IDs came from which source record and which chunk.

The derived stores that usually get missed:

  • Chunk and parent-document stores used for "small-to-big" retrieval.
  • Semantic and response caches that store prior answers containing the retrieved text. Retention limits for licensed content are discussed in caching and retention limits for licensed RAG content.
  • Prompt and trace logs in observability tools, which store full retrieved context per request.
  • Evaluation snapshots and golden sets built from production queries.
  • BM25 or keyword indexes running beside the vector index in hybrid search.

Compare this with a fine-tuned model, where removing a record generally means retraining or using an architecture designed for unlearning such as SISA sharding [9]. Index deletion is tractable; the hard part is lineage. If a supplier withdraws records, or a data subject in the corpus exercises an erasure right, you need to answer "which chunks, vectors, cache entries and logs derive from record X?" within the deadline your obligations set. For what to do when personal data turns up unexpectedly, see the buyer's response playbook.

Runtime leaks: tool calls, citations and traces

Output-side controls must cover tool-call arguments, citations and traces, not only the final chat message. Practitioners report that PII redactors commonly scan user prompts and model responses but miss the JSON arguments an agent passes to tools, so a retrieved email address flows into a CRM lookup, a web search or a ticketing API unredacted [6]. Those arguments are often logged by the receiving service, outside your retention controls.

Apply the same detector at four points: retrieved context before it enters the prompt (if the index was not fully de-identified), tool-call arguments before dispatch, the final response, and anything written to traces. Return citations as document IDs plus de-identified snippets rather than raw chunk text. Rate-limit and log broad enumeration queries ("list all customers who complained about X"), which turn a retriever into an export tool.

Retrieval privacy control matrix

Use this matrix to assign an owner and evidence to each control before a licensed corpus goes into a production index.

Illustrative example: invented to show structure; it does not describe an available dataset.

StageControlEvidence to keepTypical failure
IntakeConfirm license scope and whether records were de-identified by the supplier, with method recordedLicense schedule, de-identification method note, sample check resultsAssuming "anonymized" means no free-text names
Pre-chunkingDetect and pseudonymize identifiers with consistent tokensDetector version, entity types, residual-PII rate per doc typeNames in signatures, quoted email threads, file paths
IndexingCopy source ACLs and license_id into chunk metadata; separate tenantsACL sync job logs, namespace mapShared namespace filtered only by optional field
QueryPre-filter by caller identity and permitted surfaceQuery audit log with user principalAgent queries under a service account
OutputScan responses, citations and tool-call argumentsRedaction hit logsTool arguments sent unscanned [6]
DeletionLineage from source record to chunk, vector, cache and log IDsDeletion runbook, completion recordsCaches and traces retain text after vector delete
Model changeDestroy old indexes on re-embeddingDecommission recordOld index left in backup bucket

A sample record in the lineage table might look like this:

{
  "source_record_id": "tkt-88213",
  "license_id": "LIC-2026-014",
  "permitted_surface": ["internal_support_assistant"],
  "deid_method": "pseudonymization_v3",
  "chunk_ids": ["tkt-88213#c0", "tkt-88213#c1"],
  "vector_ids": ["v-5f1a", "v-5f1b"],
  "acl": [{"type": "group", "value": "support-tier2", "access": "grant"}],
  "ingested_at": "2026-09-14T10:02:00Z"
}

What to ask a corpus supplier before indexing

Ask suppliers the questions that determine your retrieval-time exposure, because the controls above depend on what arrives. Useful questions: which identifier types were removed or replaced, and by what method; whether free-text fields, attachments and quoted threads were included in the scan; what sample check was run and what it found; whether records carry stable IDs you can use for deletion lineage; and how the supplier will notify you of withdrawn records. For corpora that contain EU or UK personal data, also confirm the transfer basis; see EU personal data in US datasets.

When SourceX sources a corpus, personal details such as names, emails, phone numbers and account numbers are removed or replaced before delivery, the method is recorded and a sample is checked, though no method is perfect. That is why the runtime controls on this page still apply. Diligence materials covering source, rights, preparation and allowed use are prepared for each dataset, which gives you the intake evidence the matrix asks for. Teams scoping a request can start at SourceX for AI data buyers.

For broader context on de-identified data for AI, start at the privacy and de-identification hub or the AI data guides home. Related definitions are in the glossary entries for PII detection and knowledge base, and use-case detail is on RAG datasets from real company documents and licensing knowledge base articles.

Sourcing a privacy-reviewed corpus for your RAG knowledge base

SourceX sources operational datasets, such as support histories, documents and engineering records, from US companies on request, with each dataset rights-reviewed and delivered under a license that defines records, uses, term and delivery. Personal details are removed or replaced before delivery and every release is approved by the supplying company. Describe the corpus you need at sourcex.si/buyers.

Sources

  1. OWASP GenAI Security Project, "LLM08:2025 Vector and Embedding Weaknesses" (2025). https://genai.owasp.org/llmrisk/llm082025-vector-and-embedding-weaknesses/
  2. Morris et al., arXiv:2310.06816, "Text Embeddings Reveal (Almost) As Much As Text" (2023). https://arxiv.org/pdf/2310.06816
  3. Amazon Web Services, Amazon S3 User Guide, "Deleting vectors from a vector index". https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors-delete.html
  4. Microsoft Learn, "acl resource type (Microsoft Graph external connectors)". https://learn.microsoft.com/en-us/graph/api/resources/externalconnectors-acl
  5. Microsoft (microsoft/presidio), via pkg.go.dev, "Presidio - Data Protection API". https://pkg.go.dev/github.com/microsoft/presidio
  6. DEV Community, "Your PII redactor probably leaks tool-call arguments". https://dev.to/crp4222/your-pii-redactor-probably-leaks-tool-call-arguments-357e
  7. eCFR, Office of the Federal Register / HHS, "45 CFR 164.514 - Other requirements relating to uses and disclosures of protected health information". https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-C/part-164/subpart-E/section-164.514
  8. National Institute of Standards and Technology, "NIST Publishes SP 800-188, De-Identifying Government Datasets" (2023). https://csrc.nist.gov/News/2023/nist-publishes-sp-800-188
  9. Bourtoule et al., arXiv:1912.03817 (IEEE S&P 2021), "Machine Unlearning" (2019). https://arxiv.org/abs/1912.03817v2

Tell us what your models need

Share scope, volume, language, format, timing and licensing requirements.

Request data