An LLM application operating in production handles financial documents submitted by users. The security department has two critical requirements: (1) preventing end-users from circumventing the model's inherent system instructions through specially designed inputs, and (2) ensuring that no credit card numbers are ever present in the model's generated output. Which guardrail architecture effectively satisfies both of these security mandates?
Answer & explanation
Correct answer: A
WHY A is correct: A two-layer guardrail — input scanning for prompt injection and output scanning for PII — correctly addresses both requirements. The input scanner intercepts adversarial attempts to override system instructions before they reach the model. The output scanner applies regex or a PII detection model (e.g., Microsoft Presidio) to redact credit card numbers from the model's response regardless of how they appeared.
WHY NOT C: Token count validation only catches length-based attacks, not semantic injection attempts ('ignore all previous instructions' is very short). max_tokens limits length but does not detect or redact PII content.
WHY NOT B: Relying solely on alignment training is insufficient for production systems. Prompt injection and jailbreaks are documented attack vectors that can bypass alignment. Defense-in-depth is required.
WHY NOT D: A retrieval filter only removes PII from ingested source documents. Credit card numbers could appear in the user's direct query, be generated from model parametric memory, or be inferred by the model — all of which a retrieval filter cannot catch.