Why RAG changes the permission path

A document system can make an access decision when a user requests a file. A RAG system adds several steps: it searches an index, retrieves passages, assembles model context and generates an answer. The current source rights must remain resolvable for every retrieved object, and the system must enforce them before a passage enters model context. Projecting permission metadata to each indexed chunk is one implementation pattern, not the only one.

You can map the end-to-end RAG pipeline to see the full flow in which permission enforcement must occur.

NIST's Zero Trust Architecture publication says that network location or asset ownership should not create implicit trust. The practical implication here is simple: putting an index on an internal network does not remove the need to authorise each retrieval against the user's current permissions.

Define subjects, resources, actions and policy

Before you design retrieval-time enforcement, write down:

  • Subjects. Who are the users? What are their attributes (role, department, clearance level)?
  • Resources. What are the protected objects? Source documents, derived chunks, cached answers, logs?
  • Actions. What can a subject do? Read, retrieve, generate, export, delete?
  • Policy. What rules determine whether an action is permitted?

NIST's ABAC guide describes policy decisions in terms of subject, object, action and environment attributes. That is a useful way to reason about the decision. It is not a ready-made index schema, and it tells you nothing about whether your attributes are current or correctly enforced.

You can turn classifications into handling controls to connect classification labels to permission rules, while keeping classification distinct from authorisation.

Carry source permissions into chunks and indexes

Each derived chunk needs a stable link to its source and enough information for the system to resolve current permissions. Azure AI Search documents one implementation that projects permission metadata to indexed chunks and applies caller identity or permissions during retrieval. Several of its native mechanisms use the 2026-08-01-preview API. Azure also notes that service-level roles do not automatically enforce source-document permissions.

You can preserve source permissions during document preparation by ensuring that permission metadata is complete and correctly recorded before ingestion.

The table below is an illustrative identity-to-answer control sequence. Adapt the decisions, evidence and owners to your architecture.

StepActionInputOutputControl question
1Authenticate subjectUser credentialsAuthenticated identityIs the user who they claim?
2Determine requested actionUser query, contextAction type (retrieve, generate, export)What is the user trying to do?
3Resolve permission contextIdentity, current source rights and indexed object referencesCurrent subject, object and environment attributesAre the attributes current and tied to the authenticated subject and source objects?
4Apply policy to the retrieval requestCurrent attributes and requested actionPermit, deny or authorised retrieval constraintWhich objects may this request search?
5Retrieve within the authorised scopeConstrained query, index and permission metadataAuthorised candidate chunksHas unauthorised content been kept out of the result set?
6Assemble contextFiltered chunks, instructionsAssembled contextIs the context within budget and complete?
7Generate answerAssembled contextGenerated answerDoes the answer follow the context?
8Handle caches and logsAnswer, context, metadataCached answer, log entryAre caches and logs permission-aware?
9Process revocationPermission change eventUpdated index, invalidated cachesIs the revocation complete and tested?

Apply identity-aware retrieval and security trimming

Security trimming constrains retrieval results to content the user is authorised to see. Apply authorisation early enough to keep unauthorised content out of assembled model context. Depending on the design, enforcement may sit in the index query, a separate policy decision before retrieval, a checked filter before context assembly, or a combination of controls. A display filter applied after generation is already too late.

Ask these questions for every retrieval path:

  • Filter location. At the index level, at the application level, or both?
  • Filter timing. Before or after reranking?
  • Filter evidence. Is the filter decision logged?
  • Filter testing. Are both positive and negative cases tested?

Azure's RAG design guide separates ingestion from runtime and recommends representative tests at each stage and end to end. It does not establish that your permissions are enforced.

Record each boundary explicitly

This boundary record is an editorial synthesis. Use it to find the gaps between a successful login and an authorised answer.

