Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q37HardConcept

How do you implement permission-aware (ACL-aware) retrieval correctly?

30-second answerSay your answer out loud first, then reveal.
The user's SSO token is resolved to identity and groups, which become a filter (chunk ACL intersects user principals) applied inside hybrid search together with the query, so only permitted chunks reach the LLM; source ACL changes are synced into the index's ACL fields.

Approaches

ApproachHowProsCons
Pre-filter in engine (recommended)ACL fields on chunks; engine filters during searchSecure, correct kNeeds filtered-ANN support; ACL fields must stay synced
Post-filterRetrieve top-N, then check permissions per resultSimple; real-time permission check against sourceMay return fewer than k; wasteful; risk of leaks if buggy
Index per tenant / per groupSeparate indexesStrong isolationExplodes with many groups; good for tenant-level isolation
HybridPre-filter by coarse ACL, then a real-time check for sensitive docsDefence in depthMore complexity

Hard parts

  1. Group explosion and nesting: users belong to hundreds of nested groups. Flatten them at sync time, cache them per user, and handle large group lists in filters.
  2. ACL change propagation: when someone loses access, results must stop showing within an SLA. Treat revocations as high priority.
  3. Inheritance: folder-level permissions inherited by files, plus page-level restrictions (Confluence).
  4. Derived data leakage: caches, summaries, and contextual enrichment generated from restricted docs must carry the same ACL. A semantic answer cache must be keyed by permission scope.
  5. Testing: automated tests with synthetic users verifying that they cannot retrieve restricted content, including through paraphrased queries.
Interview line. "Security filtering happens before the model sees anything. The LLM is not an access-control layer."

You understood something today that you didn't yesterday.