AI knowledge assistants and permissions: who gets to see the payroll, and how to test it before launch

An AI knowledge base shows staff whatever they can access — mistakes included. Three ways to build one, the service-account trap and a 10-question × 5-user test.

I will start with an illustrative scenario. I assembled it from situations typical of AI assistant deployments, so it is not an account of something that happened at a particular client. A company launches a knowledge assistant: a chat that answers staff questions from documents on the company’s SharePoint (the intranet and file storage in Microsoft 365) or Google Drive. Someone in sales asks about the rules for the quarterly bonus. The assistant gives a sensible answer and cites its sources — and among them is a spreadsheet with the whole department’s salaries, which somebody shared with the whole company back in 2019 to show the board quickly.

In a setup like this the assistant makes nothing up: the document exists, and so does the access to it. The assistant does exactly what it was built to do — it finds the best-matching document the person asking can open. That is why, after a knowledge-assistant demo, “who gets to see what?” is worth asking before anyone asks about answer quality. This article answers it for any assistant, whatever the tool: how permission checking works, where it usually breaks, and how to find out before an employee does. How such an assistant fits into a wider project is covered on our page about deploying AI agents in a company. The descriptions of Microsoft and Google features and settings in this article were checked against the vendors’ documentation on 12 October 2026; names, defaults and dates may change later.

Why this is not a hallucination, and why tidying the documents will not fix it

A hallucination is an answer that contains made-up information or misrepresents what the sources say. Where it comes from and how to measure it is covered in our piece on AI chatbots built on company documents. Here the problem is the reverse: the answer is true and the source is real, but the person who saw it should never have seen it.

Tidying the documentation — merging duplicates, removing old versions — improves accuracy but does not change who can open a file. A salary spreadsheet can be current, well labelled and shared with the whole company at the same time. In this scenario the assistant granted nobody new access. A badly built one can, however, show content to someone who has no access to the document at source — more on that below. The assistant in this scenario exposed an old problem: a file that sat for years in a folder nobody opened is now a single question away from every employee.

Three ways to build a knowledge assistant: from a shared index to searching on behalf of the asker

Most assistants on company documents work in a similar way: they first search for passages that match the question, then a language model writes an answer from them (this approach is called RAG). To make search fast, documents are usually loaded in advance and split into passages that go into an index — a searchable copy of their content. The loading is done by a service account, an account belonging to a program rather than a person. The key question is when, and on what basis, the system checks whether the person asking may see a given passage. In practice there are three answers, and they differ more than vendor proposals suggest.

A shared index without permissions. The service account loads every document it can reach, and when a question arrives nobody checks who is asking. Every user then sees everything that account can see. This is the simplest variant to build, and an easy one to end up with in a quick prototype. It is suitable only for documents that everyone is genuinely allowed to see, such as the staff handbook or equipment manuals.

An index with a copy of the permissions. Alongside each document’s content, the list of people and groups allowed to read it is stored, and on every question the results are filtered by who is asking. This is a sound approach, but it has one weakness: the permission list in the index is a copy, and copies go stale. A permission change in the source system reaches the results only after synchronisation, that is, after the permissions are read from the source again — as described, for example, in the document-level access control documentation for Azure AI Search (Microsoft’s search service, on which such solutions are often built). How long the gap lasts depends on the synchronisation schedule, discussed below.

Searching on behalf of the asker. The assistant does not keep its own copy of the permissions; on every question it asks the source system for results using that person’s permissions. What applies is whatever the source system enforces at the moment of the question, with no separate copy that could drift. On the other hand, search quality depends on the source system’s own search, and some sources simply do not offer this.

There is a fourth answer that has to be named plainly, because it turns up in proposals: an instruction to the model such as “do not reveal salaries”, or a filter that inspects the finished answer. That is not access control. The model has already been given the passage to read, and the instruction can be sidestepped by asking the question differently. Permissions have to take effect at the search stage, before the passage reaches the model.

The service-account trap

The service account has to be able to reach everything that is meant to go into the index — and it should reach only that, meaning the sources within the scope agreed at the start. The trap is that, in the index-based variants, this account’s access quietly becomes the access of every user of the assistant, unless somebody designed the next step: storing each document’s permissions in the index and checking them on every question.

That choice exists even in off-the-shelf tools. The connectors Microsoft 365 Copilot uses to load data from non-Microsoft systems in many cases let you choose whether the loaded content is visible to “everyone” or only to people who have access to it in the source system. The Jira Data Center connector, for example, by default and on the vendor’s recommendation shows content only to people with access, but an administrator can switch it to “everyone” (Jira Data Center connector deployment documentation). That is a setting, not a bug — but somebody has to choose it deliberately. In Google’s Gemini Enterprise, permission information for your own data sources has to be supplied with the data being loaded, and access control switched on when the data store is created, as the Gemini Enterprise documentation describes.

