A publicly accessible generative AI application, designed as a legal research tool, needs to effectively block user prompts that solicit information concerning unlawful acts, discriminatory language, or self-inflicted harm, even if those requests are artfully disguised or indirectly phrased. The development team is assessing various strategies for input moderation. Which design pattern offers the SUPERIOR defense against harmful user-generated content spanning multiple types of detrimental subjects?
Answer & explanation
Correct answer: D
WHY D 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 A: 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.