Authentication proves who the user is, but it does not decide what that user may see. RAG systems often retrieve from broad stores that can mix private, shared, and sensitive content, so authorization must limit retrieval to permitted resources. Without that second control, a valid login can still surface data outside the user’s intended scope.
Why This Matters for Security Teams
RAG exposure is not just a search problem. Once enterprise knowledge is connected to an LLM, the access decision shifts from “can this user sign in?” to “can this user retrieve this specific content right now?” Authentication answers the first question only. Authorization must gate the retrieval layer, the index, and any downstream tool calls that can expand what the model sees.
This matters because RAG often blends content from shared drives, ticketing systems, chat archives, and document stores into one retrieval surface. Without access control at query time, a valid identity can still pull confidential material, especially when embeddings, chunking, and semantic matching surface adjacent records that were never meant to be broadly visible. NHI Mgmt Group’s research on Ultimate Guide to NHIs — Why NHI Security Matters Now shows why identity governance becomes material as soon as systems start acting on behalf of users.
Security teams also need to account for the fact that enterprise AI systems are increasingly connected to autonomous components and tool access, which increases the blast radius of a weak policy boundary. In practice, many security teams discover overexposure only after a prompt or retrieval path has already surfaced data that should never have left the source system.
How It Works in Practice
A safe RAG design applies authentication first, then authorization at the point of retrieval. The user proves identity through an enterprise IdP, but the RAG service still needs policy context such as role, department, project membership, data classification, and document ownership before it selects chunks or builds context for the model. That policy should be evaluated at request time, not baked into a static index.
Current guidance suggests treating retrieval as an access-controlled transaction. The application should filter candidate sources before embedding lookup, enforce ACLs on the vector store or document store, and preserve source permissions when content is chunked and reindexed. This is where standards-oriented access control like NIST SP 800-53 Rev 5 Security and Privacy Controls helps, because retrieval governance maps most closely to least privilege, access enforcement, and auditability. For broader identity context, the NHI governance patterns in 52 NHI Breaches Analysis show how weak identity control leads to data exposure across systems.
- Authenticate the user with the enterprise identity provider.
- Authorize each retrieval against source-system permissions, not just the chat application session.
- Propagate entitlement filters into search, vector lookup, reranking, and document assembly.
- Log which sources were checked, which were denied, and what was ultimately exposed to the model.
- Block responses when the model cannot assemble an answer without crossing permission boundaries.
Teams should also consider whether the RAG pipeline uses service accounts, API keys, or other non-human identities to reach data stores, because those identities must be scoped and rotated separately from human access. These controls tend to break down when legacy content repositories lack per-document ACLs because the retrieval layer cannot reliably reconstruct the original permission boundary.
Common Variations and Edge Cases
Tighter retrieval controls often increase implementation overhead, requiring organisations to balance precision against latency, indexing complexity, and user experience. That tradeoff is real, especially when enterprises want fast semantic search across many repositories with inconsistent metadata.
Best practice is evolving for multi-tenant RAG, shared copilots, and cross-functional knowledge bases. There is no universal standard for this yet, but the safe pattern is to keep tenant boundaries, project boundaries, and document-level permissions intact through ingestion, indexing, and generation. If the system supports citations, the cited source itself must also be permission checked, not merely the generated answer.
One common edge case is public plus private content in the same corpus. Another is “derived exposure,” where the model paraphrases restricted content without showing the original document. A third is tool chaining, where a RAG answer triggers another search, ticket lookup, or workflow action. In those cases, authentication and authorization must be enforced across every hop, because a valid login does not automatically justify every downstream retrieval. The risk becomes even clearer in enterprise environments that have experienced compromised non-human identities, including the patterns described in the The 52 NHI breaches Report. Good design treats the model as a constrained consumer of permissions, not as a substitute for them.
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, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | RAG pipelines rely on non-human identities to fetch knowledge securely. |
| OWASP Agentic AI Top 10 | A2 | RAG systems can chain tools and act on retrieved data in agentic flows. |
| CSA MAESTRO | IAM-2 | MAESTRO addresses identity and access control for AI-enabled workflows. |
| NIST AI RMF | AI RMF supports trustworthy access decisions and governance for AI systems. | |
| NIST CSF 2.0 | PR.AC-4 | Retrieval authorization is an access control problem at its core. |
Inventory and restrict every service account, API key, and token used by retrieval components.
Related resources from NHI Mgmt Group
- How should security teams design authentication before authorization in customer-facing applications?
- How should security teams authenticate AI agents in enterprise environments?
- What common vulnerabilities do cloud applications face with OAuth tokens?
- Why is it crucial to adopt new authentication methods in MCP usage?