Home / GenAI Engineer practice test / Governance

Free · 7 questions with explanations

Governance: Databricks Generative AI Engineer Associate Practice Questions

Exam-style questions on Governance. Pick your answer, then open the explanation to see why it's right — and why the other options are wrong.

1 Governance

An audit of a RAG application's knowledge base reveals that approximately 8% of ingested online forum posts contain toxic content (hate speech, slurs, violent language). This content occasionally surfaces in the assistant's responses, causing user complaints and brand risk. The team needs a scalable mitigation strategy for the data source. Which approach is MOST effective?

  1. AAdd a disclaimer banner to the application UI stating that responses may reflect content from user-generated sources and are not reviewed for appropriateness
  2. BInstruct the LLM via system prompt to 'ignore toxic or offensive content' in retrieved chunks and respond only about constructive topics
  3. CIncrease the retrieval threshold score to return only the highest-similarity chunks, assuming toxic content will score lower than benign content for most queries
  4. DImplement a toxicity scoring step in the data ingestion pipeline using a content classification model (such as a Detoxify or Perspective API-based classifier) that evaluates each document chunk at ingest time and filters out or quarantines chunks exceeding a defined toxicity threshold before they are written to the Delta table and indexed in Vector Search
Show answer & explanation

Correct answer: D

WHY D is correct: Fixing problems at the data source — during ingestion, before the knowledge base is built — is the most effective and durable mitigation. A toxicity classifier applied per-chunk at ingest time removes problematic content from the Delta table and Vector Search index permanently. Toxic chunks never enter the knowledge base and cannot be retrieved, regardless of the query. This upstream fix is more reliable than any downstream LLM-level interventions. WHY NOT A: A UI disclaimer acknowledges the problem but does nothing to prevent toxic content from appearing in responses. It shifts liability rather than removing the risk, and user-facing disclaimers do not satisfy enterprise safety requirements. WHY NOT B: System prompt instructions are the weakest form of guardrail. The LLM may still reproduce toxic phrasing when it appears in retrieved context, especially for closely relevant queries. Instructions are not reliably followed when the context window contains strongly contradicting content. WHY NOT C: Retrieval similarity scores measure semantic relevance to the user query, not content quality or toxicity. A toxic post that is topically relevant to the user's question will score high, not low. Raising the threshold only reduces result count — it does not correlate with toxicity reduction.

2 Governance

A deployed RAG application generates customer-facing responses that occasionally include full credit card numbers from the underlying document corpus, even though the source documents were supposed to be sanitized. The team cannot immediately re-sanitize the entire document corpus. Which guardrail technique specifically addresses PII leakage in the model's OUTPUT?

  1. AReduce the retriever's top-k parameter from 10 to 3 to limit the number of source chunks that might contain credit card numbers
  2. BIncrease the LLM's max_tokens parameter to allow it to paraphrase around any numbers it generates
  3. CRe-run the Vector Search index sync to force Databricks to re-embed all source documents with a newer embedding model
  4. DAdd a post-generation output scanner that applies regex patterns matching credit card number formats (e.g., \b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b) and an optional ML-based PII detection model to replace any detected credit card numbers with [REDACTED] before the response is returned to the user
Show answer & explanation

Correct answer: D

WHY D 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 B: 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.

3 Governance

A public-facing legal research assistant must prevent users from eliciting responses about illegal activities, hate speech, or self-harm — regardless of how the request is phrased or obfuscated. The team evaluates several input guardrail approaches. Which architecture provides the MOST comprehensive coverage against malicious content across diverse harm categories?

  1. ADeploy a multi-category safety classification model (such as Meta Llama Guard or a fine-tuned safety classifier) that evaluates each user message against a structured taxonomy of harm categories (e.g., illegal activity, hate speech, self-harm, violence) and returns a per-category safety verdict, blocking requests classified as unsafe before they reach the primary LLM
  2. BMaintain a manually curated blocklist of 500 prohibited words and phrases and reject any message containing at least one blocklisted term
  3. CAdd the instruction 'Never discuss illegal activities, hate speech, or self-harm' to the system prompt and rely on the LLM to self-enforce this constraint
  4. DLog all user inputs to an audit table and schedule a daily batch job to review flagged queries using keyword matching, with offending users blocked the following day
Show answer & explanation

Correct answer: A

