Retrieval-Augmented Generation, or RAG, is an AI design pattern that answers a prompt by first fetching external content from a search index, database, document store, or API, then using that material to generate the final response. Instead of relying only on a model’s trained knowledge, RAG adds a retrieval pipeline that supplies fresh or private context.
This matters in cyber security because the retrieval layer becomes part of the attack surface. If an attacker can poison indexed documents, insert malicious instructions, expose sensitive files, or abuse overbroad connectors, the model may repeat leaked data or follow untrusted content. Defenders treat retrieved data as untrusted: they use source allowlists, access control, provenance checks, content filtering, retrieval limits, and monitoring for unusual queries or index changes. In practice, RAG security is about protecting the data path before the model ever sees it.


