AI
Azure AI Search: verify document access revocation before restoring a RAG agent
A production runbook for separating identity, indexed permissions, security filters and caches when an agent retrieves a document after access is revoked.
An employee loses access to a sensitive procedure at its source, yet the internal assistant still cites it. Disabling the whole index or telling the model not to answer may contain the visible symptom, but neither proves that every access path is closed.
Consider a fictional agent that queries Azure AI Search through an application service. The service builds a security filter from the user’s identity and groups; documents and access metadata are indexed. The source permission may still exist, a token or group membership may be stale, indexed permissions may be out of date, a filter may be missing, or a result may come from a cache. This runbook applies to that architecture, not to a claimed Naxaya deployment.
Contain the exposure and preserve evidence
Suspend the agent’s access to the affected corpus or remove it from the affected workflow with a server-side control. If the scope is unknown, close search and alternative paths more broadly while investigating. A model instruction, hidden citation or removed button is not an authorization boundary. Preserve investigation logs in a restricted location without copying sensitive content or tokens.
Record the UTC window, pseudonymous user identifier, document and version, revocation time, channel, application version, index and correlated request. Include possible direct Search access, exports, citations and retained conversations. A blank answer on screen does not prove that content was never passed to the model or a tool.
Reconstruct the authorization contract
Map the entire chain: source of authority and permission type, synchronization into the index, identity actually used, filter construction, Search query, retrieved results, context sent to the model and caches. The source owner and security team should confirm the expected entitlement; do not change production group membership merely to simplify a test.
In the Azure AI Search security-filter pattern, security identifiers are strings compared by a filter. Search does not independently establish that the strings supplied by the application are the user’s legitimate groups. The server must establish identity reliably and enforce the filter on every read path. A client must not be able to remove the filter or query the index directly with permissions that bypass it.
Native mechanisms also exist; some are in preview and have different contracts. Check the deployed mode, API and applicable limitations in the document-level access control documentation. Do not apply a custom-filter runbook to native enforcement without examining its synchronization and evaluation rules.
Compare four independent sources of evidence
Use a non-sensitive test document, an authorized user and a revoked user. The names, times and results below are illustrative.
T0 Source: removal confirmed for user-B and applicable groups
T1 Identity: observed claims and groups for user-B, without storing token
T2 Index: document version and synchronized permission metadata
T3 Retrieval: effective filter, application version and returned IDs
T4 Agent: context, cache and answer inspected without sensitive content
Expected: authorized user-A retrieves the test document.
Expected: revoked user-B cannot retrieve it through any path. If the source still grants access through a nested group or another entitlement, fix the source contract first. If the source is correct but the index is stale, inspect synchronization failures and delays, then identify the index version actually queried. If the index is correct but retrieval returns the document, inspect filter construction and every search path, including direct search and agent tools. If Search returns nothing but the agent still cites the document, investigate application caches, conversation context, memory, saved answers and exports.
Timestamps alone do not prove that all permissions propagated. Refreshing a token does not necessarily refresh an index; reindexing does not necessarily clear caches. Agree a maximum revocation delay with the owners and keep access closed until that bound is demonstrated.
Fix the boundary and run a canary
Correct the identified layer in a test scope: permission synchronization, server-enforced filtering, direct-access controls or invalidation of affected caches. Do not log confidential content or raw tokens. Capture the previous configuration and name an owner and rollback procedure before changing anything.
Run the matrix across every exposed path: authorized direct queries, application API, agent tool, a new conversation and an existing conversation. Check cached answers and citations as well. For each path test an authorized user, a revoked user, a missing or invalid identity, and a document with missing permission metadata. Ambiguous cases must fail closed. Confirm that the authorized user retains access and the revoked user receives no document, excerpt or citation from it.
Repeat after session renewal and the relevant propagation delays. Inspect returned IDs before generation, not just the model’s final wording. A refusal can hide a document already supplied as context. Check the effect on other users and availability, then have data and security owners review the evidence.
Decide and roll back
Reopen progressively only when positive and negative tests pass on every path, affected caches and conversations are addressed, and the maximum revocation delay is acceptable and monitored. Record versions, the validation window and remaining limitations.
If any negative test fails or identity or permission freshness remains uncertain, keep the corpus closed and escalate. If the correction harms service, restore the previous configuration only when it is demonstrably safe; otherwise retain the restriction and restore service against an authorized corpus. Rollback cannot retract information already disclosed: assess recipients and follow the incident-response process. Closure requires evidence of denied access, not merely a quiet answer.