Retrieved documents are untrusted input. A document may contain instructions that attempt to override the system prompt or redirect the model. A RAG application should clearly separate system instructions from retrieved context and tell the generator to treat retrieved content as evidence, not as executable instructions. Applications should also avoid exposing secrets and should validate citations and outputs.
