Wink Pings

Bank RAG interview question with 10 million documents: if permission filtering is written into the prompt, the interviewer will keep digging

Priyanka Vergadia uses a RAG question about a bank with 50,000 people and 10 million documents to break down permission design: ACLs in the index, filtering by user group at query time, source-system verification before the LLM, and why failing closed matters more than returning an answer.

Priyanka Vergadia posted Day 2 of her “Forward Deployed in 30 Days” series on X. The prompt is to design a search and Q&A system covering 10 million internal documents for a bank with 50,000 employees. The core constraint can be stated in one sentence: users must not see answers generated from documents they are not authorized to open. In the post, she first points out a common mistake: a candidate draws a standard RAG pipeline and, when asked about permissions, adds a line to the system prompt saying to use only documents visible to that user. At that point, the restricted text has already entered the context window, and the model can quote or paraphrase it. What the interviewer wants to hear is where in the request path filtering is enforced, where the access control list comes from, and how you prove there is no leakage.

Her short answer: build permission-aware RAG. Copy each document’s ACL from the source system into the search index as metadata and keep it in sync. At query time, expand the user’s groups from the identity provider and put those groups into the search engine as filters, so documents the user cannot open never become candidates. Before the LLM sees the final small set of documents, verify once more against the source system. Permissions are enforced by code before the prompt is built; they cannot rely on instructions in the prompt.

In a bank setting, there are two kinds of errors: wrong answers and leaked answers. Leakage is worse—it could mean a trader learning about a deal the investment banking team is working on, or a manager reading someone else’s HR file. The design rule is fail closed: when you are not sure whether a user can see a document, exclude it. When the system returns no results, the messages for “the document does not exist” and “the document is locked” must be identical, so the system does not reveal that hidden documents exist. Whether to show a request-access button should be configured by source; it can be enabled for low-risk wikis, and should be off by default for trading floors and HR.

She applies this prompt to the seven-step answer framework from Day 1: clarify, numbers, data, request path, evaluation, failure modes, and launch. In Day 2, the third step—data—carries more weight. Step 1 uses 5 minutes to clarify the users, the task, and the cost of leakage. The users are 50,000 employees, ranging from branch staff to investment banking and compliance; the task is to ask questions in natural language and get short answers with source links. All numbers in the post are exercise assumptions. She recommends that candidates state the priority proactively in the interview: if you must choose between giving no answer and giving an answer generated from a document the user is not authorized to open, choose no answer, and confirm that this is the priority the interviewer wants.

Steps 2 through 7 and a one-page sketch are in the full Substack post. Original links: X post, long-form article: X Article, Substack: full text.

What separates candidates on this question is which layer permissions are placed in. Drawing a RAG pipeline is just the entry ticket. Treating ACLs as metadata, putting filtering into retrieval, and placing source-system verification before the LLM are what make the interviewer continue asking about failure modes and launch.

发布时间: 2026-12-04 03:33