By NHI Mgmt Group Editorial TeamBased on Protecto: “Why Your Retriever Matters More Than Your LLM in RAG” (August 10, 2026)

TL;DR: Most enterprise RAG exposure starts in the retriever, not the LLM, according to Protecto, because ingestion, chunking and retrieval can surface restricted documents, raw PII and over-retrieved context before the model ever generates an answer. The control problem is data governance at retrieval time, not prompt tuning or model choice.


At a glance

What this is: Protecto argues that RAG security fails most often in retrieval, where sensitive data can enter the context window before the LLM ever responds.

Why it matters: For IAM, NHI and AI governance teams, the practical question is who and what can retrieve data, under what context, and how those decisions are enforced and audited.


Context

Retrieval-augmented generation separates the act of finding content from the act of generating an answer. That separation matters because the retrieval layer decides which documents, chunks and embedded data are even eligible to be seen by the model, which makes it a governance control point rather than a simple search component.

In enterprise AI workflows, the retrieval layer often inherits none of the original document permissions, masking rules or purpose limits. That creates a boundary failure between data governance and model behaviour, and it is where permission-aware retrieval becomes a real security requirement rather than an optimisation problem.


Key questions

Q: How should security teams implement RAG so it does not expose data users should not see?

A: Security teams should treat RAG as a retrieval system with access controls, not as a passive answer engine. The safest pattern is to sanitize data before it enters the vector store, enforce authentication and authorization before retrieval, and limit access by role or data source. That reduces unauthorized disclosure while preserving enough context for useful semantic search.

Q: Why does over-retrieval increase the risk of data exposure in RAG systems?

A: Over-retrieval expands the amount of context the model sees, which increases the chance that sensitive fields ride along with a relevant answer. Because retrieval is tuned for recall and semantic relevance, it can surface more information than the user asked for. In practice, that breaks data minimisation and enlarges the exposure surface on every query.

Q: What should teams do first when building secure enterprise RAG?

A: Start by classifying and masking source content before it is embedded. If you ingest raw documents first and try to govern them later, the exposure has already happened in the vector store and prompt window. The first control should be to limit what can ever become retrievable context.

Q: When does retriever security matter more than LLM security?

A: Retriever security matters more whenever the main risk is unauthorized access to data, not unsafe generation. If the model is only receiving what the retriever provides, then the real control problem is who can surface which content and under what conditions. That is especially true for regulated data, internal records and multi-tenant AI workflows.


Technical breakdown

Why retriever security, not model security, drives RAG exposure

In a RAG pipeline, the model can only reason over the context it receives. The retriever determines that context by selecting chunks from a corpus, ranking them and passing them into the prompt window. If the retrieved material contains regulated or confidential data, the model can surface it even when the query itself was benign. That means the security boundary is upstream of generation. The common mistake is to treat the LLM as the control point, when the retriever is actually making the policy-relevant inclusion decision.

Practical implication: Move security controls to retrieval policy, because output filtering cannot undo context that was already exposed.

How ingestion and chunking create hidden access-control failures

Most RAG systems ingest documents into a vector store without preserving the source system's original access rules. Once a file is chunked and embedded, the embedding no longer carries the folder, role or jurisdiction limits that applied in the source repository. That turns a document-level permission model into a search problem with missing governance metadata. Sensitive records also become isolated chunks, which makes them easier to retrieve out of context. This is why the ingestion stage is a control boundary, not a preprocessing detail. See the AI Infrastructure Workload Identity Guide.

Practical implication: Preserve identity, purpose and source permissions before content is embedded or indexed.

Why over-retrieval expands the exposure surface

Retrieval systems are tuned for recall and relevance, so they often surface more context than the question actually requires. In security terms, that is a data minimisation failure. Wider retrieval windows, reranking and hybrid search can all increase the number of sensitive fields that reach the prompt, even if no one intended to expose them. The problem is not only unmasked PII or PHI. It is also the accumulation of extra context that becomes visible to the model and potentially to downstream logs, tools or users. See the Data Security Guide.

Practical implication: Cap retrieval scope and test for unnecessary context leakage, not just answer quality.


Threat narrative

Attacker objective: The objective is to cause unauthorized disclosure of sensitive enterprise data through ordinary RAG interactions.

  1. Entry occurs when enterprise documents are ingested into the RAG corpus without retaining source permissions or masking sensitive fields.
  2. Credential or access abuse follows when the retriever returns chunks to users or agents who were never entitled to see the original material.
  3. Impact occurs when the LLM reflects restricted content into responses or logs, exposing PII, PHI or confidential business information.
  • DeepSeek database exposure 2025: An unauthenticated DeepSeek ClickHouse database exposed over a million log lines with plaintext chat history and API keys in 2025.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Retriever security is now a first-class governance problem: RAG systems do not fail only because models are poorly prompted. They fail when retrieval rules allow the wrong content to enter the context window in the first place. That makes the retriever the practical control point for data minimisation, authorization and auditability. Organisations that ignore it are treating AI risk as a model issue when it is really a retrieval and access problem.

not really?

