Missing tenant metadata
Detect: New records appear outside expected partitions.
Recover: Reject or quarantine records lacking mandatory ownership fields.
Restrict the searchable evidence set using trusted metadata before semantic ranking, while validating the store’s actual filtering behavior.
Metadata pre-filtering narrows candidate documents by tenant, access rights, language, time, or business scope before or within nearest-neighbor search. It improves relevance and can enforce an important retrieval boundary, but its security depends on the provenance and enforcement of the filter. A model-generated tenant identifier is not an authorization decision.
Vector stores differ in how filtering interacts with approximate indexes. Some apply scalar filters first; others combine filtering with iterative search or specialized indexes. Very selective predicates can affect latency and recall. Architects must evaluate their chosen implementation and recheck access when fetching the underlying text.
A prototype adds explicit tenant and document-type metadata and tests retrieval with intentionally similar cross-tenant content.
Production derives filters from authenticated identity, validates metadata at ingestion, and tests permission revocation.
Enterprise scale requires group-expansion strategies, high-cardinality filter indexes, selective-query benchmarks, and consistent authorization across search, cache, and source fetch.
Obtains trusted tenant and group membership from the application security context.
Builds an allowed metadata predicate independent of model suggestions.
Stores validated ownership, classification, validity, and document-version fields.
Combines the trusted predicate with vector retrieval.
Revalidates access before exposing the matched document body.
flowchart TD
I["Authenticated identity"] --> P["Policy compiler"]
U["User search preferences"] --> P
P --> F["Mandatory metadata predicate"]
Q["Query embedding"] --> V["Filtered vector search"]
F --> V
V --> A["Source access recheck"]
A --> C["Authorized evidence"]Resolve principal identity and the relevant policy revision.
Construct a mandatory filter and combine optional user preferences without weakening it.
Reject missing ownership fields, unsupported operators, or excessively broad expansions.
Run vector search using the store’s supported filtering mode and bounded candidate parameters.
Authorize the final document fetch against current access state.
Retain policy and source revisions for investigation without logging sensitive document content.
Legal services · Illustrative enterprise scenario, not a reported customer outcome.
A law firm assistant searches documents across many client matters with overlapping terminology.
Semantic similarity alone retrieves highly relevant documents belonging to another client.
Retrieve only evidence allowed for the current lawyer and matter.
A policy compiler resolves matter permissions and passes immutable scope to search and document fetch.
If a document’s access changes after indexing, source fetch denies it and the answer proceeds with remaining authorized evidence or reports insufficient coverage.
Measure denied-fetch events, revocation lag, and selective-filter recall; an empty authorized result is preferable to a plausible unauthorized answer.
| Decision | Benefit | Cost |
|---|---|---|
| Early filtering | Reduces irrelevant or unauthorized candidates. | Selective predicates may stress approximate-search behavior. |
| Access recheck | Catches stale indexed permissions. | Adds source-policy lookup latency. |
| Rich metadata | Supports precise scope and diagnostics. | Increases ingestion validation and index maintenance. |
Detect: New records appear outside expected partitions.
Recover: Reject or quarantine records lacking mandatory ownership fields.
Detect: A removed user still matches cached access filters.
Recover: Expire policy caches and invalidate affected retrieval sessions.
Derive mandatory scope from authenticated context.
Use supported constrained search and measure recall under selective predicates.
Reauthorize final source access and monitor update lag.