WHY A is correct: A multi-category safety classifier like Llama Guard is purpose-built for this task. It evaluates the semantic meaning of the input across a comprehensive, structured harm taxonomy, not just keyword presence. It handles obfuscation (e.g., 'how does one hypothetically build a weapon?') that keyword matching misses, provides per-category verdicts for auditability, and enforces safety before the primary LLM is invoked. WHY NOT B: A fixed keyword blocklist is easily circumvented by paraphrasing, using synonyms, inserting spaces, or using homoglyphs. It also generates high false positives (e.g., blocking 'gun control policy research' for containing 'gun'). Keyword matching cannot understand semantic context. WHY NOT C: Adding a system prompt instruction is the weakest guardrail available — it relies entirely on the primary LLM's instruction-following, which can be bypassed by creative prompt formulations. Academic research proves that system-prompt-only safety constraints are not sufficient for adversarial resistance in public applications. WHY NOT D: A daily batch review is a retrospective audit mechanism, not a real-time guardrail. Harmful content is delivered to users and processed by the LLM for up to 24 hours before detection. This approach does not prevent harm — it only detects it after the fact.

4 Governance

A legal services firm's RAG knowledge base includes regulatory documents, some of which are superseded versions no longer valid under current law. Responses citing outdated regulations create serious liability risk. The existing pipeline ingests all documents from a shared Drive folder without date validation. Which mitigation strategy BEST addresses this structural problem in the data source?

  1. AEnrich each document with effective_date and expiration_date metadata at ingestion time; implement a pre-indexing filter that excludes documents past their expiration_date from the Delta table and Vector Search index, and schedule a recurring pipeline to re-evaluate and remove newly expired documents as regulations are updated
  2. BAdd a system prompt instruction: 'Note that some retrieved information may be outdated. Always recommend users verify with current regulations' so the LLM qualifies all responses
  3. CRetrain the embedding model specifically on current regulations so outdated documents receive lower cosine similarity scores against recent queries
  4. DIncrease the number of retrieved chunks to 15 so that current documents statistically outnumber outdated ones in the context window
Show answer & explanation

Correct answer: A

WHY A is correct: Metadata-driven lifecycle management at the data source is the correct architectural response to stale regulatory content. Tagging documents with expiration dates allows the ingestion pipeline to systematically exclude expired regulations before they are indexed — they can never be retrieved and cannot appear in responses. A scheduled refresh pipeline maintains this invariant as new expirations occur. This is a durable, programmatic fix to a structural data quality problem. WHY NOT B: A system prompt disclaimer reduces the severity of liability but does not prevent outdated regulations from being cited in responses. Legal services firms require accuracy, not hedging language. A disclaimer does not remove the business or legal risk of incorrect regulatory guidance. WHY NOT C: Embedding models learn semantic similarity during training — they cannot distinguish 'current' from 'superseded' regulations based on legal validity. A regulation replaced in 2023 will still be semantically similar to current queries about the same topic. Re-training on current regulations would not reliably deprioritize superseded versions. WHY NOT D: Retrieving more chunks statistically reduces but does not eliminate the probability that an outdated document is included. If the outdated regulation is highly relevant to the query, it will rank highly regardless of how many total chunks are retrieved. Dilution is not a reliable fix when the problematic content is topically relevant.

5 Governance

A startup is assembling a knowledge base for a commercial RAG-powered research assistant that will be sold as a SaaS product. Two candidate datasets are available: Dataset A is a curated scientific article corpus licensed under CC BY-NC 4.0. Dataset B is an equivalent corpus licensed under CDLA-Permissive-2.0. The legal team must choose one. Which recommendation is legally correct?

  1. AUse Dataset A for embedding-only purposes since NC restrictions apply only to full-text distribution, not vector representations
  2. BUse Dataset A because the 'Attribution' (BY) clause in Creative Commons licenses supersedes the Non-Commercial restriction in commercial SaaS products
  3. CUse either dataset because Creative Commons licenses are advisory, not legally binding, for AI/ML training and RAG applications
  4. DUse Dataset B (CDLA-Permissive-2.0) because it explicitly permits commercial use in AI/ML pipelines without restrictions; Dataset A's CC BY-NC 4.0 Non-Commercial clause prohibits use in a commercial SaaS product regardless of whether the dataset content is directly distributed or used only for retrieval
Show answer & explanation

Correct answer: D

WHY D is correct: CC BY-NC 4.0's Non-Commercial clause prohibits using the licensed material 'primarily for commercial advantage or monetary compensation.' Using a dataset as a knowledge source in a commercial SaaS RAG product constitutes commercial use — the NC restriction applies. CDLA-Permissive-2.0 was specifically designed for data in AI/ML pipelines and permits commercial use, making Dataset B the only legally safe choice. WHY NOT A: The argument that NC restrictions 'don't apply to vector representations' is legally untested and risky. Generating embeddings from NC-licensed text is a form of processing that derives commercial value from the licensed work. Most legal interpretations consider this commercial use under CC BY-NC. WHY NOT B: In Creative Commons licensing, the BY (Attribution) clause requires credit to the creator — it does not modify or override the NC restriction. Attribution and Non-Commercial are independent licensing conditions; satisfying one does not waive the other. WHY NOT C: Creative Commons licenses are legally binding copyright licenses, enforceable in court. They are not advisory guidelines. Using NC-licensed data commercially without authorization exposes the company to copyright infringement liability.

