Skip to content
Enterprise RAG8 min read

Enterprise RAG Security and Data Governance

Connecting an LLM to your knowledge base creates a new attack surface and new governance duties. The RAG-specific threats, the access-control problem, and how to build a defensible program.

Boopesh MahendranUpdated

Retrieval-augmented generation is often the more governable way to put an LLM to work on proprietary data, because the knowledge lives in a store you control rather than being baked into a model’s weights. But that same architecture, an LLM wired directly into your knowledge base, creates a new attack surface and a set of governance obligations that traditional application security does not fully cover. The properties that make RAG attractive, an external and updatable knowledge store feeding a model at query time, are exactly the properties you now have to secure and govern.

This article covers both halves. First, the RAG-specific security threats and how to defend against them. Second, the data governance questions, access control, provenance, auditability, and compliance, that determine whether a RAG system survives an enterprise security review. For the architecture these controls sit on top of, see the pillar guide, Enterprise RAG: A Practical Guide to Building AI Knowledge Assistants.

The RAG attack surface

Securing an LLM application means securing not just the model but the data, retrieval, and integrations around it. The most widely referenced catalog of these risks, the OWASP Top 10 for LLM Applications, ranks prompt injection as the number one risk (LLM01) and, in its 2025 edition, elevated sensitive information disclosure to the number two position [1]. Both land squarely on RAG systems, and OWASP notes explicitly that vulnerabilities in how a RAG system generates, stores, and retrieves vectors and embeddings can enable malicious content injection, output manipulation, and unauthorized data access [1]. Three threats deserve specific attention.

Prompt injection, especially the indirect kind

Prompt injection is the manipulation of a model’s behavior through crafted input. The direct form is a user typing an adversarial instruction. The more dangerous form for RAG is indirect: an attacker plants malicious instructions inside content that the system will later retrieve and feed to the model, such as a document, a web page, or an email, and the model then treats that planted text as an instruction rather than as data [2]. RAG is uniquely exposed to this because its entire purpose is to pull external content into the model’s context. A poisoned passage retrieved from your own corpus can hijack the answer.

The defenses OWASP recommends map directly onto RAG design: segregate untrusted retrieved content so it cannot be interpreted as instructions, constrain the model’s role and expected output, validate and filter both inputs and outputs, and run regular adversarial testing [1]. It is worth internalizing that neither RAG nor fine-tuning fully eliminates this class of attack, so the correct posture is defense in depth rather than a single control.

Knowledge base poisoning

If prompt injection is about hijacking a single answer, poisoning is about corrupting the source. Research has demonstrated that injecting only a small number of malicious passages into a RAG system’s knowledge database can reliably induce the model to produce an attacker-chosen answer for a targeted question [3]. The knowledge base is an attractive target precisely because it is often the most accessible part of the system, and because a single tainted document can influence many answers.

The controls are governance controls as much as security ones: tightly manage what is allowed to enter the index, vet and curate ingested sources, track provenance so you know where each chunk came from, sanitize content on ingestion, and monitor the corpus for anomalous additions. An index that anyone or any upstream feed can write to without review is a standing liability.

Sensitive information disclosure and data leakage

LLMs can surface sensitive data, and in a RAG system the retrieval database itself becomes a leakage vector. Studies examining privacy in RAG have shown that the external knowledge store can expose private data it contains through targeted interaction, and related work demonstrates membership-inference attacks that reveal whether specific records are present in the retrieval database [4]. This is why OWASP moved sensitive information disclosure up its list: the more data you make retrievable, the more there is to leak [1].

Mitigation starts with data minimization: do not index what the assistant does not need. Redact or mask personal and confidential fields before indexing, filter outputs for sensitive content, and treat the vector store as sensitive data in its own right, since embeddings can encode the information they were derived from.

The access-control problem

The single most common reason enterprise RAG pilots fail a security review is not an exotic attack. It is that a naive retrieval pipeline queries the entire index regardless of who is asking, and will happily surface a document the requesting user has no right to see. Retrieval, by default, is blind to permissions.

The fix is permission-aware retrieval: the user’s own entitlements have to be enforced at retrieval time, so the candidate set is filtered to what that user is allowed to access before anything reaches the model. Applying access control after generation is too late, because the sensitive content has already influenced the answer. In practice this means carrying your existing document-level or record-level access controls into the vector store and filtering on them during retrieval, which aligns with OWASP’s least-privilege guidance for the data an LLM application can reach [1]. Any assistant that serves multiple users with different permission levels has to solve this before it goes live.

Filtering after generation

  • Retrieval queries the whole index, blind to who is asking
  • Restricted passages reach the model and shape the answer
  • The filter runs on output, after the damage is done
  • A leak looks like a correct answer to the wrong person

