Design retrieval for an enterprise assistant where documents carry per-user and per-group permissions that change daily. Where can data leak?
Theme reported publicly: Cohere
Answer
Model answer, written in a candidate's voice
In short
- Core: treat retrieval as an authorization decision, not just a search step.
- Pre-filter by caller identity/groups and re-check at answer time; use hard isolation for high-sensitivity tenants.
- Sync ACLs from source systems with versioned snapshots and fail closed on revocation lag.
- List leak paths: shared caches, memory, suggestions/autocomplete, logs, fine-tuning, injected documents.
- Audit which documents fed each answer and test with role-based red teams.
In full
I would make retrieval authorization-aware: before any vector or keyword search, resolve the caller’s user and group memberships, apply metadata pre-filters to only documents the caller may read, and re-check the ACL snapshot at answer time rather than trusting a cached result. For high-sensitivity tenants or data classes, I would not rely on filters alone; I would use hard isolation such as per-tenant indexes or clusters, with separate credentials and no shared embedding store. ACLs should be synced from source systems with incremental updates plus periodic full reconciliation, stored as versioned snapshots, and revocation lag handled by failing closed: if a document’s ACL is stale beyond the freshness threshold, the assistant should deny or mark it unavailable instead of answering from it. The main leak paths are shared response or semantic caches that return another user’s answer, conversation memory that carries restricted context across sessions, suggestions/autocomplete that surface titles or snippets, logs and traces that store prompts, retrieved text, or embeddings, fine-tuning or evaluation sets built from restricted documents, and injected documents that try to instruct the assistant to reveal or exfiltrate data. I would log the caller, groups, query, ACL snapshot version, documents used, cache hits, and final answer for audit, then run role-based red-team tests as low-privilege users, removed group members, cross-tenant users, stale-ACL cases, cache-poisoning attempts, and prompt-injection documents.
What a strong answer covers
- Enforces permissions at retrieval time with metadata pre-filters on the caller’s groups; hard isolation (per-tenant indexes) where required
- Syncs ACLs from source systems and handles revocation lag
- Lists leak paths: shared response/semantic caches, conversation memory, suggestions/autocomplete, logs, fine-tuning on restricted data, injected documents asking for data
- Audit log of which documents fed each answer; role-based red-team tests
Common mistakes
- Filtering only after generation
- a response cache shared across users