Privilege AIMKC2 results ↗

RAG access control

Retrieval access control only works one way: restrict the candidate set with the asker's identity before relevance scoring. Everything else is too late.

READ THE DEFINITION ↓PRE-FILTER · FRESHNESS · ISOLATION

01 / DEFINITION

The short answer first.

What is RAG access control?

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

Test authorisation before passages enter the prompt

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.

Run the same query as two different people

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

Where permission filtering can be applied, and what happens in each case.
ApproachMechanismResult
Pre-filterRestrict candidates by the user's permissions before scoringCorrect. Out-of-scope material cannot be retrieved at all
Post-filterRetrieve, then drop unauthorised passages before the promptWorkable but wasteful; correct only if nothing slips into context
Filter the answerGenerate, then check whether sources were permittedToo late. Restricted content has already shaped the response
Instruct the modelTell the model not to use certain documentsNot 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

Yesterday's permissions
are not permissions.

The detail that catches careful teams.

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:

  • Cached metadata with short-lived invalidation. Permissions stored on the chunk, with an event-driven update from the source system. Adequate where changes are infrequent and the lag is bounded and known.
  • Query-time authorisation. Candidate identifiers are checked against the authoritative system before content is returned. Correct, at the cost of a synchronous dependency.
  • Partitioned indexes. Separate indexes per tenant or per confidentiality boundary, so isolation is structural rather than a filter that must be applied correctly every time.

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

↳ 01

The response cache.

Keyed on the question alone, a cache returns one user's answer to another. Key by identity, or scope per user.

↳ 02

Conversation history.

Content retrieved for one user persists in a thread. If the thread is shared or the user's access changes, so does the exposure.

↳ 03

Evaluation sets and logs.

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

Can a vector database enforce document permissions?

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.

How do you handle permissions that change frequently?

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.

Is a separate index per tenant necessary?

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.

What about permissions on chunks rather than documents?

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.

How do you test retrieval access control?

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

How we can help

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.

Talk to us →

CONTACT PRIVILEGE AI

Contact Us

Tell us which collections or records should be visible to each role and how quickly a withdrawal of access must take effect.

When should we call?

By submitting, you agree that Privilege AI, a division of Tech1e LLC, may call or email you about this inquiry. Please leave confidential information out of your message.

Permission the index,
not the answer.

Privilege AI builds retrieval boundaries that define what a model can access, enforced before the search rather than after the answer.