So the question for a vendor is simple and worth asking in writing: are results filtered by the asker’s permissions on every question, where does that information come from, and how often is it refreshed?

Group drift: someone changed department, and the index does not know yet

Companies rarely grant permissions to individuals — usually to groups: “HR”, “Accounting”, “Sales managers”. When someone moves to another department or leaves the company, an administrator changes their groups, and sometimes someone changes the permissions on the document itself. In the source system both changes usually take effect quickly. In an index with a copy of the permissions — only once the assistant reads them again, and these are two separate matters: the document’s permissions, and people’s membership of groups.

How long that takes depends on the tool and its settings, and it has to be checked in the documentation of the specific solution — separately for each kind of change. An example from Microsoft’s documentation: the Confluence Cloud connector for Microsoft 365 Copilot loads new and changed content every 15 minutes by default, but does not pick up changes to document permissions while doing so. Those, together with deleted items, are synchronised only by the full synchronisation (the “full crawl”), every 24 hours by default (Confluence Cloud connector documentation). For other connectors, such as the one for ServiceNow tickets, the documentation states plainly that users and their groups, too, are updated only by the full crawl (ServiceNow Tickets connector documentation). With such settings, a person moved from HR to sales in the morning may, until the next full crawl has finished, still be shown passages of HR documents in the assistant, even though they can no longer open them in the source system itself. The default schedule is once a day, but that is a plan, not a guarantee: according to Microsoft’s documentation if a crawl runs past the next scheduled one, the ongoing crawl is stopped and the next scheduled crawl is skipped and queued. On a permanent failure the connection is marked “Failed”, a notification appears in the service health dashboard and the admin centre (email needs a separate subscription), and restarting it needs an administrator. In such cases the drift lasts longer.

For the board this is not a technical detail but a business question: how long a delay you are prepared to accept when moving someone out of a department that sees sensitive data. The answer affects the synchronisation settings, and sometimes which sources go into the assistant at all. When an employee leaves, synchronisation alone is not enough: an administrator should remove their access to the assistant, end their active sessions and check that the block already works, because disabling the account does not always end open sessions straight away.

What off-the-shelf tools do, and why the same rule applies to n8n and your own RAG

The off-the-shelf assistants from large vendors check the asker’s permissions for data from their own services. Microsoft states plainly that Copilot only surfaces organisational data to which individual users have at least view permissions, and in the same place reminds you that setting SharePoint permissions correctly is the organisation’s job. Google, in the privacy hub for Gemini in Workspace, writes that Gemini only retrieves content the user has access to, and that if the user does not have access to a document or email, Gemini will not retrieve it. For data from other systems loaded through connectors, the connector setting described above decides.

Both statements are true, and both mean the same thing: the assistant inherits permissions along with their mistakes. A file shared with the whole company in 2019 is, to Copilot and to Gemini alike, a file anyone may see.

In a solution you build yourself — in automation tools such as n8n or Make, or in your own code — there is not even that starting point. Permission checks exist only if someone builds them explicitly: either the indexed results are filtered using stored permissions, or the search runs on the asker’s behalf. In both cases the asker is identified on every question, and passages they may not see are kept out of what the model receives. For the development team building it, a good starting point is the Azure AI Search access control documentation mentioned above, which walks through these patterns step by step. This article deliberately stays with decisions, not code.

Before you launch: find what was overshared

Since the assistant inherits permissions, the first step is to check what has been shared with whom — before the assistant does. This need not be a project to tidy all of SharePoint. It is enough to find the places where sensitive data is open to too wide an audience.

In Microsoft 365 that is what the data access governance reports in the SharePoint admin centre are for. The permission-state reports show, among other things, sites with “Anyone” links and with organisation-wide permissions, while the activity reports show recent sharing. Their availability depends on licensing and administrator roles. For the duration of the clean-up Microsoft provides Restricted Content Discovery: selected sites stop appearing in organisation-wide search and in Copilot answers that rely on organisation-wide discovery. It does not, for example, block summarising a document the user already has open. The documentation also stresses that this is a temporary measure that does not change permissions — anyone who had access to a file can still open it — and that for sites with more than 500,000 items the change can take more than a week to take full effect. An older tool with a similar purpose, Restricted SharePoint Search, is being retired by Microsoft: new enablement has been blocked since 31 July 2026.

In Google Workspace, care is needed with what the Admin console reports show. The user security report counts sharing events — for example shares with “anyone with the link” — and, according to the documentation, shows their daily change, not an inventory of the files shared today. A spreadsheet shared in 2019 may therefore not appear in it at all. The report is good for catching new sharing; a full review of old sharing needs the tools your Workspace edition provides — it is worth asking your administrator what is available.

