AI knowledge systems

Where should AI check access?

A secure answer starts with the signed-in person's permissions at retrieval time, not with a promise in the prompt.

Published
Reading time
7 min read
Author
Umer Farooq

Short answer

What matters most

Authorize the signed-in user before retrieval and filter every candidate passage using permissions synchronized from its source. Keep that identity and filter on the trusted server side, then test the complete path through snippets, citations, caches, and logs. If identity, permission freshness, or filtering is uncertain, return no protected content and route the person to an approved search or human process. A prompt instruction alone is not an access control.

Put the check before the model sees a passage

A manager asks an internal assistant about a customer contract. The manager can read the contract, but a colleague in another team cannot. If the assistant searches across both people's material and merely tells the model not to reveal restricted facts, the sensitive passage has already crossed the access boundary into the model's context.

The safer design ties each request to the authenticated person, applies their current user and group permissions during retrieval, and sends only authorized passages onward. The diagram shows the boundary: identity and permissions constrain retrieval before generation. If the system cannot establish that chain, it should fail closed for protected content. This is a design recommendation, not a claim that one vendor implements every step automatically.

A signed-in user's verified identity and synchronized document permissions filter retrieval before allowed passages reach the AI model; uncertain identity or stale permissions stop the request.A signed-in user's verified identity and synchronized document permissions filter retrieval before allowed passages reach the AI model; uncertain identity or stale permissions stop the request.
The authorization decision belongs in retrieval, before any protected passage enters the model context.

Treat identity, retrieval, and updates as one boundary

A search index stores a searchable copy of content and, where supported, permission metadata. At query time, the system must connect the authenticated caller to that metadata and return only passages the caller may read. Every chunk must retain the access rule for its source document; separating text from its permissions can make a technically relevant result an unauthorized one.

NIST's zero-trust guidance says not to grant implicit trust based on network location or ownership. Applied here, being inside a company network or using a shared service account should not stand in for the employee's authorization. The assistant needs a trustworthy end-user identity and an explicit authorization decision for the resource being requested.

Permission-aware retrieval is a documented capability

Microsoft documents query-time document-level access control using synchronized permission metadata and the caller's identity. The supported approach depends on the source and identity model; some patterns and API surfaces have different availability. This demonstrates a native option, not a universal feature guarantee.

Microsoft Learn: document-level access control (checked November 26, 2026)

Missing caller context can expose every indexed document

Amazon Kendra's documentation says that if user and group context is not included in a query, it returns all documents. Its token-based access feature also varies by index type. The practical lesson is to test missing identity and unsupported configurations as denial cases, not assume the service will infer the right user.

AWS: Filtering on user context (checked November 26, 2026)

A permission change is only real after it reaches retrieval

Access rules change when people join or leave groups, folders move, or a document is reclassified. If a search index or cache still holds the previous permission state, an old grant may continue to affect results. Define the synchronization path and the acceptable delay for each source. Do not promise immediate revocation unless the system actually enforces it.

The enforcement boundary continues after search. Keep unauthorized passages out of generated answers, citations, previews, conversation history, shared caches, and routine logs. OWASP's 2026 guidance on vector and embedding weaknesses identifies unauthorized access and cross-context leakage as risks in retrieval systems. Checking only the final prose can miss a leak in a source title or citation.

Permission metadata can lag its source

Microsoft says query-time enforcement compares the caller against permission metadata already synchronized to the index; changes in the source are reflected after the source-specific update or refresh. That makes permission freshness an operational property to measure and monitor.

Microsoft Learn: document-level access control (checked November 26, 2026)

A managed feature can still have rollout limits

Google documents Agent Search data-source access control as a Preview feature and says it must be enabled when creating a data store. Confirm its current stage, source support, identity setup, and migration implications before treating it as a production fit.

Google Cloud: Agent Search data-source access control (checked November 26, 2026)

Apply the boundary to a concrete request

Hypothetical example: a finance coordinator asks, “What renewal date applies to the North account?” The index contains a contract visible to Finance and a sales note visible only to Sales. The assistant should retrieve the contract for the coordinator only if the current identity and indexed permission allow it. If permission synchronization is late, identity lookup fails, or a result lacks a trustworthy access label, it should withhold that material and direct the person to the approved source or an owner.

Before building custom retrieval, check whether the search product already used by the company can apply source permissions to results. Google documents identity-provider-backed access control for Agent Search, with setup and preview limitations. If a native tool covers the source and policy, use it. Custom work needs a named gap such as an unsupported source, a required identity mapping, or a testable workflow integration.

On a small screen, scroll the table to read every column.

Release decision matrix for an AI knowledge assistant
ConditionRelease decisionEvidence to keep
Native search enforces the needed source permissionsUse it and verify the exact connector and identity path.Allowed and denied test queries for each source.
A source is unsupported or permissions cannot be synchronizedKeep it outside AI retrieval or send requests to an approved human workflow.Source inventory, documented gap, and fallback owner.
Identity or permission data is missing, stale, or ambiguousDeny protected retrieval until the state is restored.Failure tests, freshness target, and alert.
Results are authorized but downstream outputs are shared or loggedReview citations, history, caches, and logs before release.Access-scoped output tests and retention rules.

Use a small release brief

For each connected source, write down: the identity provider, permission owner, indexed fields or native enforcement method, synchronization interval, failure behavior, output locations, and the person who handles denied requests. Test with an allowed employee, a denied employee, a changed group membership, a missing identity, and a source with no permission metadata. Repeat those checks after connector or index changes.

The decision is not whether an AI assistant can search company files. It is whether the existing identity and permission model can safely follow each passage through retrieval and every place the answer is shown or stored. If you cannot demonstrate that path, keep the source out until you can.

When is native AI search enough?How to tell if your company is ready for an AI knowledge assistant

Sources

Direct to Umer

Let's talk about your project.

Tell me what you're trying to solve. I'll reply directly by email.