- Similarity ranks evidence; authorization determines which evidence is eligible.
- Apply permissions before evidence enters prompts, summaries or answer caches.
- Treat revocation as an update across every derived representation.
The paragraph is an excellent match.
The employee is not allowed to read it.
Relevance made the leak easier to find.
Hypothetical scenario. Act 3, the bad week. A Northwind support employee asks about executive severance. The assistant paraphrases a confidential HR policy from a shared vector index. The search engine found relevant text, but the employee’s support role never entitled them to see it.
Similarity, eligibility and disclosure are separate operations
Vector search compares numerical representations of a query and stored text. An approximate nearest-neighbor index speeds the search for close vectors without exhaustively comparing every stored item. The output is a ranked candidate set. Closeness describes a retrieval relationship; it carries no inherent statement about who is permitted to read the source.
Access control evaluates an authenticated principal against a resource and an action. A principal can be a person or a service acting within a person’s delegated scope. For Northwind, a support employee and an HR administrator need different document eligibility even when they submit identical questions. The permission decision must use trusted identity and policy data.
A RAG answer is a disclosure derived from its evidence. Quoting, paraphrasing or summarizing confidential text still transfers information from that text. Removing a document title from the final answer does not undo the transfer. The retrieval service needs to enforce eligibility before the evidence reaches a model or another component outside the permitted scope.
Put the permission decision on the query path
Each searchable chunk needs a connection to its source permissions. A document identifier alone is insufficient if the permission state cannot be resolved when answering. Choose whether to copy access metadata into the index or consult an authoritative policy service, then define the staleness that arrangement permits. An unsupported or missing permission record should produce a denied result.
Microsoft’s security-filter pattern describes filtering search documents using identity-related fields. The filter must be constructed by trusted application logic from authenticated context. Accepting a model-generated group identifier as the caller’s authority would let a retrieved instruction or a mistaken argument determine which documents become visible.
Northwind’s support service should also distinguish its own broad service credentials from the employee’s permitted view. A backend credential capable of indexing every document is not permission to reveal every document to every caller. Apply the employee’s scope when retrieving and recheck any sensitive source fetched after the initial search.
Filtering after top-k can starve the answer
Hypothetical worked example: the search returns 10 candidates and 4 are ineligible. Post-filtering removes those 4, leaving 10 − 4 = 6 permitted chunks. If this question requires an evidence budget of 8 chunks, the result is short by 8 − 6 = 2. The filtering prevented disclosure, but the remaining list does not meet the desired retrieval budget.
With pre-filtering, the candidate search operates within the eligible set. If at least 8 suitable eligible chunks are available and the configured search retrieves them, it can return the desired 8. That is not a guarantee that an approximate algorithm always finds the ideal neighbors. Permission eligibility, requested result count and retrieval recall remain different properties.
Microsoft’s vector-filter documentation explains pre-filter and post-filter modes and their effects on retrieval. Northwind should evaluate restrictive permission slices explicitly. An index that works well for an administrator can perform poorly for a support role whose eligible documents form a small fraction of the overall corpus.
Carry source scope into derived artifacts
A summary built from several sources needs a policy for their combined disclosure scope. Simply assigning the most permissive source’s access list can expose the more restricted material. For a single combined artifact, access should be limited to people permitted to receive all included content, or the content should be separated into independently controlled pieces.
Embeddings also deserve controlled storage and access. They are derived from source content and support locating sensitive passages. Treating them as harmless because they look like numbers ignores their role in the retrieval system. OWASP’s Vector and Embedding Weaknesses entry identifies security risks around vector-based RAG systems, including unauthorized access and information exposure.
The same reasoning applies to prompt logs, trace attachments, exports and reviewer screenshots. Once a passage moves into another artifact, the original document’s access-control list is no longer the only gate. Northwind needs an inventory of where evidence is copied and who can read those destinations. Otherwise the search endpoint can be correct while a debugging interface leaks the same text.
An answer cache needs more than the question
Two employees can ask the same question under different permission sets. A question-only answer cache can serve an HR administrator’s answer to a support employee without running retrieval again. Northwind’s cache key needs the normalized question, the evidence revision identity and the applicable permission scope or policy version. Equivalent scopes can share a result only under a deliberately defined rule.
A cached answer also needs validation against current access. If a person loses HR membership, a previously valid key must no longer authorize delivery. A permission-set identifier that never changes when membership changes is not enough. Bind the lookup to current authenticated eligibility and invalidate affected answers when their evidence or policy basis changes.
OWASP’s Sensitive Information Disclosure entry treats exposure of private information as an application risk. The relevant lesson for caching is that an already generated answer remains sensitive data. Generation does not wash away provenance, and a low-latency response path still needs the same disclosure contract as the slower path that created it.
Revocation is a propagation problem
Suppose HR revokes a policy immediately after the index refresh. Northwind needs a declared interval in which the index can remain stale, or a current authorization check that closes that interval. Identify the required behavior before choosing asynchronous propagation. “Eventually updated” is an operational statement, not an adequate answer to how long unauthorized disclosure is allowed.
A revocation event should reach chunks, summaries, cached answers and any durable assistant notes derived from the source. Keep source-to-derived relationships so the affected artifacts can be located. A full purge can be an acceptable simple strategy for a small corpus; targeted invalidation becomes attractive when rebuilding everything is expensive. Both require an explicit completion signal and monitoring.
For an in-flight request, decide whether permission is checked only at retrieval or again before response delivery. Rechecking can prevent a response from being delivered after a relevant revocation becomes visible. It also adds a policy-service dependency. That trade-off should follow the confidentiality requirement rather than a blanket rule that every service must use the same consistency model.
In the wild: security guidance names this boundary
OWASP’s 2025 guidance separates Sensitive Information Disclosure from Vector and Embedding Weaknesses. The entries describe exposure risks and controls; they are not evidence that Northwind experienced a real breach. Together with Microsoft’s documented security-filter mechanism, they show why similarity retrieval needs an explicit authorization design rather than a prompt asking the model to respect confidentiality.
OWASP’s prompt-injection guidance also recommends least privilege. That matters when the retrieved policy itself contains instructions. Even a permitted document is evidence to interpret, not a source of new access rights. The application should prevent the model from broadening the scope of subsequent searches because a passage tells it to impersonate an administrator.
Test two people asking the same question
Build paired tests for a permitted and an unpermitted identity. Check the candidates, final prompt and cached response, not just the user-visible citation. Then revoke access and repeat the request through both warm and cold cache paths. A successful test must establish that the forbidden evidence never reaches the unpermitted response path.
Common misconceptions include treating a high similarity score as a permission check, assuming a hidden citation prevents a leak, and trusting a service account’s broad credentials as the caller’s scope. Each confuses relevance or infrastructure access with authorization. A well-written refusal after private text has entered an uncontrolled log is also too late to protect that copy.
Limits: metadata filtering does not by itself solve stale memberships, misclassified sources, inference from permitted information or approximate-search quality. Separate indexes can simplify some isolation requirements while adding synchronization work. Northwind’s immediate rule is narrower and enforceable: select evidence within authenticated scope, preserve that scope in derived data, and make revocation observable across the complete answer path.
Check yourself: vector decisions
Ten candidates include four forbidden chunks. How many remain after filtering?
Six. A desired budget of eight is short by two; filtering a fixed top-k list does not refill it automatically.
An HR answer omits the confidential document’s title. Can support staff receive it?
Not on that basis. The paraphrased contents still disclose the restricted source and require the appropriate permission.
Membership was revoked but an answer cache is warm. What must the cache path do?
Validate current scope and invalidate or reject the old evidence/policy combination. A question-only key bypasses the retrieval authorization check.
Next read: Prompt Injection Is an Authorization Bug: How Untrusted Text Steers Tool-Calling Agents.