Permission-aware enterprise retrieval
hard 6 minAn enterprise search answer is derived from several pieces of information that age independently.
Video lesson · Chapter 1 of 4
The payroll answer that remembers a former reader
Theory
Read or listen first. About 2 min.
What it is
An enterprise search answer is derived from several pieces of information that age independently. The text may be current while the reader’s group membership has changed. A passage identifier, a previously valid citation and an embedding are useful for locating evidence. The authority to disclose that evidence comes from an access decision for this principal and resource.
Why it exists
Trace content versions and permission versions through ingestion, retrieval and answer reuse. Apply authorization before exposing passages to the model, and reauthorize when resolving a citation later. Where the system promises immediate revocation, a replica that cannot establish the necessary freshness must consult an authoritative service or withhold protected material. Choose that consistency contract explicitly and measure its availability cost.
Can a former team member reopen a cached answer?
Inside this chapter
Chapter sources- Permission propagation
- A source can revoke access without changing the text. Carry permission updates separately from document ingestion, with stable resource IDs and progress checkpoints. Inherited group membership can also change without any document mutation.
Most connectors are built around document changes, but access can change with no document change at all: someone leaves a group, a folder is unshared, a nested group is edited. Run permission sync as its own pipeline with checkpoints, keyed by stable resource IDs, and measure its lag separately from content lag. Inherited membership is the usual blind spot, since one group change can affect thousands of documents.
Example. Policy text remains at revision 9 while group membership moves to revision 42. A content-only cache key stays identical across the revocation.
Another example. A contractor's access to the
finance-q3drive is removed on Monday. The documents are untouched, so a content-only connector re-indexes nothing, and without a permission stream the contractor keeps seeing those passages in search.Two event streams into the index
A revocation travels through permission sync; the content stream does not change. - Cache dependency tracking
- A generated answer can depend on several sources. Store their identities and versions or invalidate conservatively. An answer synthesized from public and restricted passages can still disclose restricted facts after the original citations disappear.
A generated answer is a derived document: its content can leak any source it was built from. Store the source IDs and versions with each cached answer, and on any content or permission change, invalidate entries that depend on the affected source. When tracking is impractical, cache per user or per permission set, or not at all for restricted content.
Example. Drop an answer derived from documents A and B when B becomes unreadable. Removing the hyperlink alone leaves its salary figure in the prose.
Another example. An internal Q&A cache keys entries by question embedding. A finance answer generated for a manager is served to an analyst asking the same question, revealing budget figures. Keying by permission set as well would have prevented it.
Which cached answers must go when B is revoked?
Cached answer Depends on B readable by user? Action Leave policy summary A keep Salary band explainer A, B no drop or regenerate from A only Payroll calendar B no drop Removing the citation link is not enough: the prose can still contain B's figures. - Online index migration
- Backfill the candidate index from a snapshot, consume intervening mutations, verify progress, then compare recall and access decisions before switching the read alias. Retain a compatible rollback path.
A full rebuild (new embedding model, new chunking) cannot pause the world. Build from a snapshot, then replay the change log from the snapshot point, including deletions and permission changes. Before switching the read alias, confirm the new index is caught up, run recall comparisons on a fixed query set, and run access probes with test users. Keep the old index until the new one has served traffic cleanly.
Example. The snapshot ends at event 800. A deletion arrives at 806. Delay cutover until the new index has consumed 806 and a probe confirms the deleted passage stays absent.
Another example. A re-embedding migration skipped the change replay and went live missing two days of deletions. A probe query for a document deleted under a legal request would have caught it.
Rebuild without losing deletions - 1Snapshot backfillnew index built to event 800
- 2Replay change streamevents 801 onwards
- 3Catch upconsumed event 806, a delete
- 4Probe and comparedeleted passage absent, recall ok
- 5Switch read aliasold index kept for rollback
Cutover waits until the new index has consumed every event up to now.
- Pre-filtering versus post-filtering
- Permissions can be applied inside the vector search (pre-filter on allowed resource IDs or groups) or after it (fetch the top k, then drop what the user cannot read). Post-filtering is simpler but can leave a user with few or no results when most top matches are restricted.
Many vector databases support metadata filters during search, though very selective filters can slow approximate search or reduce its recall. A common compromise is to pre-filter on coarse attributes (tenant, department) and do an authoritative check per passage afterwards, over-fetching to keep enough results.
Example. A junior analyst searches "revenue forecast". The top 10 nearest passages are all board-only. Post-filtering returns nothing; pre-filtering searches only the permitted set and returns the best 10 they can read.
Pre-filter inside the search
- Results are always the best permitted matches
- Restricted text never leaves the index
- Needs ACL metadata indexed with each vector
Post-filter after top k
- Easy to add to an existing index
- Can return too few results for restricted users
- Restricted candidates pass through application code
How it works
Step through the idea, or press Play.
Membership ledger. Access revoked at revision 42
Understand it
Worked example
Can a former team member reopen a cached answer?
- 1
Access revoked at revision 42
Removing the employee from payroll changes membership while the indexed handbook remains byte-identical.
- 2
The old passage still matches
Dense search can still surface the passage identifier while its local metadata lags. The match alone cannot grant disclosure.
- 3
Fresh decision denies payroll
The retrieval layer asks whether the employee may read the resource at the required freshness. The denial excludes the passage before prompt assembly.
- 4
Suppress the derived answer
The cached prose depended on the same payroll source. Invalidate or reauthorize it, and separately check permissions if the user later opens the citation.
Follow the handoffs
Revocation from ledger to cached answer
Summary
The whole topic in one minute.
Text similarity and content revisions establish neither the reader’s identity nor the current entitlement.
Trace content versions and permission versions through ingestion, retrieval and answer reuse. Apply authorization before exposing passages to the model, and reauthorize when resolving a citation later. Where the system promises immediate revocation, a replica that cannot establish the necessary freshness must consult an authoritative service or withhold protected material. Choose that consistency contract explicitly and measure its availability cost.