Output encoding converts generated data into a representation that is not interpreted as executable code in its destination context. It belongs at the boundary between generated content and the system that consumes it, where representation determines whether data remains data or becomes code. section 13.2.1
Its security context includes prompt injection, where crafted direct or indirect inputs can influence an LLM through user content, documents, or RAG-retrieved web pages. Encoding is distinct from access controls and other measures used to limit the damage of such attacks. section 13.2.1
