Back

How-to5 min read

Set permissions for a private AI assistant

Guide card: Set permissions for a private AI assistant

A private AI assistant should answer from documents the person asking can already open. Copy the read permissions from the source, such as SharePoint, a file share or the ticket system, onto every chunk, and apply them as a filter at retrieval. The system prompt can ask the model to cite the passage. The filter decides who may see a file.

Decide what enters the index before you wire up access. What belongs in a private AI knowledge base draws that boundary. Preparing documents for private AI search covers cleaning, OCR and metadata. This guide is the access rule those fields have to enforce.

Why the filter runs before the model

The model quotes the passages placed in its context. When retrieval returns a salary sheet, a line that says “respect permissions” does not keep that sheet out of the answer in a way you can rely on. OWASP lists vector and embedding weaknesses among the top risks for LLM applications: leakage between groups that share one vector database, with permission-aware stores and logs of retrieval activity as the mitigations.

Products that already do this follow the source system. Microsoft states that Microsoft 365 Copilot “only surfaces organizational data to which individual users have at least view permissions”. Azure AI Search describes the same shape for an index you build yourself: permission metadata is captured during indexing and enforced at query time. On its SharePoint indexer, a permission change in the source stays out of the index until you reindex the affected documents.

Step by step

  1. Run each query as the signed-in person. Use the directory you already have, whether that is Microsoft Entra, Google Workspace or your own identity provider, and resolve that person’s groups on the request. A service account that can read the whole corpus makes every later filter decorative.

  2. Copy the access rules you already have, by group. On every chunk, store the groups that can read the source document, including rights inherited from the parent folder or site. Point the assistant at the same directory the file store uses. When someone changes team, the next query follows that directory. A second matrix, or a spreadsheet of names kept inside the AI project, drifts from the source within weeks.

  3. Filter retrieval before a passage reaches the model. Pass the caller’s groups into the search filter so a forbidden chunk never enters the prompt. Building the prompt first and deleting rows afterwards shows the model the text you meant to hide.

  4. Treat shared drives and “anyone” links as real access. A library shared with the whole company, a link anyone at the company can open, and a guest account on the site are permissions. The assistant will follow them, because you told it to mirror the source. Close the share in the file store, then refresh the index. The knowledge-base guide makes the same point for content: an overshared folder has to be fixed at the source before the index copies it.

  5. Refresh access when people or folders change. Permissions written at index time keep matching after you revoke them, until you write the new values. Do that when a group membership or a folder permission changes. Otherwise Monday’s query still applies Friday’s access, and someone who left finance on Friday still sees a finance passage on Monday.

  6. Log who asked, and which documents were used. Record the user, the time, the question and the document ids that entered the prompt. OWASP lists retrieval logs as a way to notice leakage from embeddings. Keep the log in a store with its own access rules. It is how you answer “did this person see that contract?”, and it is also a new copy of sensitive questions.

  7. Test with a low-privilege account before rollout. Sign in as someone who should see only one team’s documents. Ask for a fact that lives only in a forbidden folder, and confirm the answer is a miss or a refusal that neither quotes that file nor names it. Repeat as a member of the allowed group, and as the account that built the system. Then remove the test user from the group and ask again.

An illustrative example

A manufacturer wants an assistant over the SharePoint site people already use. Service manuals sit in a library the technician group can read. Finance and HR have their own libraries. A “Company” library was shared with everyone years ago, because sorting the folders was slower than leaving the default.

The first build uses one app registration that can read the whole site. A technician asks about overtime rules and receives a paragraph from an HR procedure. The passage was in the index, the prompt said to be careful, and the model quoted it.

Each chunk then stores the SharePoint groups that can open the file, and the query filter keeps the technician inside the service library. The Company library is narrowed to the groups that need it, then reindexed. The log records the user and the file ids. Before rollout, a technician account asks for the overtime rule and gets no HR passage. The same question from an HR account returns the procedure, with the file linked under the answer.

Common mistakes

  • A sentence in the prompt as the only control. The model can quote any passage you retrieved. The filter has to drop the passage first.
  • One service account that reads everything. Search then ignores who is asking. Run the query as that person.
  • A second permission list for the assistant. It disagrees with the file store within a month. Mirror the source groups.
  • Indexing access rules once. A revoked right stays in force until the new rule is written to the index.
  • Leaving a shared drive open to the whole company. The assistant treats that as permission, because it is.
  • A log the whole company can read. Questions about contracts and HR become a second leak.
  • Testing while signed in as the person who built it. That account can see every library. Use a low-privilege account, then change its groups and test again.

Next step

Pick one source and one group. Write down who can read it today, attach those groups to the chunks, and run ten questions as a user who is outside the group. If a forbidden document appears in the answer or in the log, stop and fix the filter before anyone else uses the assistant.

Rebels Software builds private AI on infrastructure you control, as part of the platforms and applications we deliver. In a Discovery workshop we map your sources and the groups that may read them, then prove one case as a PoC on your documents, inside your network, including a test with a low-privilege account. After deployment, Rebels Care keeps the index aligned when people and folders change. If that matches where you are, book a call on this page or start from the Rebels Software homepage.

  • Private AI
  • RAG
  • Access control