A security architect is implementing the OWASP Top 10 for LLM Applications controls for an enterprise AI application. The application is at risk of 'LLM02: Insecure Output Handling' which could lead to XSS or SQL injection via AI-generated content. Which control addresses this risk?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — b is correct because LLM02: Insecure Output Handling specifically addresses the risk that AI-generated output containing code, markup, or query fragments is passed directly to interpreters (web browsers rendering HTML/JavaScript, databases executing SQL) without proper encoding or sanitization. The control is to treat AI outputs as untrusted input and apply appropriate encoding/sanitization before rendering or executing.
Full explanation below image
Full Explanation
B is correct because LLM02: Insecure Output Handling specifically addresses the risk that AI-generated output containing code, markup, or query fragments is passed directly to interpreters (web browsers rendering HTML/JavaScript, databases executing SQL) without proper encoding or sanitization. The control is to treat AI outputs as untrusted input and apply appropriate encoding/sanitization before rendering or executing. A is incorrect because Azure AI Content Safety filters for harmful content categories (violence, hate speech, etc.) but does not sanitize XSS or SQLi payloads that a model might generate when following legitimate instructions. C is incorrect because Azure OpenAI content filtering also targets harmful content categories, not code injection payloads in model outputs. D is incorrect because input validation addresses LLM01 (Prompt Injection), not LLM02 which is specifically about unsafe handling of the model's output.