The response cache.
Keyed on the question alone, a cache returns one user's answer to another. Key by identity, or scope per user.
MKC2 results ↗Retrieval access control only works one way: restrict the candidate set with the asker's identity before relevance scoring. Everything else is too late.
01 / DEFINITION
The short answer first.RAG access control is the enforcement of document permissions inside a retrieval pipeline, so that only material the requesting user may see can be retrieved. It requires per-chunk access metadata and filtering applied before relevance scoring, not after generation.
This is the single most common architectural gap in enterprise retrieval deployments. Indexing everything is the fast path to a working prototype, and adding permissions afterwards is not a configuration change — it means rebuilding the index with access metadata carried through the pipeline.
WORKED EXAMPLE
An enterprise search assistant indexes two product teams' roadmaps. Both documents mention the same project name, but only one team may see the unreleased launch date. A keyword search or vector match can legitimately identify both documents as relevant. Relevance is not permission. The retrieval service must decide which passages may be returned for the authenticated user before constructing the model context.
Create two synthetic roadmaps with distinct launch dates and separate access groups. Query as a member of each team, then as an employee with access to neither. Inspect candidate filtering, reranking inputs, final context and displayed citations. A protected passage reaching the model is already a failed boundary, even if the final answer happens to omit the date.
Test an authorised result as carefully as a denial. A team member should still find their own roadmap and receive the right revision. If filtering removes the relevant authorised document along with the forbidden one, the system is secure only by becoming unusable. Record which identity, group membership, document policy and index revision governed the decision.
Now remove a team member while their session remains open. Repeat a direct query, a conversational follow-up and a cached answer request. Determine how revocation propagates through the index and which caches must be invalidated. If the business permits a bounded delay, record the actual delay and the component responsible. This establishes what the deployed system enforces rather than assuming its behaviour from the permissions displayed in the source repository.
02 / PRE-FILTER, POST-FILTER, OR PROMPT
| Approach | Mechanism | Result |
|---|---|---|
| Pre-filter | Restrict candidates by the user's permissions before scoring | Correct. Out-of-scope material cannot be retrieved at all |
| Post-filter | Retrieve, then drop unauthorised passages before the prompt | Workable but wasteful; correct only if nothing slips into context |
| Filter the answer | Generate, then check whether sources were permitted | Too late. Restricted content has already shaped the response |
| Instruct the model | Tell the model not to use certain documents | Not a control. See AI agent access control |
Pre-filtering has a performance implication worth planning for: a vector index searched with a restrictive filter can return fewer than k results, or degrade in recall, depending on how the filter interacts with the index structure. The mitigations are to over-retrieve before filtering, to use an index that supports efficient filtered search, or to partition by tenant so that filters are coarse and cheap.
Post-filtering is acceptable as a defence in depth and unacceptable as the only mechanism, because any path that places a passage into the prompt before the check has already disclosed it. The failure is silent: the answer looks normal and no access log records anything unusual.
03 / FRESHNESS
Access rights change continuously: someone joins or leaves a matter, a confidentiality wall goes up, a document is reclassified, an engagement ends. An index whose permission metadata is refreshed on a nightly schedule is enforcing yesterday's rights, and for a boundary that exists to prevent a specific person seeing a specific matter, a day of lag is not acceptable.
Three workable patterns, in increasing order of cost and correctness:
Hard boundaries — conflicts of interest, ethical walls, statutory restrictions — belong in the third pattern where possible. A control that depends on a filter being applied correctly on every query path is weaker than one where the data is not in the same index.
04 / THE OTHER COPIES
Keyed on the question alone, a cache returns one user's answer to another. Key by identity, or scope per user.
Content retrieved for one user persists in a thread. If the thread is shared or the user's access changes, so does the exposure.
Both accumulate real retrieved content in stores with their own access models, usually broader than the source.
Testing is what turns this from an intention into a control. A standing suite that queries as several test identities for content each should not reach, run on every re-index rather than once at launch, is the only reliable way to know the boundary still holds — permission metadata is the first thing an indexing rewrite loses, and nothing visibly breaks when it does. Privilege AI treats permissions and retrieval boundaries as the same design problem: which information a model can access, and which actions it can propose. See AI access control.
05 / QUESTIONS
Most support metadata filtering, which is the mechanism, but the enforcement is your application's responsibility: the filter has to be applied on every query path with the correct identity. Nothing in the database prevents a code path that forgets.
Query-time authorisation against the authoritative source, or event-driven invalidation with a bounded and documented lag. For hard boundaries such as confidentiality walls, partitioning the index is stronger than any filter.
It is the strongest isolation and the most operational overhead. For strict multi-tenant requirements, or ethical walls within one organisation, it is usually worth it; for internal departmental separation, filtered search with tested enforcement is generally adequate.
Permissions are almost always a document-level property, so every chunk inherits its parent's metadata. Where part of a document is more restricted than the rest, the safe approach is to split it into separate documents rather than to model chunk-level exceptions.
With a standing suite of adversarial queries run as several test identities, checking that content each identity should not reach is never returned. Run it on every re-index, because that is when permission metadata is most often lost.
WORK WITH PRIVILEGE AI
Answers only from what each person may see.
We build document search for AI that respects your existing permissions.
Checked before the search.
Access is enforced before information is found, not filtered out afterwards.
Fewer accidental leaks.
People cannot get answers drawn from documents they were never allowed to read.
Talk with Privilege AI
Tell us which collections or records should be visible to each role and how quickly a withdrawal of access must take effect.
CONTACT PRIVILEGE AI
Tell us which collections or records should be visible to each role and how quickly a withdrawal of access must take effect.
Privilege AI builds retrieval boundaries that define what a model can access, enforced before the search rather than after the answer.