A company deploys an LLM application with input and output guardrail classifiers. What is the function of an INPUT guardrail in this architecture?
- A.Caching previous responses to reduce API costs for repeated inputs; API keys for inference endpoints are scoped read-only by every provider, meaning a leaked key cannot alter the served model
- B.Checking model responses for harmful content before delivering them to users, since safetensors files can embed executable code
- C.Validating the model's API key before each request
- D.Screening user messages for prompt injection, policy violations, PII, and other unsafe content before they are sent to the LLM
Why D is correct
Input guardrails (pre-processing classifiers) sit between the user interface and the LLM: they analyze incoming messages for injection patterns, jailbreak attempts, prohibited content, PII, and off-topic queries before the message reaches the model. Output guardrails (post-processing) check the model's response before delivery to users. API key validation is authentication, not a guardrail. Caching is a performance optimization.
Know someone studying for AI Security Fundamentals? Send them this one.