6 Governance

A financial services company processes customer loan inquiries through a RAG-based assistant. Regulatory policy prohibits customer PII (full names, Social Security Numbers, account numbers) from ever being transmitted to the external LLM API. The data pipeline ingests raw customer messages. Which input masking technique BEST enforces this requirement before text is sent to the model?

  1. AApply a PII detection step in the pre-processing pipeline using a named-entity recognition model or regex patterns to identify and replace sensitive entities (NAME, SSN, ACCOUNT_NUMBER) with neutral placeholder tokens (e.g., [NAME], [SSN]) before the text is passed to the LLM, ensuring PII never reaches the model's context window
  2. BFine-tune the LLM on PII-redacted transcripts so the model learns to suppress PII from its own outputs
  3. CEncrypt the entire input using AES-256 before sending to the LLM endpoint and decrypt the response on return
  4. DConfigure the Vector Search retriever to exclude all document chunks containing numeric sequences longer than six digits
Show answer & explanation

Correct answer: A

WHY A is correct: Pre-processing masking is the only approach that prevents PII from entering the LLM's context window. An NER model or regex pipeline identifies specific entity types and replaces them with typed placeholders before the API call. The LLM processes placeholder tokens instead of real PII, satisfying the regulatory prohibition on transmission. WHY NOT B: Fine-tuning alters the model's output tendencies but does not prevent PII from being transmitted to the model in the input. The PII still crosses the network boundary to the LLM API, violating the transmission prohibition regardless of output behavior. WHY NOT C: AES-256 encryption produces ciphertext that is meaningless to the LLM — the model cannot interpret or reason about encrypted inputs. This approach would produce semantically useless responses. Encryption is used for data-at-rest or in-transit security, not for selective entity masking during LLM inference. WHY NOT D: Filtering by numeric sequence length is a heuristic retrieval filter, not a masking technique. It only affects which document chunks are retrieved from the vector store — it does not mask PII in the live user's input message before it is sent to the LLM.

7 Governance

A team is building a code-generation RAG assistant and wants to include a large corpus of code examples from a popular open-source repository as source documents. The repository uses the GNU General Public License v3 (GPL-3.0). The legal team raises a concern. What is the PRIMARY legal risk of including GPL-licensed code in the RAG knowledge base of a commercial closed-source product?

  1. AGPL-3.0 is a copyleft license that requires any software that incorporates, links to, or distributes GPL-licensed code to itself be released under GPL-3.0 terms. If using GPL code in the RAG knowledge base constitutes incorporation into the commercial product — particularly if the LLM reproduces verbatim GPL code in generated outputs — the company may be required to open-source their proprietary codebase under GPL terms, destroying competitive advantage
  2. BGPL-3.0 prohibits parsing or tokenizing source code files, so building embeddings from GPL code would violate the license's technical restrictions on automated processing
  3. CGPL-3.0 requires all model outputs that reference GPL-licensed examples to be watermarked with the original repository author's name in every response
  4. DGPL-3.0 is a permissive license equivalent to MIT and Apache 2.0, so it imposes no additional restrictions on commercial use beyond simple attribution
Show answer & explanation

Correct answer: A

WHY A is correct: GPL-3.0's copyleft (viral) clause requires that any software that is a 'derivative work' of GPL-licensed code must also be licensed under GPL. The key legal risk for a commercial RAG system is that if the LLM generates responses that reproduce verbatim or substantially similar GPL code excerpts, those outputs may be considered derivative works — potentially triggering the copyleft requirement to release the entire product under GPL. This is an active area of legal debate (Copilot litigation precedents) and represents genuine legal exposure for closed-source commercial products. WHY NOT B: GPL-3.0 does not restrict automated processing, parsing, or tokenizing of source code. The license governs distribution and derivative works, not mechanical processing for indexing or embedding purposes. WHY NOT C: GPL-3.0 does not require watermarking of outputs or attribution in every generated response. Attribution requirements of this type appear in some Creative Commons licenses (BY clause), not in GPL. WHY NOT D: GPL-3.0 is explicitly NOT a permissive license. It is one of the strongest copyleft licenses. MIT and Apache 2.0 are permissive and impose no copyleft obligations. Equating GPL with these licenses represents a fundamental misunderstanding of open-source licensing that could lead to severe legal consequences.

Take the full GenAI Engineer practice test →