BoundaryRequired decision or stateEvidence to retainFreshness question
AuthenticationSubject identity and session are validAuthentication event and subject identifierWhen must identity be revalidated?
Source rightsCurrent rights exist in the source of truthSource object ID, rights snapshot or change eventHow quickly do grants and revocations propagate?
Indexed metadataEach derived chunk carries the correct source and permission referenceMetadata audit tied to source version and index buildCan a partial re-index leave stale attributes?
Policy decisionSubject, object, action and environment produce a defined outcomePolicy and version, inputs and permit or deny resultWhich attribute changes invalidate the decision?
Retrieval enforcementThe query or result set is restricted to permitted objectsFilter or constraint plus returned object IDsCan reranking, fallback or another retrieval path bypass it?
Context assemblyOnly authorised, traceable chunks enter model contextContext references and assembly traceCan a cache or reused context cross the boundary?

Handle tenant isolation, caches and derived output

In a multi-tenant system, enforce tenant isolation across retrieval, context assembly, generation, caching and logging. An answer cached for one tenant must never be served to another.

Make tenant identity, subject identity, policy version and relevant source scope part of the cache decision. A key based only on query text can return an answer assembled under a different user's permissions. Test direct lookups as well as semantic or approximate caches, and define which permission or source changes invalidate each result.

Derived output does not automatically inherit enforceable permissions from its sources. Generated answers, summaries and extracted entities need an explicit handling rule based on every contributing source and the action being taken. Keep provenance for that source set, apply the handling your policy requires, and test exports and reused summaries as well as the initial answer. A model or vector store does not supply this behaviour by default.

Process revocation, deletion and permission changes

When a user's permissions change, update every path that relies on them:

  • Refresh or invalidate the source-rights references, policy state or projected permission metadata used by each affected retrieval path.
  • Invalidate any caches that contain content the user can no longer access.
  • Log the change, affected objects and propagation state.
  • Test that the revocation meets a defined objective for each retrieval and cache path.

When a document is deleted, follow it through every derived artefact:

  • Remove the document and its derived chunks from the index.
  • Invalidate any caches that reference the document.
  • Log the deletion and the affected objects.
  • Test that the deletion is complete.

NCSC's secure operation and maintenance guidance recommends monitoring and evaluating versioned changes because updates can alter system behaviour.

Set a measurable propagation objective rather than promising that every change is effective immediately. Record when the source permission changed, when indexed metadata was refreshed, when caches were invalidated and when the negative retrieval test passed. A grant deserves testing too: an over-restrictive stale projection can prevent legitimate use even when it does not disclose information. If re-indexing is asynchronous, specify the safe behaviour while a change is pending.

Test positive and negative authorisation cases

This pattern, failure and test matrix is an editorial synthesis. Adapt it to your policy, technology and threat model.

Control pointIntended ruleCommon failurePositive testNegative testEvidenceOwner
Source ingestionOnly approved sources enter the indexUnapproved source ingestedApproved source appears in indexUnapproved source is rejectedIngestion logData steward
Chunk metadataEvery chunk can resolve current source rights through its source reference or the design's projected permission fieldsMissing or stale source reference or projected fieldRepresentative chunk resolves the expected permitted scopeMissing or stale rights data fails closed and is flaggedMetadata and permission-resolution auditData engineer
Query filterUser can only retrieve authorised chunksFilter bypassed or misconfiguredAuthorised chunk is retrievedUnauthorised chunk is excludedRetrieval logSecurity engineer
Tenant isolationTenant A cannot access Tenant B contentCross-tenant cache hitTenant A retrieves own contentTenant A cannot retrieve Tenant B contentCache auditPlatform engineer
Cache reuseA cached result is reused only under a compatible current permission stateQuery-only key or stale authorisation stateSame authorised subject and source scope receive the eligible resultChanged user, tenant or revoked source cannot reuse itCache key and invalidation tracePlatform engineer
Generated outputAnswer and downstream action use only context permitted for that subject and actionA disallowed source influences an answer or exportAuthorised subject receives an answer from the permitted source setA deliberately disallowed source cannot enter context or influence the answer or exportContext and output traceAI engineer
Permission changeRevoked access meets the defined propagation objectiveStale index or cache serves old contentNewly permitted user succeeds after propagationRevoked user is denied across retrieval and cache pathsTimed revocation traceSecurity engineer
DeletionDeleted document and its derived artefacts cannot be retrieved or reusedOrphaned chunk or cached result remainsAn unrelated retained document remains retrievable after deletion processingAn exact-source query and index or cache check return no deleted contentRetrieval, index and cache deletion tracePlatform engineer

