GUIDE · RAG AND KNOWLEDGE BASE

RAG and permissions: letting each person see only the documents they can read

By the end of this guide you will be able to apply the permissions of the source documents to the answers of a RAG system, verify that no user receives passages they are not entitled to read, and establish who approves the rules. The path starts from user identity and ends with revocation tests and logs.

Updated october 2026
7 min read
Altovar Technical Editorial Team

1. Why permissions are the most sensitive point

In a traditional document system access control is often taken for granted: anyone who cannot open a folder cannot see the file. A RAG system breaks this habit, because it indexes content and answers with extracted passages. If the permission filter is forgotten, the system returns content reserved for people who should not read it, even if nobody has opened the original file and even if the answer seems entirely harmless.

An error of this kind is not a wrong answer but a breach of confidentiality, with the consequences that the GDPR provides for personal data. For this reason the control must be designed before the first indexing, not added afterwards as a convenience feature. Ask the supplier to explain how the filter is applied, step by step, and not merely to confirm that it exists.

2. Prerequisites: identity and permissions already in order

The control only works if the source permissions are correct. If confidential documents are already accessible to everyone in the document system, the knowledge base will make them available more easily and more quickly, because search brings into view in an instant what was previously buried in a folder. Clean-up of permissions must be done before connecting any search system, and it is worth asking the owner of the document system for a written verification.

You also need a unique identity for every user, up-to-date group memberships and a process for staff joining and leaving. A shared account or a forgotten group translates directly into unintended access. Check these foundations with the security manager before you start. The rules must be written into a procedure, not left to the memory of whoever configures the system.

3. Steps to apply the control

The sequence matters. The control must be attached to the documents and to the people, and then verified on the final answer. Filtering the interface is not enough: the system must exclude unauthorised passages before they reach the model, because the model cannot distinguish what may be shown from what must stay hidden. Follow these steps and approve each one before moving to the next, with a written record of the decision.

The security manager signs off the final configuration after seeing the test carried out with test users. A signature without a test has no value, because the configuration may look correct in the files and behave differently in operation. Ask that the signature be accompanied by the test result, attached to the record, and keep both with the approved configuration. This document will be the first thing the internal audit asks to see.

  1. Map the documents with their source permissions, group by group.
  2. Associate each indexed passage with the permissions of the document it comes from.
  3. At the moment of the question, identify the user through the company's access system.
  4. Filter the retrieved passages against the user's groups before the answer is generated.
  5. Record in the logs which documents were used for each answer.
  6. Verify with test users at different access levels, before opening the knowledge base.
  7. Define how revocation propagates and measure its timing with a test.

4. Common mistakes

The first mistake is filtering only in the interface, leaving the searchable archive containing everything. The second is copying permissions once, at the time of indexing, without updating them when they change in the document system. The third is forgetting derived documents, such as summaries, extracts and attachments, which inherit the same constraints as the document they come from and often end up in archives with more permissive rules.

  • A service account with access to everything, used by the system to read documents.
  • Groups that are too broad, created for convenience and never reviewed.
  • Logs that are absent or cannot be consulted when you need to understand who read what.
  • Tests run only with the administrator user, who sees everything.

5. How to verify that it works

Verification must be built as a small test plan. Choose a few confidential documents and a user who should not be able to read them. Have that user query the knowledge base with questions that correspond precisely to those documents, and check that the system returns nothing confidential, either directly or as a summary. The test must also include the questions closest to the confidential content, because that is where a faulty filter shows itself.

Repeat the test after every change to groups, documents or configuration. Keep the results as evidence for management and for internal audit. If the supplier says the control works, ask to see the test carried out, not just the written confirmation. An unproven control is a promise, not a guarantee. Also repeat the test with a user who changes group during a session, because that is a case where previous permissions can remain active by mistake.

6. Revocations, role changes and departures

An employee who changes department or leaves the company must lose access to the knowledge base at the same moment as they lose it in the document system. If revocation happens at different times, there is a window in which the person can still receive answers about documents that are not theirs to see. Define these timings in writing, verify them with a test, and document who is responsible for starting the revocation when a role changes.

Also ask whether the system caches passages already retrieved, and for how long. A cache that ignores changed permissions is a frequent blind spot. The topic of roles connects to the general management of the user lifecycle, which must be followed with the same rigour as access to email or financial systems. Also ask who receives notice that a revocation has taken place, so that the change does not go unactioned.

7. How to get started

This week, identify a pilot area with confidential documents from a single group, and verify that the source permissions are correct. Ask the security manager to define the test group and the revocation plan, with precise names and roles, so that everyone knows what to check and when. Write the plan on a single page, with the roles and verification dates, and have it approved before starting the test.

Only after this step does it make sense to ask the supplier to show the filter in action. A control verified on a small area is more useful than a large project with unclear permissions, because the error is found quickly and corrected before it spreads. The supplier should show the configuration in operation only after that, with a real user from the pilot group.

Frequently Asked Questions

Can the system ignore permissions to improve answers?

It should never do so. The permission filter is a condition, not a quality parameter. If a better answer requires unauthorised passages, the answer must not be given. The system can state that it does not have sufficient information, and that is the correct behaviour.

Is company login enough to manage permissions?

Login identifies the person, but it does not on its own decide what they may read. The document system and the knowledge base must read the same groups and apply the same rules. Verify that identity reaches the RAG system securely and cannot be modified by the end user.

How are public documents handled inside a confidential archive?

With clear classification. Public documents can be accessible to all authenticated users, while confidential ones require specific groups. Avoid mixing them into a single archive without distinction, because that distinction is exactly what the control must enforce.

Must AI-generated summaries respect the same permissions?

Yes. A summary, an extract or an answer derives from documents with specific permissions, and inherits the constraint. Ask the supplier how derived content is handled and whether it is saved in archives with different rules, because this is one of the points where controls are lost.

Should the data protection adviser be involved?

If the knowledge base contains personal data, involvement is advisable. The adviser helps assess the legal basis for the processing, its entry in the record of processing activities and the need for a data protection impact assessment. The choice of model and permissions remains a technical matter, however, and should be decided together.

About this content

General informational guide. Regulations and technical requirements change over time: always check the official sources and assess your specific case with a qualified technical or legal advisor.

GET IN TOUCH

Talk to our team.

We'll show how Altovar integrates into your infrastructure. No commitment, no sales pitch. Just a technical conversation.

BOOK A DEMO →