Back to the blog AI Infrastructure

Does Your RAG Assistant Respect Document Permissions? A Practical Access-Control Test Plan

A RAG assistant needs more than sign-in to protect restricted documents. Trace permissions from the source system through indexing, retrieval, caches and logs, then test access changes and failures.

Diagram tracing user permissions from a document source through RAG indexing and retrieval to an access-controlled answer

A sign-in screen does not prove document access is enforced

A user can be authenticated to a RAG application and still receive content they are not allowed to see. Sign-in answers who is using the application; document-level authorization answers which source material that person may retrieve.

The distinction matters because a RAG pipeline transforms documents into chunks and derived data, then selects some of that content to provide to a language model. A source document’s permissions do not necessarily follow those chunks automatically. Access needs to be checked across ingestion, storage, retrieval and the other places content may persist.

Treat the test as a trace: Can the application resolve the requester’s identity and current access rights, apply them to every retrieved chunk before it reaches the model, and prevent restricted content from appearing elsewhere? A citation or a model instruction to avoid restricted material is not an authorization control.

  • Authentication identifies the user; authorization decides whether that user may access a particular resource.
  • A successful answer for an authorized user does not demonstrate that a different user is denied the same document.
  • Self-hosting gives a team control over deployment, but it does not by itself establish document-level access control. Support depends on the application, its connector, configuration and permission model.

Set the acceptance rule before testing

Write down the expected result for each access state. A safe baseline is least privilege: allow only access that is explicitly permitted, and deny access when the system cannot establish that permission. Consider both content access and disclosure through document titles, citations, snippets or other metadata.

  • Authorized user: only permitted source content may enter retrieved context.
  • Unauthorized user: restricted content and revealing metadata are not returned.
  • Unknown identity, missing permission metadata or unavailable permission checks: restricted content is not served until access can be established.
A sign-in screen does not prove document access is enforced

Map the full path from identity to retrieved context

Before configuring or testing an application, draw the route a document takes from its source to an answer. Record where the source defines permissions, how the connector reads them, where identity and group membership come from, and which component applies the decision at retrieval time.

Inventory the protected resources and the systems that configure access. Rules may be distributed across a source repository, identity or group service, connector, application, and vector store. Identify an owner for each rule and note which component is expected to enforce it.

  • Source: document identity, owner, groups or roles, and the source system’s access rules.
  • Ingestion: how the connector reads content and permission metadata, and what happens if either is unavailable.
  • Chunking and storage: whether every chunk retains the document identity and relevant access metadata.
  • Identity resolution: how the requester maps to a source identity and current groups or roles.
  • Retrieval: where access is checked and whether it is checked before content is sent to the language model.
  • After retrieval: whether answers, citations, conversation history, caches, exports or logs can retain restricted content.

Trace authorization across the RAG path

For each step, identify the component responsible for preserving or enforcing access rights. The authorization check must happen before restricted content reaches the language model.

  1. 1
    Source permissions

    Identify the document rules, owners, groups and source of truth.

  2. 2
    Connector and ingestion

    Verify the connector imports usable permission metadata alongside the content.

  3. 3
    Chunks and storage

    Confirm every chunk remains associated with its source and access metadata.

  4. 4
    Identity and retrieval

    Resolve the requester’s current rights and filter unauthorized chunks before model context is built.

  5. 5
    Answer and retained data

    Check citations, conversation history, caches, exports and logs for restricted content.

Map the full path from identity to retrieved context

Inspect what the connector does with permissions

A connector that imports document text is not necessarily importing the source system’s access rules. Confirm the behavior for the specific connector and configuration you plan to use; do not infer support from the RAG application’s general features or from a successful connection.

Ask how permissions are represented after ingestion. Access metadata should remain attached to every relevant chunk, rather than being lost during chunking or embedding. Establish how the application evaluates that metadata against the requesting user at retrieval time; an ingestion-time check alone can become stale when permissions change.

  • Which source permissions and identity fields does this connector read?
  • Can it represent the source’s group, role, owner or tenant distinctions in the application?
  • Does each chunk retain its source document identity and access metadata?
  • What happens if a document has no usable permissions, the connector cannot read them, or identity mapping is ambiguous?
  • Does the application enforce the decision before any retrieved content reaches the language model, or does it rely on the model to obey instructions?

Run a cross-user retrieval test

Use a small, controlled collection with deliberately different access rights. Include at least one document that one test user can read and another cannot, and use distinctive test content so you can recognize leakage in answers, citations and logs. Write down the expected result before running queries.

Test retrieval boundaries, not just whether the application returns an answer. Check the answer text, cited documents, snippets and any visible source details. Where the application exposes retrieved chunks or audit records, inspect those too, using only accounts authorized to see the underlying material.

  • Sign in as an authorized user and confirm permitted content can be retrieved.
  • Sign in as a user without access and ask the same question. Confirm restricted content does not appear in the answer, citations or snippets.
  • Where separate tenants or departments are in scope, test that one cannot retrieve another’s chunks.
  • Repeat the test with a mixed-access query that could draw from both permitted and restricted documents.
  • Verify that the decision is associated with the actual requesting identity, not a shared connector identity that grants broader access.

Core document-permission test cases

Run each case with controlled test users and record the expected and observed result. Restricted content should not be returned to a user who lacks access.

