AI Knowledge Base Search: Permissions Before Answers
AI knowledge base search that filters by permission before it answers: decision inputs, failure modes, citations, a no-answer path and a pass gate.

AI knowledge base search lets staff ask a question in plain language and get an answer written from company documents, with the source named. It is only safe when the system decides what each person may read before any model sees a word. A search that answers from the whole index and hides the result afterwards has already leaked it.
This guide is for Australian product owners and development leads building one internal search feature that must be correct, traceable and testable. It narrows our guide to RAG for private company data down to the permission layer, and leaves model hosting to the related guide on local LLM for business. If the search must run on a phone without a connection, see the related guide on on-device AI for mobile apps.
Key Takeaways
- Apply each user's permissions inside the retrieval query, so restricted text never reaches the model, the citations or the cache.
- Treat deletes and permission changes as events with a time limit, and reconcile the index against the source every day.
- Require a citation that maps to a retrieved passage, and show a no-answer message when none exists.
- Accept the system only against a held-out question set and cross-group probes, with pass marks agreed first.
AI Knowledge Base Search for Business: Start With One Document Set
Begin with one document set, one reader group and one owner. An operations handbook, supplier procedures and IT runbooks for a single department fit: the questions are factual and a wrong answer is caught quickly. Leave HR files, contracts, health information and other personal information out of the first release. The OAIC says privacy obligations apply to personal information put into an AI system and to AI output containing it, in its guidance on commercially available AI products.
Which Decision Inputs Shape the Permission Design?
Four decisions settle most of the design before anyone writes code.
- Source of truth for access - Name the system that records who may read what, and copy that access into the index instead of keeping a second rule set.
- Unit of permission - Decide whether access is set per document, folder or section. Each passage takes the narrowest unit.
- Identity at query time - Each search call carries the signed-in user's identity, and group membership is resolved when the question is asked.
- Revocation target - Agree how fast a removed permission must stop returning results. Fifteen minutes is an example to negotiate, not a standard.
How Does AI Knowledge Base Search Enforce Permissions?
Permissions are enforced in the retrieval query, before ranking, and never in the prompt. OWASP's guidance on sensitive information disclosure warns that restrictions written into a system prompt may not always be honoured and can be bypassed through prompt injection.
OWASP's entry on vector and embedding weaknesses lists unauthorised access and cross-context leaks, and recommends permission-aware stores with strict partitioning between user groups. Microsoft's security filter pattern for Azure AI Search stores the allowed principals on each item and filters every query. It notes the principal is only a string, so the filter is only as trustworthy as the identity your application passes in.
- Allow list on every passage - Store allowed group IDs beside each passage's text and vector, and filter in the same query as the search. Filtering afterwards can leave thin or empty results and carries restricted text through your application.
- Deny by default - A passage with no mapped permissions is excluded from search, never treated as public.
- One filter for everything that shows text - Citations, snippets, titles and typeahead come from the same filtered query. A title alone can reveal that an incident exists.
- Cache by permission set - Key any cache on the question plus the user's group set, or skip caching at first.
Failure Modes to Plan For
Most permission leaks come from change over time, not from the first build.
- Stale permissions - Resolve membership at query time, sync access changes from the source on events or a short schedule, and run a daily job that reports any difference between index and source.
- Deleted and superseded documents - Store the source ID and version on every passage, delete by source ID and compare passage counts with live documents. Organisations covered by the Privacy Act face APP 11 guidance from the OAIC, which expects reasonable steps to destroy or de-identify personal information no longer needed, unless a law or order requires it to be kept, so remove index copies with the source.
- Ambiguous sharing - Link-based sharing and inherited folder permissions do not map cleanly to groups. Write the mapping down and take the narrower reading when unsure.
- Hidden or planted content - OWASP describes hidden text in a document that changes system behaviour. Validate documents and detect hidden content before indexing.
What Must Every Answer Show, and When Should It Refuse?
Every answer needs a citation pointing at a passage the user was allowed to retrieve. Make this a code check: the application compares each cited source ID with the passages returned for this user and discards the answer on any mismatch. Show the title, owner and last-modified date with each citation.
The no-answer path has three triggers: nothing returned after the permission filter, a best match below a minimum relevance score chosen from your test set, and sources that contradict each other. The message should say that no answer was found in documents available to this user, and must never say a restricted document exists. Offer a next step, such as asking the document owner.
A named owner reads every logged no-answer question and a weekly sample of cited answers, and each confirmed miss joins the test set. The OAIC asks organisations to consider how human oversight can be embedded in their processes.
A Measurable Acceptance Gate for AI Knowledge Base Search
Agree the gate with the business owner before testing. These figures are illustrative examples for one team, not benchmarks.
- Answerable set - 100 real questions with known sources, 30 held out while tuning. Example pass mark: the correct source cited on 90 of the 100 and 27 of the 30 held-out questions.
- Unanswerable set - 20 questions the documents do not answer. Example pass mark: the no-answer message on at least 18.
- Cross-group probes - For each pair of groups, ask questions answered only in the other group's documents. Pass mark: no restricted passage, title or snippet in any response, log entry or cache. The tolerance is zero because one leak is a design failure.
- Change tests - Remove a test user from a group and delete a test document, then confirm both changes take effect within the agreed target.
- Review sample - A named reviewer checks every failure and a sample of passes.
Run the gate before launch and after any change to the embedding model, splitting rules, prompt or permission mapping. Log the user ID, filter applied, passage IDs, answer and reviewer outcome, storing IDs rather than text so the log is not a second copy of restricted content. OWASP recommends detailed immutable logs of retrieval activity, and our guide to SaaS audit logs covers how to protect them.
Cost Controls for a Narrow Pilot
Index only the approved set, re-embed only changed passages, and cap monthly spend on the embedding and answer services. Limit passages per question and answer length, and rate limit each user.
An Implementation Sequence That Keeps the Risk Small
- Choose one document set, one reader group and a named owner, and exclude documents whose permissions cannot be mapped.
- Build ingestion that stores source ID, version, owner, last-modified date and allowed groups on every passage.
- Build filtered retrieval, then the citation check and the no-answer path.
- Record a baseline with your existing search on the same questions. Our guide to vector databases for business search shows when plain full text search is enough.
- Run the gate and fix each miss. Release to the one group, and add the next only after repeating the cross-group probes.
Products that already enforce roles can reuse that access model, as our guide to SaaS roles and permissions that scale describes. For search inside a larger product, 9Byte builds retrieval augmented generation grounded in a company's own knowledge base, as described among our AI-powered platform options.
Related Resources
- RAG for private company data
- OWASP on vector and embedding weaknesses
- OWASP on sensitive information disclosure
- Azure AI Search security filters
- OAIC guidance on AI products
- OAIC on APP 11 and security
Common Questions About AI Knowledge Base Search
1. Can I Rely on the Prompt to Keep Restricted Documents Hidden?
No. OWASP notes that restrictions in a system prompt may not always be honoured, so apply permissions in the retrieval query.
2. How Quickly Should a Permission Change Reach the Search?
Set a revocation target with the data owner, for example 15 minutes, and test it. Membership changes apply at once when groups are resolved at query time, while a document's own permission changes depend on how often the index syncs.
3. What Should Happen When Someone Deletes a Source Document?
Delete every passage and vector carrying its source ID, then confirm with a count against live documents. Where it held personal information, APP 11 expects reasonable steps to destroy or de-identify it once it is no longer needed.
4. Does the Privacy Act Apply to an Internal Knowledge Base?
It can. The OAIC says privacy obligations apply to personal information put into an AI system. Check whether your organisation is covered by the Act, and keep personal information out of the first release.
Write the Permission Tests Before the Search
AI knowledge base search earns trust when a test proves that a restricted document cannot appear in any answer, citation or log. Write the cross-group probes and the no-answer questions first, then build the filtered retrieval to pass them, and widen to a second group only after the first has held its pass marks.