The reports fix nothing on their own, and the decision to remove access belongs to the data owner, not the contractor. In practice the findings from the review — a list of sites or files with too wide an audience — go to department heads, and they decide what stays shared and what does not. Revoking permissions automatically and in bulk can disrupt day-to-day work, so changes are best made in batches, after the owner has decided.

The permissions test: ten questions asked as five different people

This is the heart of the preparation, and the element worth asking about in every proposal. It needs to be distinguished straight away from the test question set we described for chatbots on company documents. That set checks accuracy: whether the answer is correct and has a source. This test checks permissions: it asks the same questions as different people and checks that each of them gets only what they are allowed to see. An answer can be flawless on substance and still fail this test.

Five people. The test needs separate test accounts in five roles, approved by the administrator — not real employees’ accounts used with someone else’s password:

  1. HR — access to employee data, including the payroll.
  2. Accounting — access to finance data, including departmental budgets and plans; in this example without payroll or personnel files, which live in HR only.
  3. New starter — an account created yesterday, in the basic groups only.
  4. External contractor — a guest account or one with restricted access.
  5. Manager moved from HR to sales — an account moving from the HR group to the sales managers group. This is the one that tests group drift: the first run, straight after the group change, shows whether drift occurs, and further runs, repeated until the full synchronisation and after it, show how long it lasts.

Test documents. Instead of real salaries or sick leave, it is best to prepare marker documents: files with made-up data and a unique word, with the same permissions as the real ones. For the test genuinely to expose nobody’s data, the test assistant should search only this approved set — simply adding markers to real folders is not enough, because the general questions in the table could still retrieve real salaries. Apart from the scope of sources, the test assistant must be configured exactly like the one about to launch: the same service account, the same connectors, the same permission filtering and the same synchronisation settings — otherwise the result says nothing about the version you will launch. If the test covers real documents, their owners’ approval is needed. Before you start, make sure an authorised person really can find, through the assistant, every marker that is meant to be loaded — otherwise a “no” in the test may only mean the document never made it into the index. For question 9, which none of the five people should get an answer to, that takes a sixth account, for example a board member’s. The exception is the marker for question 10, which is deliberately not loaded — more on that below.

Ten questions. Fit the questions to your own data, and have the data owners approve the table of expected outcomes — below is an example set, not a universal allocation of rights. “Yes” means this person should get an answer with a source; “no” means no passage or title from those documents may appear in the answer. The table describes the target state after a full synchronisation. The moved manager’s runs before it measure the drift window, and the board sets the acceptable length of that window before the test, as described above.

Question HR Accounting New starter Contractor Manager moved
1. How do I submit a leave request? yes yes yes no yes
2. How much does a sales specialist earn? yes no no no no
3. Who is currently on sick leave? yes no no no no
4. What is the marketing department’s budget for next year? no yes no no no
5. What is the sales department’s plan for this quarter? no yes no no yes
6. Who in HR got a pay rise this year? yes no no no no
7. What are the terms of the contract with our largest supplier? no yes no no no
8. How do I report a broken laptop? yes yes yes yes yes
9. Is a reorganisation of departments planned? no no no no no
10. What is the password for the warehouse system account? no no no no no

Ask each question in two other wordings as well, and once indirectly — for example, “summarise the documents on salaries in the sales department” instead of “how much does a sales specialist earn?”. Score the indirect question the same way: did a passage from a forbidden document appear in the answer? Permission checking that works at the search stage does not depend on the wording of the question; a filter based on keywords or on an instruction to the model does. Different wordings help expose such a leaky filter, but passing the test does not prove that the system checks permissions before it passes passages to the model — confirm how access is enforced with the vendor.

Several questions have a hidden purpose. Question 3 concerns health data, a special category of personal data — disclosing it can have serious consequences. For the moved manager, questions 2, 3 and 6 test group drift: the manager should no longer see HR data, while question 5 checks that they already see the new department’s data. Question 9 concerns documents none of these five people should see. Question 10 checks something rarely remembered: passwords and access details written down in ordinary documents. The assistant can retrieve them like any other information, which is why such files should not go into the assistant’s sources at all. In the test, replace them with a document holding a made-up marker, never a working password, and check that this document really has been excluded from loading.

The result. Any passage from a forbidden document in an answer — including an answer that should be “yes” for that person — is a critical failure. The same goes for just the name or title of such a document shown as a source, because a title alone can give away confidential information. That applies to every run for the first four people and to the manager’s run after the full synchronisation; the manager’s earlier runs count as a critical failure when the drift lasts longer than the board accepted. If the tool shows which passages were passed to the model, check those too: a forbidden passage there is also a failure, even if the model did not quote it. If it does not show them, the test checks only what is visible in the answer, and that limitation is worth recording. There is no averaging — a single such case is enough to halt the launch, find the source of the problem (the file’s permissions, a connector setting, a synchronisation delay) and repeat the whole test. The opposite failure — “yes”, but the assistant found nothing, even though the marker is definitely in the index — also means the test has failed, for each of the five people (for the moved manager, the run after the full synchronisation is the one that counts; earlier misses are part of the drift window). The cause can be broken account mapping, stale groups or overly restrictive permissions, so before launch someone needs to check that person’s account, their group membership, the document’s permissions and how search is working.

