What are the security weaknesses specific to vector stores and embeddings, and how do you mitigate them?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Three distinct risks hide under OWASP LLM09:2026 (LLM08 in 2025), and candidates usually only know one.
Full worked answer with diagram
Three distinct risks hide under OWASP LLM09:2026 (LLM08 in 2025), and candidates usually only know one.
Embeddings are not anonymisation. The most common misconception I see is teams treating a vector store as safe because "it is just numbers". It is not: inversion research (vec2text-style decoders trained against an embedding model) shows that text can be reconstructed from embeddings with high fidelity, and attribute-inference is easier still. So an embedding of a medical record is a medical record. The mitigation is unglamorous: classify the vector store at the same sensitivity level as the source text, encrypt at rest, restrict access, apply the same retention and deletion policy, and remember it in your data-map for GDPR purposes. If you would not dump the raw documents in an unauthenticated Pinecone-style index, do not dump the embeddings either.
Index poisoning. Anyone who can write to the corpus can write to the model's context. The craft is that the attacker does not need generic reach: they write a chunk engineered to be the top retrieval hit for a specific target query, then put instructions in it. If your corpus ingests user-generated content, support tickets, supplier feeds or scraped pages, you already have this. Mitigations: authenticated writes, provenance metadata on every chunk, separate namespaces per trust level so untrusted content cannot outrank curated content in the same search, and review or quarantine for new sources.
Retrieval-time authorisation failures. The bug I would look for first in any RAG codebase: ACLs applied at ingest time instead of query time. Permissions change, documents get re-shared, and an index built from "what Bob could see in March" leaks in July. Filter at query time, in the datastore, using the requesting principal's identity, with the tenant or ACL predicate as a mandatory part of the query rather than something the application layer remembers to add.
# authorisation belongs in the query, not in a post-filter
hits = index.search(vec, k=8, filter={"tenant_id": ctx.tenant_id, "acl": {"$in": ctx.groups}})
Post-filtering after retrieval is a bug: you have already paid for the wrong hits, and k is now wrong too.
Worth sketching. Drawing the stale-permissions branch is faster than explaining it, and it lands why post-filtering is a patch rather than a fix.
flowchart TD
I["Ingest time: bake the ACL into the index"] --> S["Snapshot of who could see it in March"]
S --> L["July query returns grants that expired"]
L --> X["Post-filter cleans up afterwards<br/>k is already wrong"]
Q["Query time: filter inside the datastore"] --> P["tenant_id and ACL as mandatory predicates"]
P --> K["Right hits, right k, current permissions"]
What a good answer covers
- The most common misconception I see is teams treating a vector store as safe because "it is just numbers"
- It is not: inversion research (vec2text-style decoders trained against an embedding model) shows that…
- So an embedding of a medical record is a medical record
- The mitigation is unglamorous
- If you would not dump the raw documents in an unauthenticated Pinecone-style index, do not dump the…
Key terms: Embeddings are not anonymisation · Index poisoning · Retrieval-time authorisation failures
In the glossary: RAG
Interviewer follow-ups to expect
Why is post-filtering after retrieval a correctness problem and not just a performance one?
How would you handle a document whose permissions change after it has been embedded and indexed?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep