Skip to content
anythingai.space
AI Securityintermediate13 min · 10 steps

Access Control in RAG

Make retrieval return only what the requesting user may open: copy source permissions onto chunks, filter every query in the store, and keep permissions in sync.

questiontop-kFinance chunkTOP-3 RETRIEVED CHUNKSKB-101 software requestseveryoneFIN-22 budget approvalsFinance onlyKB-118 licence renewalseveryoneMarketing userIT assistantIndexall teams' docs
requesterrordataresponse
1 / 10
ProblemStep 1 of 10

Search returns what's similar, not what's allowed

A Marketing employee asks the IT assistant about budget approval for software. The index was built from every team's documents, so the nearest chunk is a Finance-only budget note. It lands in the prompt and gets summarised.

The system prompt said “only use documents the user is allowed to see”. The model has no way to know which those are, and an injected instruction could override the rule anyway.

Watch outOWASP LLM08 (vector and embedding weaknesses) includes exactly this: retrieval that ignores who is asking.
What changed
  • +One shared index
  • ~Finance-only chunk reaches a Marketing user

Lesson 19 of 22 in AI Security