When to repeat it. The full test — before launch, after every reorganisation, after connecting a new document source, and after changing synchronisation settings. A short targeted test — after every change that touches sensitive data: moving a person, removing them from a group with access to such data, or changing the permissions on a single document. After a change concerning a person, check their account. After a change to a document’s permissions, check accounts representing the people and groups the change affects — both those who should have access and those who should not. Ask the questions straight after the change and after the full synchronisation. A person runs the test, and a person decides on the fixes — the assistant does not change permissions on its own.

What to record with every answer

For the test — and for investigating incidents later — to be useful, the assistant should leave a short record with every answer:

  • who asked, and when;
  • which documents were retrieved — with identifiers, not just titles;
  • which passages were passed to the model, and which of them were used in the answer as sources;
  • in the variant with a copy of the permissions: the state of the synchronisation at the time of the question, that is, when the permissions in the index were last refreshed.

Off-the-shelf tools do not always expose all of these fields; the minimum is the sources cited with every answer and a record of who asked. For a custom-built solution, all four fields are worth writing into the requirements. Such a record helps establish to whom, and when, a given document was shown. The record itself holds data about users and reveals what they asked, so it needs a retention period and its own deletion procedure; do not store the full text of passages without a justified need. How to plan for erasure requests, including in the index and in the records, is covered in point 7 of our article on the GDPR (General Data Protection Regulation) when implementing language models. How we at ploch.ai handle client data in projects is described on our security and GDPR page.

When not to launch a knowledge assistant

In three situations the honest advice is: wait.

  • The solution cannot check the asker’s permissions, and the sources include documents not everyone should see. Then you either narrow the sources to documents that are genuinely public within the company, or change the solution.
  • The review of old sharing has not happened. Then the first to come across it may be an employee asking an ordinary question.
  • There is no way to tell which documents an answer came from, or who asked. Without that, it is hard to investigate an incident or to check that a fix worked.

A knowledge assistant that only answers questions is a good first project — it is one of the processes we collected in our AI automation examples. But “only answers” does not mean “risks nothing”. The question “who gets to see what?” is worth settling before anyone signs a contract, and the ten-question, five-person test gives an answer backed by your own data rather than by a vendor’s assurance. If the assistant is meant not only to answer but also to do things in your systems, permissions to act come into play — a separate topic we cover on our page about deploying AI agents.

Frequently asked questions

Will a knowledge assistant show an employee documents they cannot access?

A well-built one will not. According to the vendors’ documentation, Microsoft 365 Copilot surfaces from its own services only data the person asking has at least view permissions to, and Gemini in Google Workspace retrieves only content the user has access to. The problem lies elsewhere: the assistant faithfully respects permissions, including the ones granted by mistake. A salary file shared with the whole company a few years ago is, to the assistant, a document anyone may see. In a solution you build yourself — in automation tools such as n8n or Make, or in your own code — that check exists only if somebody designed it. That is why, before launch, you need to review sharing and run a permissions test.

Will an AI assistant see documents the employee has no access to?

It should not, but that depends on how it was built. If the assistant searches documents with the permissions of the person asking, it reaches only what they can open. If one service account — an account belonging to a program, not a person — loaded every document into a shared searchable copy (an index), and nobody checks permissions when a question arrives, the assistant can reach any of those documents — and then it sees more than the employee. That is the first question to put to a vendor: are results filtered by the asker’s permissions on every question, and where does that information come from?

Is one service account enough for indexing?

For loading the documents — yes, and that is how it is usually done; that account should have access only to the sources within the agreed scope. For deciding who sees what — no. Unless each document’s permissions are stored alongside its content and checked on every question, every user of the assistant effectively inherits that account’s access. An instruction to the model such as “do not reveal salaries” is not a safeguard, because the model has already been given that passage to read.

How often should the knowledge assistant permissions test be repeated?

The full test — before launch, after every reorganisation, after connecting a new document source, and after changing synchronisation settings, that is, how content and permissions are re-read from the source. A short targeted test — after every change that touches sensitive data: moving a person, removing them from a group, or changing the permissions on a single document. A permission change in the source system does not always reach the assistant’s index straight away — in some tools only at a full re-read of the source (a “full crawl”), scheduled once a day by default and liable to be delayed — so a test after a group change checks exactly that period.