What does the internal assistant say if someone in sales asks how much was paid in bonuses this year? If the answer depends on the model knowing when to keep quiet, the assistant has already read the payroll. It is worth knowing at what point it checks what the person asking is allowed to see.
An assistant over internal documents searches an index (a copy of the documents prepared so they can be found quickly) for the passages that seem to answer, and the language model writes the answer from them. This is called RAG, retrieval-augmented generation. Each person's permission can be checked in three places:
- When answering: the assistant finds whatever is there, and the model, or a filter afterwards, is asked not to show what that person shouldn't see.
- In a copy: who can see each document is recorded in the index, or in a separate database, and results are filtered with that list.
- When searching: the search engine only returns the documents that person can open in the source system, with the permissions they have there.
Where the filter goes
For me, the place is the third one. Permissions are applied at search time and read from the source system (SharePoint, Drive or the document management system), without going through a copy: the assistant searches with the permissions of the person asking and never finds what that person can't open. What isn't found can't end up in the answer, either copied or summarised.
In the Enterprise AI marketplace, permissions are granted per user and per assistant: each person only sees the assistants and processes they are authorised to use. That settles which assistant you can ask, but not which documents that assistant can find when you ask. That second level is the one I am defending here.
OWASP, a foundation that publishes lists of security risks, already asks for this in its 2025 list for applications built on language models: fine-grained access controls and vector stores that are permission-aware. It is also the access control before retrieval that appears in the good practices for RAG in production.
Asking it not to tell
Filtering at answer time is the quickest to set up: you connect the assistant to everything and add an instruction along the lines of "do not reveal confidential information". The document, however, is already among what the model has read. Asking the model not to reveal something is a request, not a control. It complies almost every time, and nobody knows which time it won't.
A research team at a large software company makes this case in a 2025 position paper (Shashank Shreedhar Bhatt and 12 other authors). They argue that the usual defences to stop an assistant leaking information to people who shouldn't see it, such as filtering input or output, are "fundamentally probabilistic". Their rule is deterministic: everything the model uses must be authorised for all the people taking part in the conversation.
The copy that falls behind
The second option looks more solid. The list stored in the index stops matching the one in the document management system without warning: someone changes a permission at the source or deletes a document, and the index doesn't find out until it processes it again.
That is what Ayush RoyChowdhury and four other researchers at the University of Texas at Austin tested (arXiv, 2024) on an off-the-shelf enterprise assistant that searches a cloud document management system. The assistant answered from a cached copy of the documents. In their tests, a deleted document kept appearing in answers for about 164 seconds (164.2 with a margin of ±3.25, according to their table), and a confidential document shared by mistake and deleted afterwards could still come out in an answer.
The documentation of a cloud search service makes it clear when it describes this pattern. The group stored in the index "is just a string", with no authentication behind it, and the application has to authenticate each person, apply the filter on every query and stop anyone from bypassing it.
What filtering at search time doesn't fix
Filtering at search time doesn't solve everything. The assistant can infer something by combining documents you are allowed to see, and no search filter prevents that. The filter also depends on the source permissions being set correctly: a folder shared with the whole company years ago is still open to the assistant. The only exception I would make is content that is genuinely for the whole company, such as policies or the employee handbook. There is no need to filter there; what you have to check is that it really is public. Nor does it stop someone from taking out what you can see, which depends on the permissions of the agent's tools. And no source compares the three options with data from real companies: that the filter belongs in the search is my reading.
What to do
Whoever does the work:
- Before opening the assistant to the whole company, run two tests. First, two test users with different permissions ask the same 20 questions, and you compare what each one finds. If a document shows up even once for someone who shouldn't see it, the assistant doesn't go live.
- Second, remove access to a document and measure how long it takes to stop showing up. Note how often the permissions the engine reads are updated.
Whoever leads:
- Before opening the assistant to the whole company, ask for a review of the folders shared with everyone in the document management system.
- Ask every month for the result of the two tests: test questions that return something they shouldn't must be zero, and the time a revoked permission takes to stop appearing, whatever the company has decided to accept.
What you can't open, the assistant shouldn't be able to find.
Frequently asked questions
Where are permissions enforced in an assistant over internal documents?
In the search. The engine that looks for the passages to answer with should only return documents the person asking can open in the source system (SharePoint, Drive or the document management system), with the permissions they have there, without going through a copy. What isn't found can't end up in the answer, either word for word or summarised.
Is it enough to tell the model not to reveal confidential information?
It gives no guarantee. The document is already among what the model has read, and the instruction is followed almost every time. A 2025 position paper by Bhatt and 12 other authors (arXiv) describes input and output filters, meant to stop an assistant leaking information to people who shouldn't see it, as "fundamentally probabilistic" defences and calls for deterministic access control.
What is the problem with copying permissions into the assistant's index?
The copy falls out of date. In the ConfusedPilot study (RoyChowdhury and others, arXiv, 2024), the assistant worked from a cached copy of the documents: a deleted document kept showing up in answers for about 164 seconds, because the assistant answered from a copy that is updated periodically.
What does OWASP recommend for assistants that search documents?
In its 2025 list of risks for applications built on language models (LLM08), OWASP calls for fine-grained access controls, permission-aware vector stores and strict partitioning of the data so there is no access between different groups of users.
Does filtering at search time prevent every information leak?
Not all of them. The assistant can infer something by combining documents you are allowed to see, and the filter is only as good as the source permissions: a folder shared with the whole company years ago is still open to the assistant. The only exception is content that is genuinely for the whole company, such as policies or the employee handbook: there is no need to filter there, but you have to check that it really is public. You also need to know how often the permissions the engine reads are updated.
How do you check that an internal assistant respects permissions?
With two tests. First, two test users with different permissions ask the same 20 questions, and you compare what each one finds. Second, you remove access to a document and measure how long it takes to stop showing up. If a document shows up even once for someone who shouldn't see it, the assistant doesn't go live.
Sources
- OWASP GenAI Security Project, "LLM08:2025 Vector and Embedding Weaknesses", OWASP Top 10 for LLM Applications, 2025.
- Shashank Shreedhar Bhatt and 12 other authors (Microsoft), "Enterprise AI Must Enforce Participant-Aware Access Control", arXiv:2509.14608, 18 September 2025.
- Ayush RoyChowdhury, Mulong Luo, Prateek Sahu, Sarbartha Banerjee and Mohit Tiwari, "ConfusedPilot: Confused Deputy Risks in RAG-based LLMs", arXiv:2408.04870, v5, 23 October 2024.
- Microsoft Learn, "Security Filter Pattern", Azure AI Search, documentation consulted on 4 December 2026.

Bernat López is founder and CEO of onext, an AI boutique. He helps development and product teams work with AI with method —specification before building, automated checks and Spec-Driven Development— and applies to his own company what he proposes: onext runs on its own agentic system.
LinkedIn →