AI Advanced · 15% practice allocation

AI Advanced: AI Safety & Governance Practice Questions

5 free sample questions from the AI Safety & Governance domain, with answers and explanations. The full AI Advanced bank has 794 questions across 5 domains. Questions follow the AI Advanced course content.

1.

An adversary compromises a third-party data provider whose web content is regularly scraped and included in an LLM's retrieval-augmented generation (RAG) corpus. The attacker embeds invisible instructions in several web pages — instructions that, when retrieved and included in the model's context, cause it to exfiltrate user queries to an external URL via markdown image rendering. Which TWO statements BEST characterize this attack and an effective mitigation? (Select TWO)

  • A. Using a larger context window would reduce the model's susceptibility to injected instructions by diluting their influence
  • B. Sanitizing and escaping retrieved documents before inserting them into the prompt context mitigates the injection vector✓ Correct
  • C. This is a training data poisoning attack, because the attacker modified content that will be ingested by the model
  • D. Enforcing a strict Content Security Policy (CSP) on the client rendering the markdown is sufficient to fully prevent data exfiltration in this scenario
  • E. Disabling the model's internet access entirely is the only viable mitigation for RAG-based injection attacks
  • F. This is an indirect prompt injection attack, because the malicious instructions enter the model's context through retrieved external content rather than directly from the user✓ Correct
Explanation

Correct: This is a textbook indirect prompt injection — the attacker does not interact with the model directly; instead, they poison external content that the application retrieves and inserts into the prompt, causing the model to follow attacker-controlled instructions. Sanitizing and escaping retrieved documents (e.g., stripping HTML, removing instruction-like patterns, applying an input filter before context insertion) is the most direct mitigation at the retrieval/ingestion layer. | Calling this training data poisoning is incorrect: the attack occurs at inference time via the RAG pipeline, not during the model's training or fine-tuning phase. Training data poisoning requires the attacker to influence the dataset used to update model weights. | Disabling internet access would eliminate one retrieval source but is not the only viable mitigation and is often impractical; RAG systems can also pull from internal document stores that may be compromised. Sanitization is a more targeted and practical control. | A CSP on the client helps prevent rendered markdown from loading external resources in a browser, which is a valid defense-in-depth layer, but it does not address the injection vector itself — the model may still process and act on the instructions in other ways (e.g., API calls, tool use), making it insufficient as a standalone control. | A larger context window has no security properties; the model does not inherently deprioritize or 'dilute' injected instructions based on context length.

2.

An AI governance team is reviewing a newly trained content moderation model before production deployment. They want to document the model's intended use, known limitations, training data demographics, and fairness evaluations. Which artifact should they produce?

  • A. A SBOM (Software Bill of Materials)
  • B. A threat model report
  • C. A model card✓ Correct
  • D. A system design document
Explanation

A model card is the industry-standard artifact for documenting a model's intended use cases, out-of-scope uses, training data characteristics, evaluation results, fairness considerations, and known limitations. It promotes transparency and responsible deployment. A threat model report documents security risks and attack surfaces, not model behavior. A system design document covers architectural decisions, not model-specific behavioral properties. An SBOM inventories software components and dependencies, not model characteristics.

3.

A machine learning engineer is processing a dataset of customer support chat logs before fine-tuning an LLM. They want to ensure no PII reaches the training pipeline. Which combination of techniques provides the MOST robust PII protection at this stage?

  • A. Hashing all alphanumeric tokens before ingestion
  • B. Regex-only pattern matching for emails and phone numbers
  • C. Named Entity Recognition (NER) to identify PII entities, followed by deterministic redaction
  • D. NER combined with regex patterns and a secondary human review step for edge cases✓ Correct
  • E. Encrypting the dataset with AES-256 and restricting access to the training cluster
Explanation

The most robust approach combines NER (which catches contextually identified PII like names and addresses), regex patterns (which reliably catch structured PII like emails, SSNs, and phone numbers), and human review for edge cases that automated methods miss. Regex-only matching misses unstructured PII like names. NER alone without regex misses highly structured PII that lacks contextual signals. Hashing tokens destroys model utility without reliably targeting only PII. Encryption protects data at rest but does not remove PII from the dataset — the model would still train on PII.

4.

An ML platform team wants to enforce structured JSON output from an LLM used in an automated data extraction pipeline. The extracted JSON is deserialized and inserted into a database. Which TWO controls MOST effectively reduce risk in this pipeline? (Select TWO)

  • A. Implement parameterized database inserts rather than string interpolation when writing extracted fields to the database✓ Correct
  • B. Use a lower temperature setting to make the model more likely to follow JSON formatting instructions
  • C. Instruct the LLM in the system prompt to always produce valid JSON
  • D. Cache the first valid LLM response and reuse it for identical queries to avoid re-parsing
  • E. Validate LLM output against a strict JSON schema before deserialization, rejecting non-conformant responses✓ Correct
Explanation

Schema validation before deserialization ensures that only well-formed, expected JSON structures are processed, preventing malformed or injection-laden outputs from reaching the database. Parameterized database inserts prevent SQL injection by separating data from query logic, which is critical when LLM-extracted values are written to a database. Lower temperature increases formatting consistency but does not guarantee valid JSON or prevent injection payloads. Instructing the model in the system prompt to produce JSON is a best-effort measure that is not a security control—models can still deviate. Caching responses does not address structural or injection risks and would return stale data for repeated queries.

5.

Your organization must comply with GDPR and uses an external LLM API provider based in the United States. A data protection officer raises concerns about sending European customer data to the API. Which TWO actions BEST address these GDPR data residency and privacy concerns? (Select TWO)

  • A. Encrypt the prompts client-side so the provider cannot read them
  • B. Opt out of the provider's model training using available opt-out mechanisms
  • C. Sign a Data Processing Agreement (DPA) with the LLM provider that includes Standard Contractual Clauses (SCCs)✓ Correct
  • D. Anonymize or pseudonymize personal data before including it in prompts sent to the provider✓ Correct
  • E. Use a self-hosted or EU-region-deployed model so data does not leave the EU
Explanation

A DPA with SCCs is the legally recognized mechanism for transferring personal data outside the EEA under GDPR, ensuring the provider is contractually bound to GDPR-equivalent protections. Anonymizing or pseudonymizing personal data before sending it reduces or eliminates the GDPR obligation by removing or obscuring personal identifiers. Hosting the model in the EU is a valid alternative architecture but is not always feasible and was not listed as a primary ask. Client-side encryption does not fully address GDPR because the provider still processes the ciphertext and holds decryption keys in most API architectures. Opting out of model training prevents data from being used for future training but does not address the data transfer compliance requirement itself.

Test yourself across every AI Advanced domain

The free AI Advanced practice test mixes about 20 questions weighted like the exam. The full 794-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

AI Safety & Governance study guide (AI Advanced) →

Other AI Advanced domains

← All AI Advanced study resources