Retrieval Augmented Generation Security
Retrieval Augmented Generation (RAG) is a technique that connects large language models to external knowledge bases so the model can reference up-to-date or organization-specific information when generating responses. RAG security refers to the set of controls and practices used to protect these systems from risks that arise in the retrieval pipeline, input handling, and external data sources. Because most risks in RAG systems originate outside the model itself, securing a RAG deployment typically requires addressing threats across the full pipeline, not only the language model component.
RAG security encompasses the controls, threat models, and mitigation strategies applied to systems that combine retrieval mechanisms with generative language models to augment LLM outputs with content drawn from external knowledge bases outside of the model's training data. The attack surface in RAG architectures extends beyond the model to include the retrieval pipeline, document stores, embedding and indexing processes, and any external services involved in context assembly. Practitioner-relevant threat categories include poisoned or adversarially crafted documents introduced into the knowledge base, unauthorized access to sensitive retrieved content, prompt injection via retrieved context, and data leakage through model outputs. Security controls must therefore address not only model-level guardrails but also access controls on the knowledge base, integrity verification of ingested documents, query authorization, and output filtering, given that retrieval-layer vulnerabilities may be invisible to controls applied solely at the inference layer.
Why it matters
RAG systems are increasingly deployed in enterprise environments to give language models access to proprietary, sensitive, or frequently updated information. This architecture introduces a broad attack surface that extends well beyond the model itself, encompassing document ingestion pipelines, vector stores, embedding services, and retrieval logic. Because organizations use RAG to unlock value from existing internal data, security failures in these systems can expose confidential information, proprietary knowledge bases, or regulated data through model outputs, even when the underlying model has not been compromised.
Who it's relevant to
Inside RAG Security
Common questions
Answers to the questions practitioners most commonly ask about RAG Security.