Users with different access rights share one RAG chatbot. How should the team stop users seeing documents they are not allowed to read?
- Exam domain
- Retrieval-augmented generation
- Difficulty
- Medium
- In this mock
- 5 questions on this domainPractise this domain
Why D is the answer
Filter retrieval by the user's permissions before passages reach the model
Access control must happen in retrieval. If restricted passages never reach the prompt, the model cannot reveal them.
Remember: Enforce access in retrieval.
In detail
- Filter at retrieval.
- Never rely on the prompt alone.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Use a larger model, which is better at keeping secrets when it is told toWrong
Model size is not access control.
B. Tell the model in the prompt not to reveal restricted contentWrong
A prompt instruction can be bypassed.
C. Store all documents in one index with no metadataWrong
Without metadata you cannot filter.
D. Filter retrieval by the user's permissions before passages reach the modelRight
Enforce access in retrieval.
Use case
An illustrative scenario, not a real incident.
Illustrative: HR documents carry a group tag, and retrieval only returns passages the user's group may read.
See it in different ways
sequenceDiagram participant P0 as User participant P1 as Retriever participant P2 as Model P0->>P1: question + identity P1->>P2: only permitted passages P2-->>P0: answer
How to read this chart
- 1. User sends "question + identity" to Retriever.
- 2. Retriever sends "only permitted passages" to Model.
- 3. User gets a reply from Model: "answer".
flowchart LR S0["Tag documents"] --> S1["Pass user identity"] --> S2["Filter results"] --> S3["Generate"]
How to read this chart
- Read it in order: Tag documents, then Pass user identity, then Filter results, then Generate.