Permission aware retrieval for enterprise RAG
The fastest way to lose trust in an enterprise assistant is to let it quote a document the user was never allowed to open.


Hand-written diagram of permission aware retrieval: access lists on chunks, filtering at query time, user identity, sync, low access testing
It happens more often than people admit. The usual cause is simple. During the pilot, every document was indexed with one service account, and the assistant searches as that account. To the system, every user has that account's access.
This article is how I build retrieval that respects permissions, and how I test it.
Why this goes wrong
Pilots are built fast. The quickest way to get documents into an index is to give a connector broad access and pull everything. It works, the demo looks good, and nobody asks whose access the search runs with.
The problem appears when the pilot widens. A manager asks a fair question and the answer draws on a document that only a smaller group should see. The model did nothing wrong. It was given the document.
Asking the model to ignore restricted content does not fix this. A prompt is not a security control. If the content is in the context, assume it can reach the user.
The design
Every chunk carries an access list. When a document is split, each chunk keeps the permissions of its source: users, groups, or both. This is metadata in the index, next to the text.
The search filters at query time. The user's identity travels with the request. The retrieval call filters on the access list before ranking, so restricted chunks never come back. Not after retrieval, where you may be left with too few results, and not in the prompt.
The assistant runs as the user, not as itself. Where a tool calls a source system directly, it uses the user's delegated access, so the source system enforces its own rules.
Permissions sync from the source. Access changes in the source system must reach the index. I sync on a schedule, and removals go faster than additions, because a stale grant is worse than a stale denial.
Groups need a decision. Either resolve group membership at query time, or flatten it into the index and resync when groups change. Both work. Not deciding is what fails.
Testing it
I keep one test user with very low access. Before every release, the full eval set runs as that user. If they see anything they should not, the release stops.
I also add specific cases to the eval set: questions whose best answer sits in a restricted document. The correct behaviour for a low access user is to answer from what they can see, or say they do not have the information.
Logs matter too. Each answer should record which chunks were used and under which identity, so a complaint can be checked in minutes.
What it costs
This is boring work. It adds a few days to a pilot and some complexity to the index. It is also the work that decides whether the security team lets you go live, so it is cheaper to do in week one than to retrofit after a leak.
A short checklist
- Access list stored on every chunk.
- Filter on the user's permissions at query time.
- Delegated access for tools that call source systems.
- Scheduled permission sync, removals first.
- A decision on how groups are handled.
- A low access test user running the eval set before each release.
- Logs of chunks used and identity per answer.
If you are running an enterprise assistant today, ask one question: whose access does the search run with? If the answer is a service account, start here.
Common questions
What is permission aware retrieval?
Retrieval that only returns content the requesting user is allowed to see, by filtering on their permissions at query time.
Why not filter after retrieval or in the prompt?
Filtering after retrieval can leave too few results, and asking the model to ignore content is not a security control. The search itself must exclude it.
How often should permissions sync?
On a schedule that matches the risk, with removals synced faster than additions.
How do you test it?
Run the eval set as a user with very low access. If they see anything they should not, the release stops.