Retrieval-augmented generation, or RAG, is an AI design pattern that looks up information from external sources before producing an answer. Instead of relying only on what the model learned during training, the system retrieves relevant documents, records, or knowledge-base entries and uses them as grounding for the final output. This usually improves relevance, freshness, and traceability, especially in domains where accuracy matters.
In cyber security, RAG can reduce hallucinations in support tools, policy assistants, and investigation workflows, but it also adds new risk. If the retrieval source is poisoned, outdated, or overbroad, the model can repeat bad guidance or leak sensitive content. Attackers may also use prompt injection inside indexed documents to influence the response. Defenses include curated data sources, access controls, filtering, document ranking, and logging so teams can audit what the model retrieved and why.


