Home / GenAI Engineer practice test / Governance / Question

Databricks Generative AI Engineer Associate · free practice question

A production Retrieval-Augmented Generation (RAG) system is inadvertently exposing complete credit card numbers from its underlying knowledge base in…

Exam-style question on Governance from the free GenAI Engineer practice test, with the answer and a full explanation below.

Updated November 11, 2026

Governance

A production Retrieval-Augmented Generation (RAG) system is inadvertently exposing complete credit card numbers from its underlying knowledge base in user-facing responses, despite earlier attempts to cleanse the source documents. Since a full re-sanitization of the entire document corpus isn't feasible right now, what specific guardrail method would prevent this PII leakage directly from the model's generated output?

  1. ALower the retriever's top-k from 10 to 3 so that fewer source chunks that might contain card numbers are passed to the LLM
  2. BAdd a post-generation output filter that uses regex to detect card number patterns and redacts them before the response is sent
  3. CTrigger a full re-sync of the Vector Search index so that every source document is re-embedded with an updated embedding model
  4. DRaise the LLM's max_tokens setting so that longer responses let the model paraphrase content instead of repeating the numeric sequences verbatim
Answer & explanation

Correct answer: B

WHY B is correct: Output scanning with regex and/or a PII detection model is the standard post-generation guardrail for preventing sensitive data leakage in LLM responses. It runs on every response before it reaches the user and acts as a safety net independent of whether the source documents or model behavior were properly sanitized. Regex patterns for credit card formats are highly reliable and have near-zero latency overhead.

WHY NOT A: Reducing top-k decreases the chance of retrieving a PII-containing chunk but does not eliminate it. If even one retrieved chunk contains a credit card number, the model may still surface it in the response. This is a probabilistic mitigation, not a guardrail.

WHY NOT D: max_tokens controls response length, not the model's tendency to copy or generate specific content. Increasing it makes no causal connection to PII suppression and would likely generate longer — not safer — responses.

WHY NOT C: Re-syncing the index updates the vector embeddings but does not sanitize the source document content. Credit card numbers in the original Delta table text remain present and can still be retrieved and surfaced.

Take the full GenAI Engineer practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Generative AI Engineer Associate practice test. Take it and get a section-by-section score.

Start the free test →