Context controls have to move before generation: The article is right to separate model behaviour from retrieval behaviour, because the model cannot enforce policy it never sees. That distinction matters for AI governance teams, but it also matters for identity teams because identity, purpose and context are the conditions that should decide what is retrievable. Secure AI programmes need policy at retrieval time, not confidence in the model's output filtering.

RAG creates a new kind of shadow data exposure: Once documents are chunked, embedded and re-ranked, the sensitive material is no longer governed only as a file or record. It becomes retrievable context, which is a different governance object with different failure modes. That is why data security and identity-aware retrieval policy have to be designed together, not bolted on after deployment.

The real control gap is permission translation: The article exposes a structural flaw in most enterprise AI deployments: source-system permissions do not automatically survive ingestion. Without that translation layer, the retrieval path becomes a parallel access plane with weaker controls than the systems it ingests from. Practitioners should treat this as a governance design failure, not a model tuning issue.

From our research library:

  • AI-related credential leaks surged 81.5% year-over-year in 2025, with the surrounding AI infrastructure leaking 5x faster than core LLM providers, according to the State of Secrets Sprawl 2026.
  • 43% of security professionals are concerned about AI systems learning and reproducing sensitive information patterns from codebases, according to the State of Secrets in AppSec.
  • Read next: Permission-Aware RAG Guide

What this signals

Permission-aware retrieval is the right mental model for enterprise RAG: The security boundary sits at the point where content is selected for context, not at the point where the model speaks. That means retrieval policy must account for identity, source permissions and purpose before any chunk reaches the prompt, otherwise the system behaves like an overbroad search engine with an LLM attached.

Retrieval-layer governance will become the differentiator: As AI programmes move from pilots to production, teams will be judged less on model choice and more on whether they can prove what the system was allowed to see. That will push identity-aware retrieval, masking and audit logging into the core AI control stack rather than leaving them as afterthoughts.


For practitioners

  • Map retrieval decisions to source permissions Verify that every document, chunk and embedding inherits the access rules of the originating system before it can be retrieved by a user or agent.
  • Mask sensitive fields before embedding Tokenise PII, PHI and confidential identifiers before content is chunked so the vector store never contains raw values.
  • Enforce retrieval-time authorisation Apply identity, purpose and context checks at query time so retrieved content is governed by who is asking and why, not just by document location.
  • Audit the context window, not only outputs Log what was retrieved, what was present in the prompt window and which sensitive entities were included so you can evidence AI access decisions later.

Key takeaways

  • RAG exposure is often a retrieval problem, not a model problem, because the retriever decides what enters the context window.
  • When source permissions are stripped during ingestion, the vector store becomes a weaker access plane than the systems it copied from.
  • The practical fix is to combine masking, retrieval-time authorisation and context-window logging so the AI system can be governed end to end.

Related NHI Mgmt Group resources: Permission-Aware RAG Guide · AI Agent Memory Security Guide · AI Infrastructure Workload Identity Guide · Data Security Guide


Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10, OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP API Security Top 10API8 — Security MisconfigurationRAG retrieval without policy controls behaves like a misconfigured access layer for sensitive content.
Recommendation — Treat retrieval as an access-control surface and remove misconfigurations that let sensitive chunks reach unauthorised users.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article is fundamentally about enforcing the right entitlements at retrieval time.
Recommendation — Apply PR.AA-05 to ensure AI retrieval decisions reflect current permissions, not stale source folder access.
NIST AI RMFGOVERN — AI Governance and AccountabilityThe article focuses on governance boundaries for AI data access and auditability.
Recommendation — Define governance for retrieval, masking and audit logging before deploying RAG into production.
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseThe article addresses AI systems that can expose data to users or agents outside intended privilege boundaries.
Recommendation — Constrain agent and user privileges so retrieval cannot exceed the context each identity is allowed to access.
MITRE ATT&CKTA0006 — Credential AccessUnauthorized retrieval and exposure of protected content maps to credential and access abuse paths.
Recommendation — Hunt for access paths that let users retrieve data outside their entitlement and close them at the control layer.

Key terms

  • Retriever Security: Retriever security is the set of controls that govern what content a RAG system can place into the model context window. It covers permissions, masking, ranking and auditability so the model only sees data the requesting identity and purpose are allowed to access.
  • Context Window: The context window is the text a model receives at one time, including prompts, retrieved documents, and conversation history. Security teams care about it because it becomes the practical boundary between trusted instructions and untrusted content, especially when the application assembles that text automatically.
  • Data Minimization: Data minimization is the practice of limiting personal data collection to what is adequate, relevant, and necessary for a specific purpose. It reduces exposure by shrinking what is gathered, transferred, retained, and processed. Strong minimization depends on careful form design, purpose review, and strict collection discipline.
  • Permission-Aware Retrieval: Permission-aware retrieval is the practice of enforcing access control before data reaches the model. It ensures the model only sees documents, records, or context that the requesting identity is allowed to access. In multi-tenant or sensitive environments, this control is more important than post-processing filters.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, workload identity and secrets management in the contexts that matter to identity security teams. It helps practitioners connect AI governance with the access and lifecycle controls their programmes already need.
NHIMG Editorial Note
Published by the NHIMG editorial team on October 22, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org