An Embedding of Personal Data Is Still Personal Data: 4 Controls for Your RAG Vector Store
An embedding looks like a meaningless list of numbers. That is exactly why teams stop treating it like the document it came from, and why RAG projects quietly create privacy problems that nobody designed on purpose. I'v
An embedding looks like a meaningless list of numbers. That is exactly why teams stop treating it like the document it came from, and why RAG projects quietly create privacy problems that nobody designed on purpose.
I've spent many years working on data governance in regulated industries like insurance and banking. This is the single most common gap I see when teams build retrieval-augmented generation (RAG) assistants on internal documents.
The pipeline, and where labels get lost
A typical RAG flow:
- Documents: claim files, medical reports, contracts, policies
- Chunks: documents split into passages
- Embeddings: each passage turned into a vector
- Retrieval: the passages closest to the user's question are found
- Answer: the LLM writes a reply from those passages
At every step the data changes shape. And at every step, the original classification and access rights can be dropped without anyone noticing.
The principle
An embedding of personal data is still personal data. Derived data inherits the sensitivity of its source unless you can prove otherwise.
Embeddings exist to preserve meaning, and research has shown that the original text can often be reconstructed from them to a significant degree. Even without that, the retrieval step hands the original passage straight back to the user. A confidential medical report stays confidential as chunks, as vectors and as an answer.
Four controls for your vector store
1. Propagate labels. Every chunk and vector carries the classification, owner and source ID of the document it came from. Store them as metadata alongside the vector.
2. Permission-aware retrieval (security trimming). Filter retrieval by the user's existing rights: a user should only get passages they could already open in the source system. In practice that means a metadata filter on every query, built from the user's groups or ACLs, not a single shared index everyone can hit.
3. Deletion that propagates. When a source document is deleted, corrected or reaches its retention limit, its chunks and vectors must go too. Keep the source ID on every vector so you can delete by source.
4. Treat logs as sensitive. Prompt and answer logs can reveal as much as the documents. A log of questions about a customer's illness is health data. Apply the same classification and retention to logs.
A realistic failure
An insurer builds an assistant for claims handlers. To make answers rich, all claim files, including medical reports, go into one vector store, and every handler can query it.
In the source systems, health claim handlers can see medical reports and motor claim handlers cannot. In the shared index, a motor handler asks a question and gets passages from a medical report. Nobody downloaded a file. The breach was created by architecture.
What should be required before go-live: labels on every chunk, retrieval filtered by existing access rights, deletion tied to the retention schedule, and confidential handling of logs. And one more question: did the assistant need medical reports indexed at all? Often the best control is not indexing the data.
Four questions before you index anything
- Do we need it? Does the assistant's purpose require this content, or was indexing everything just easy?
- How sensitive is it? What is the source classification, and who owns it?
- Who may ask? Who can see it in the source system today? The assistant should never widen that circle.
- How is it removed? What happens on deletion, correction or expiry?
If the team can't answer all four, the content isn't ready to be indexed.
Common mistakes
- "Vectors aren't data." Treating embeddings as anonymous technical artefacts outside data protection.
- One index for all. Indexing everything once and letting everyone query it, which quietly removes years of access control.
- Forgotten copies. Deleting the source document but leaving its vectors, so the assistant keeps quoting a document that officially no longer exists.
None of these is really an AI failure. They are data governance failures, and your data team already knows how to prevent them.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.