Access Control interview question

AI Safety & SecurityAccess ControlRAGmedium

In this enterprise RAG pipeline, users must never receive content from documents they are not permitted to read. Where should that rule primarily be enforced?

1User question
→
2Query rewriting
→
3Retriever (vector + BM25)
→
4Reranker
→
5LLM generates answer
→
6Answer + citations
  1. AIn the generation step: instruct the model in the system prompt to refuse to reveal content from documents the user may not read, and log every violation.
  2. BIn the retriever: filter on the user's permissions (ACL metadata on every chunk) at query time, so unauthorized chunks are never retrieved or put in the prompt.
  3. CIn the reranker: apply a large score penalty to chunks from restricted documents, so they rank below the permitted chunks and drop out of the top-k sent to the model.
  4. DIn the answer step: scan the final response and its citations, and remove every sentence that cites a restricted document before the user sees the answer.
Show the answer and explanation

Correct answer: B, In the retriever: filter on the user's permissions (ACL metadata on every chunk) at query time, so unauthorized chunks are never retrieved or put in the prompt.

Explanation Access Control

Authorization must be deterministic and enforced before the model sees the data. In RAG that means a permission filter in the retriever: every chunk carries ACL metadata (owner, groups, department, classification), and the vector or keyword query only searches chunks the user is allowed to read.

Why the alternatives fail:

  • System-prompt rules are probabilistic. Prompt injection, jailbreaks or simple model mistakes can bypass them, and the restricted text is already inside the context window.
  • A reranker score penalty only reorders candidates: whenever fewer than k permitted chunks are among them, restricted chunks still fill the top-k. Lowering a score is not access control.
  • Filtering the answer afterwards misses restricted facts that the model states without citing them, and by then the restricted text has already been sent to the model.

Practical details interviewers like:

  • Pre-filtering (filtered ANN search) versus post-filtering: post-filtering top-k can return fewer than k results, or none.
  • Sync permissions from the source systems (SharePoint, Google Drive, Confluence) and re-index when ACLs change.
  • Include the permission scope in cache keys, especially for semantic caches.
  • Apply the same rule to tools in agentic systems: the agent acts with the user's permissions (least privilege), not a super-user service account.

Interview tip: a crisp line is "authorization lives in code and data filters, never in the prompt". Guardrails on the output are defence in depth, not the primary control.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More AI Safety & Security questions

  1. Five banks plan to train a shared fraud model with federated learning: each bank trains on its own transactions and sends only model updates to a coordinating…
  2. An e-commerce company has trained a new jailbreak classifier for its shopping assistant. It scored well on an offline labelled set, but the team worries it…
  3. A bank's research agent answers each analyst question from k = 20 retrieved web chunks and produces 500,000 answers a month. Assume 1% of retrieved chunks…
  4. An open-weight general-purpose AI (GPAI) model was trained with 6 × 10²⁴ FLOP, as its developer documents. A telecom LoRA-fine-tunes it with 2 × 10²⁰ FLOP and…
  5. A retail assistant's release gate is a 2,000-prompt single-turn jailbreak suite plus a classifier that scores each user message on its own. A red-teamer asks…