Permission-aware retrieval

  • The user's entitlements filter the candidate set first
  • Restricted passages never enter the model's context
  • Existing document-level access controls carry into the vector store
  • What the user cannot see cannot influence what they are told
The one control that decides most enterprise security reviews. This is a genuine worse-versus-better pair, which is what earns the contrast treatment: filtering after generation is not a lighter alternative, it is the same leak with a later checkpoint.

Data governance and the lifecycle

Beyond defending against attacks, an enterprise RAG system has to satisfy the ordinary obligations of handling sensitive data, and this is where RAG’s architecture is a genuine advantage.

Updatability and the right to erasure. Because knowledge sits in an external store rather than in model weights, you can add, correct, and delete content at will. This matters for regulations such as data-erasure requirements: you can actually remove an individual’s records from an index, whereas information absorbed into a fine-tuned model is far harder to excise. This is one of the governance reasons to prefer retrieval over fine-tuning for sensitive corpora, discussed further in RAG vs fine-tuning for enterprise knowledge.

Auditability and traceability. Because a well-built RAG system answers from specific retrieved passages, you can log which sources informed each answer. That trail supports audits, incident response, and the ability to explain a given output, which grounding-based retrieval provides in a way that opaque model memory does not.

Data residency and retention. Decide deliberately where embeddings and the vector database live and how long conversation logs and cached content are retained, because embeddings and logs can both hold sensitive material and are subject to the same residency and retention rules as the source data.

Building a defensible program: mapping to a framework

Enterprises rarely accept a list of ad hoc tips; they want the program mapped to a recognized framework. The NIST AI Risk Management Framework (AI RMF 1.0) provides a widely used structure built around four functions, Govern, Map, Measure, and Manage, and its Generative AI Profile explicitly calls out prompt injection, data privacy, and confabulation as generative-AI risks to manage [5]. That maps cleanly onto a RAG security program:

  • Govern. Establish ownership and policy: who owns the corpus, who approves what gets indexed, what the access-control rules are, and how incidents are handled.
  • Map. Inventory the data, its sensitivity, and where it flows: what is in the index, who can reach it, and which threats apply.
  • Measure. Test for the specific risks: red-team for prompt injection, probe for data leakage, and monitor answer faithfulness on an ongoing basis, which connects to the reliability work in reducing hallucinations in enterprise RAG systems.
  • Manage. Respond and remediate: remove poisoned or leaked content, re-index, tune controls, and close the loop back into governance.

Using an established framework turns a scattered set of controls into something an enterprise risk team recognizes and can sign off on.

A controls checklist

For teams putting this into practice, the essentials:

  • Enforce each user’s permissions at retrieval time (permission-aware retrieval), not after generation.
  • Segregate retrieved content and never let it act as instructions to the model.
  • Control and vet what enters the index; record provenance for every source.
  • Minimize and redact sensitive data before indexing; treat embeddings and the vector store as sensitive data.
  • Filter inputs and outputs, and run regular adversarial and red-team testing.
  • Log the sources that informed each answer for audit and incident response.
  • Map the whole program to a recognized framework such as the NIST AI RMF and its Generative AI Profile.

The bottom line

RAG is the more governable architecture for enterprise knowledge precisely because the knowledge stays external, updatable, and auditable, rather than being fused into a model. But that advantage is only real if you secure the new attack surface it introduces and enforce access and provenance rigorously. The teams whose systems pass security review are the ones that treat retrieval as a data-security boundary, with all the access control, input validation, and auditing that implies, rather than as a pure accuracy technique. Get that right, and a RAG assistant can be both genuinely useful and defensible in front of a regulator.


Deploying an AI knowledge assistant on sensitive data? Security review is where most projects stall, and it is far cheaper to design for than to retrofit.


Sources

  1. OWASP (2025). OWASP Top 10 for LLM Applications (2025). https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/
  2. Greshake, K., Abdelnabi, S., Mishra, S., Endres, C., Holz, T., & Fritz, M. (2023). Not What You’ve Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. AISec @ CCS 2023. https://arxiv.org/abs/2302.12173
  3. Zou, W., Geng, R., Wang, B., & Jia, J. (2024). PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models. USENIX Security 2024. https://arxiv.org/abs/2402.07867
  4. Zeng, S., et al. (2024). The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG). https://arxiv.org/abs/2402.16893
  5. National Institute of Standards and Technology (2023). Artificial Intelligence Risk Management Framework (AI RMF 1.0), NIST AI 100-1, and the Generative AI Profile (NIST AI 600-1, 2024). https://www.nist.gov/itl/ai-risk-management-framework

About the author

Co-Founder & Head of Engineering, CyberMind Works

Boopesh is one of the Co-Founders of CyberMind Works and the Head of Engineering. An alum of Madras Institute of Technology with a rich professional background, he has previously worked at Adobe and Amazon. His expertise drives the innovative solutions at CyberMind Works.

All Enterprise RAG articles →