Keep logs and decision evidence

Keep enough evidence to explain each authorisation decision without copying unnecessary protected content into the log. ETSI TS 104 223 V1.1.1, Baseline Cyber Security Requirements for AI Models and Systems includes access-control and auditability or provenance requirements. These are baseline requirements, not certification of a particular RAG design.

For a practical working decision record, capture the subject and tenant identifiers, requested action, source or object identifiers, policy version, relevant filter outcome, returned context references, cache decision, time and control owner. This record is an editorial synthesis, not a standard. Retain denials as well as permits. Protect the record according to its sensitivity, minimise prompt or document content, and document any identifiers that you deliberately omit or transform.

Logs enable:

  • Audit of permission behaviour.
  • Diagnosis of permission leaks.
  • Evidence for incident response.
  • Verification that revocation is effective.

Tie the decision record to the exact index and source versions used. A reviewer can then distinguish a stale permission projection from a correct policy decision applied to stale data. Test that administrators can reconstruct a representative permit and deny case. Test the log's own access controls too, so the evidence does not create another route to protected material.

You can follow the organisation's AI governance policy to assign owners, evidence requirements and exception handling for access-control decisions.

What RAG access control does not solve

Access control in a RAG system does not:

  • Prevent a model from generating a harmful answer from authorised content.
  • Detect or neutralise instruction-like content in a document.
  • Guarantee that the answer is factually correct.
  • Replace source approval, classification or minimisation.
  • Provide a universal security verdict.

You can place access control inside the wider RAG threat model to understand the full risk surface.

Keep document checks as a separate layer

Document checks for prompt-injection and other supported document-borne risks are a separate layer from access control. Access control determines who can retrieve what. A document checkpoint determines how to handle one exact version before it enters an AI workflow.

Once you have defined the permission model, enforcement points, failure tests and evidence, check the source as a separate intake step. .mdSiren is a document security workspace for AI. When it launches, Standard Scan will check the exact version for supported prompt-injection and document-borne risks, route it to Approved, Needs review or Quarantine, and keep the Approved exact version in your private Library. If the file changes, check the new version. This decision does not authenticate users, synchronise permissions or enforce retrieval access. A finding is a reason to review, not proof of malicious intent. Explore the document-checking workflow.

Frequently asked questions

How does access control work in RAG? One pattern projects source permissions to indexed chunks as metadata. Another retains source-object references and resolves current rights through a separate policy service. In either design, the authenticated subject's current rights must be enforced before selected context reaches the model, with both positive and negative tests.

Does a vector database preserve document permissions? Not automatically. A vector database can store vectors and permission-related metadata, but it does not recreate the source system's authorisation behaviour by itself. You still need to keep permissions current, enforce them in every retrieval path and test the result.

What is security trimming in RAG? It is the process of constraining retrieval results to content the user is authorised to see. Enforcement can occur in the query, index, application or a combination, but unauthorised content must not enter assembled model context.

How should a RAG system handle permission changes? Refresh or invalidate the permission state used by every affected retrieval path, including projected chunk metadata or policy caches where present. Invalidate relevant result caches, log the change, and test that the revocation is effective.

Is document scanning the same as RAG access control? No. Document scanning checks a specific document version for signals. Access control determines who can retrieve what. They are complementary layers, not the same thing.