TL;DR: RAG pipelines create new authorization exposure because LLMs can surface sensitive data through query, retrieval, and output paths when policy decisions are not applied consistently, according to PlainID. The underlying problem is that traditional access models were built for static applications, not AI-mediated access that can expand the blast radius of a single request.
At a glance
What this is: This is an analysis of how GenAI and RAG pipelines expose access control gaps across query, retrieval, and response handling.
Why it matters: It matters because IAM, NHI, and PAM teams need consistent authorization decisions for both human users and AI-mediated access paths, or sensitive data can leak through otherwise valid sessions.
👉 Read PlainID's analysis of OWASP Top 10 access control risks in GenAI
Context
RAG systems change the authorization problem by inserting an AI layer between the user and the data source. Instead of a simple request and response, access now depends on whether the query is allowed, whether the retrieval is allowed, and whether the generated output is allowed to reveal the information.
That is why standard RBAC alone struggles here. In a GenAI workflow, identity attributes, data sensitivity, context, and policy enforcement have to travel together across the pipeline, or the model can become a bypass path for information that should have remained restricted.
For teams already working on NHI governance, this is the same control problem with a different execution path. The practical reference point is the OWASP NHI Top 10 and the broader OWASP Agentic AI Top 10, because both point to the need for authorization that follows the identity and the action, not just the application session.
Key questions
Q: How should security teams control access in RAG-based GenAI systems?
A: Security teams should enforce authorization at three points: before the prompt is accepted, before data is retrieved, and before the answer is returned. That prevents the model from becoming an indirect access path to sensitive information. Policy should consider identity, role, data sensitivity, and context together, not just the user’s initial login state.
Q: Why do traditional RBAC models struggle with GenAI access control?
A: RBAC struggles because GenAI workflows are dynamic and context-dependent. A role can be correct at login but still allow excessive retrieval or disclosure later in the interaction. RAG systems need policy decisions that follow the data path and the runtime context, not just the user’s job title or group membership.
Q: What breaks when output filtering is missing in an LLM workflow?
A: Without output filtering, a model can surface confidential data even when the prompt and retrieval look legitimate. That creates a last-mile disclosure problem, where the system answers a valid request with an invalid payload. The risk is especially high when the model has access to sensitive documents, embeddings, or connected business systems.
Q: How do organisations know if GenAI authorization is actually working?
A: They should test whether unauthorized users can infer, retrieve, or see restricted data through the AI workflow. Good evidence includes policy logs for each checkpoint, denial rates for out-of-scope requests, and audit trails that show which document or field was filtered. If the system cannot explain those decisions, governance is incomplete.
Technical breakdown
Why RAG creates an authorization problem
Retrieval-Augmented Generation connects an LLM to documents, databases, or search indexes so it can answer with current context. That connection is powerful, but it also means the model is no longer speaking only from training data. It can surface live enterprise information that should be filtered by user identity, group membership, data sensitivity, and environment. If authorization is checked only at login, the retrieval path can become a hidden access channel. The failure mode is not the model itself, but the way it inherits access to downstream systems without the same policy discipline applied to ordinary application flows.
Practical implication: treat every retrieval step as an authorization decision, not just the final application request.
PBAC in the GenAI pipeline
Policy-Based Access Control evaluates access using attributes such as identity, role, data tags, and context rather than fixed roles alone. In GenAI environments, that lets policy logic sit at three checkpoints: before the query reaches the model, before data is retrieved, and before the answer is returned. This matters because each checkpoint carries a different risk. A user may be allowed to ask a question, but not to retrieve the source documents. Or the retrieval may be allowed, but the output must redact sensitive fields. PBAC is therefore less about static entitlement and more about per-request authorization across the whole prompt-response chain.
Practical implication: place policy enforcement at input, retrieval, and output, and test each checkpoint independently.
Why centralized policy matters for AI access
Centralized policy management matters because GenAI systems often span APIs, data sources, microservices, and governance tools that are owned by different teams. If each layer makes its own authorization choice, the enterprise gets inconsistent outcomes and weak auditability. A single policy source can help unify access decisions across human users and non-human identities that operate on their behalf. That also reduces the chance that an AI workflow inherits permissions from one system but bypasses constraints in another. The real architectural issue is policy consistency, not model intelligence.
Practical implication: centralize policy decisions so GenAI access behaves consistently across applications, data, and AI services.
Threat narrative
Attacker objective: The attacker wants to use the GenAI workflow as a controlled access path to expose sensitive information or consume resources beyond intended limits.
- Entry begins when a user or internal workflow sends a prompt into a RAG system that has access to sensitive enterprise data.
- Escalation occurs when the retrieval layer returns documents or embeddings that exceed the requester’s intended scope, allowing the model to surface information the user should not see.
- Impact follows when the generated response exposes confidential data, expands unauthorized discovery, or enables unbounded consumption of AI resources.
Breaches seen in the wild
- Reviewdog GitHub Action supply chain attack — reviewdog/action-setup GitHub Action supply chain attack exposed secrets.
- CI/CD pipeline exploitation case study — full server takeover via exposed .git directory and mismanaged CI/CD pipeline secrets.
Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
RAG turns authorization into a three-stage control problem. The article correctly shows that query approval, data retrieval, and output filtering are separate decisions, not one policy event. That matters because each stage can succeed or fail independently, and a control that exists in one layer does not automatically protect the others. Practitioners should stop treating GenAI access as a single gate and start governing each stage explicitly.
PBAC is the right control model only if policy follows the identity and the data. Dynamic authorization works better than static role mapping when the system needs to consider who is asking, what data is being touched, and what context applies at runtime. The article’s real contribution is showing that identity attributes and data sensitivity must move through the workflow together. Practitioners should use this as a trigger to align policy enforcement with the actual data path.
Least privilege fails in GenAI when access is judged at session start instead of at each action. Traditional access control assumes the important entitlement decision happens once and remains stable through the workflow. In RAG, the model can request, retrieve, and reveal information across multiple steps, so that assumption breaks down. The implication is that governance must be built around request-level enforcement, not around a one-time login decision.
AI access governance is now an IAM and NHI problem, not just an application feature. When an AI system acts on behalf of a user, the permissions boundary includes both the human identity and the non-human execution path. That means authorization failures can create exposure even when the human account looks correctly configured. Practitioners should treat GenAI policy design as part of identity governance, not as a separate AI-only control plane.
From our research:
- 80% of organisations report their AI agents have already performed actions beyond their intended scope, including accessing unauthorised systems (39%), inappropriately sharing sensitive data (31%), and revealing access credentials (23%), according to AI Agents: The New Attack Surface report.
- Only 52% of companies can track and audit the data their AI agents access, leaving 48% with a complete blind spot for compliance and breach investigation.
- If you are building the governance baseline for autonomous or AI-mediated access, start with OWASP NHI Top 10 and then align policy enforcement to the broader NIST AI Risk Management Framework.
What this signals
RAG governance is converging with broader AI agent oversight. The practical problem is no longer just whether an LLM can answer a question, but whether the surrounding identity and policy model can prove why it was allowed to answer. With 80% of organisations reporting agent behaviour beyond intended scope, the governance baseline for AI-mediated access is already under stress.
Policy sprawl is the hidden failure mode in GenAI programmes. Teams that split authorization across application code, retrieval logic, and data-layer controls will struggle to audit exceptions and prove containment. This is where a named concept becomes useful: AI access policy drift, the gap that appears when the model, the data, and the policy engine no longer evaluate the same request in the same way.
For practitioners, the next step is to treat GenAI as part of identity architecture, not a separate innovation track. That means aligning RAG controls with established identity governance patterns, then using the relevant guidance in the Ultimate Guide to NHIs to anchor lifecycle, visibility, and access review decisions.
For practitioners
- Map the three authorization checkpoints in every RAG workflow Document where policy must be enforced before prompt submission, before retrieval, and before output display. Test each checkpoint separately so a control failure in one layer cannot be masked by a stronger layer downstream.
- Classify the data that the model can retrieve and reveal Tag documents, embeddings, and connected data sources by sensitivity so policy can distinguish between allowed questions and allowed answers. Use those tags in the policy engine rather than relying on role labels alone.
- Centralize policy decisions across AI and non-AI systems Avoid separate authorization logic for APIs, retrieval layers, and downstream applications. A single policy source reduces drift, improves auditability, and makes it easier to explain why a response was allowed.
- Review where AI workflows inherit human permissions Check whether the model or agent is operating under permissions that exceed the user’s actual intent. If an AI path can retrieve or expose data the user should not access directly, tighten the boundary immediately.
Key takeaways
- GenAI creates a new authorization surface because the model can mediate access to data, not just generate text.
- The main control issue is consistency across prompt, retrieval, and output decisions, not model quality alone.
- Practitioners should govern RAG pipelines as identity workflows, with policy tied to the action and the data path.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | RAG systems need fine-grained authorization and policy enforcement across runtime access paths. |
| OWASP Agentic AI Top 10 | GenAI workflows can behave like agentic systems when they retrieve and reveal data on behalf of users. | |
| NIST Zero Trust (SP 800-207) | PR.AC-4 | Zero Trust requires continuous authorization, which maps directly to multi-step GenAI workflows. |
Use agentic AI controls to evaluate prompt, tool, and disclosure risks in RAG pipelines.
Key terms
- Retrieval-Augmented Generation: A GenAI pattern where the model retrieves external documents or data before generating a response. It improves relevance, but it also creates a security boundary around the retrieval path, the source data, and the final answer that must be governed separately.
- Policy-Based Access Control: An authorization model that decides access using policies built from identity attributes, data sensitivity, environment, and other runtime context. In GenAI systems, it is used to govern query input, retrieved content, and output disclosure rather than relying on static roles alone.
- Output Authorization: A control that checks what a model is allowed to reveal after it generates a response. It matters when the prompt and retrieval are allowed but the final answer still contains information the user should not see, such as masked fields, restricted documents, or derived sensitive data.
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.
This post draws on content published by PlainID: ALL NEW Agentic Identity Platform OWASP Top 10 for LLM and GenAI Security with PBAC. Read the original.
Published by the NHIMG editorial team on 2025-02-13.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org