Test caseSetupExpected result
Different user rightsTwo users have different access to the same collection.Each user retrieves only documents their rights permit.
Cross-tenant or department boundaryA user queries content associated with another tenant or department.No chunks, citations or revealing metadata cross the boundary.
Permission revokedA user loses document access or is removed from an allowed group.The user cannot retrieve the content after the system applies the change.
Source deletedA source document is deleted or de-permissioned.Its derived content is no longer retrievable or retained in related pipeline data.
Permission data unavailableThe connector cannot supply or refresh usable access metadata.The system denies or quarantines access rather than serving content on uncertain rights.

Test revocation, group changes and deletion

Change a test user’s access at the source, then repeat the same query once the change should have taken effect. Include both direct document access changes and group or role membership changes. Record how long synchronization takes and how you determine that the updated permissions are being applied.

Also test source removal. Deleting a file from its original location is not enough if its chunks, embeddings, summaries, cached results or other derived data remain available elsewhere in the RAG pipeline. Establish what the application and connector remove and how you verify completion.

  • Revoke a user’s access to a document and verify that retrieval no longer returns its content.
  • Remove a user from an allowed group and test with that user’s current identity.
  • Delete or de-permission a source document and check retrieval, citations and other derived data.
  • Repeat relevant tests after permission synchronization, connector errors or recovery from an outage.
  • Check cache invalidation so a previously authorized answer does not remain available to a user who is no longer authorized.

Check the places content can persist after retrieval

Authorization must account for more than the vector store. A restricted answer or source reference may persist in conversation history, caches, exports or logs. Whether these features exist, how they behave and who can access them varies by application and configuration, so test the actual deployment.

Review whether a user can reopen a conversation after losing document access. Check whether cached results are isolated by user or access context and invalidated when permissions change. Consider whether citations disclose sensitive document names or identifiers even when the answer text omits the content.

Logs can help investigate access decisions, but they may reveal information about underlying documents. Record enough to audit which identity requested which content and the relevant access metadata, while restricting log access and setting retention appropriate to your needs.

  • Conversation history and shared conversations
  • Cached answers, retrieved chunks or search results
  • Citations, source titles, snippets and exports
  • Application, connector and retrieval logs
  • Backups or other retained copies of data that the application stores

Define safe behavior when permissions cannot be confirmed

Decide what happens when a connector is unavailable, a permission refresh fails, group membership cannot be resolved or a document has no usable access metadata. For restricted content, a safe default is to deny or quarantine retrieval until authorization can be established. Continuing to use an old permission snapshot may preserve access that has already been revoked.

Document the trade-off: fail-closed behavior can make some content unavailable during a synchronization problem, but serving it on uncertain rights can expose data. Make the user-facing response clear without revealing restricted content, and make the condition visible to the responsible operator.

  • Define which failures block retrieval and who can resolve them.
  • Do not treat missing permission metadata as permission for everyone.
  • Record synchronization failures and affected sources without placing restricted document content in broadly accessible logs.
  • After recovery, confirm permissions are refreshed and rerun relevant access tests before restoring retrieval.

Assign ownership and make access review continuous

Access rules may be configured in multiple systems, so name an owner for each part of the path: source permissions, identity and group mapping, connector behavior, retrieval enforcement, and retained data. Keep an inventory of protected collections and where each rule is configured.

Make the test plan part of ongoing operations, not only launch approval. Re-run it after connector or permission-model changes, group-mapping changes, significant application configuration changes, or incidents involving access or synchronization. Periodically compare the source’s current permissions with the access metadata used by retrieval.

For teams deploying a self-hosted RAG application, hosting and application security are separate responsibilities. Airbip provides managed deployment for applications in its public catalog, with instances running as Docker workloads on Airbip cloud servers. Teams still need to choose and validate the application’s connector, permission model, data handling and access policies for their requirements.

  • Keep a resource inventory with source, owner, access-rule location and connector.
  • Use least privilege and default-deny rules where appropriate.
  • Track synchronization status and investigate stale or missing permission data.
  • Retain repeatable cases for authorized, unauthorized, revoked and deleted-document scenarios.
  • Review access to logs and retained content, and define how long each should remain available.

Frequently asked questions

Does signing in to a RAG application mean its answers respect document permissions?

No. Sign-in identifies the user, but the application must separately determine which documents that user may access and enforce that decision before restricted content reaches the language model.

Is checking permissions when documents are indexed enough?

No. Permissions can change after ingestion. Keep access metadata associated with each chunk and test whether retrieval evaluates the requester’s current rights.

What should happen if a connector cannot read a document’s permissions?

Define a safe failure rule in advance. For restricted content, deny or quarantine retrieval until permission can be established rather than treating missing or stale metadata as authorization.

What should be removed when a source document is deleted?

Check for the source document and its derived data across the RAG pipeline, including chunks, embeddings, cached results and other retained copies. Verify that the deleted or de-permissioned content can no longer be retrieved.

Does self-hosting guarantee RAG document-level access control?

No. Self-hosting does not by itself provide document-level authorization. Support depends on the application, connector, identity mapping, configuration and how the deployment handles permission changes and retained data.

Sources and further reading 2
  1. RAG Security Cheat Sheet OWASP Cheat Sheet Series
  2. Zero Trust Journey Takeaways National Institute of Standards and Technology (NIST)