Rendering model output safely
Treat model output as untrusted input.
- AIF.02.01Model output is untrusted: XSS and injection via renderingCoreMid-levelBeing written
- AIF.02.02Code blocks, citations and rich contentMid-levelBeing written
Interview questions in this module
- Why is rendering LLM output with
innerHTMLdangerous? - How can a markdown image in model output leak user data?
- How would you safely let users run code generated by a model?
- How do you display citations so users can verify answers?