/** * OutputGuard (L35) * * Detects dangerous payloads in LLM/tool output *before* it reaches a * downstream sink (browser/DOM, SQL engine, OS shell, markdown renderer, * spreadsheet/CSV importer). This closes OWASP **LLM05:2025 — Improper Output * Handling**, which the existing OutputFilter (PII/secret egress) does not cover. * * > "Treat model output as untrusted input to the next system." * * This is a CONTENT guard — it inspects the text the model produced, not the * user input. It does not understand intent; it flags syntactic payloads that * are dangerous when interpolated unescaped into a downstream interpreter. * * Threat Model (sinks): * - HTML/DOM → stored/reflected XSS (