A RAG setup combines retrieval and generation so a model can answer using documents or indexed data rather than only its training memory. In enterprise environments, the important concerns are document access boundaries, source freshness, and whether retrieval respects identity, privacy, and compliance controls.
Expanded Definition
A rag setup, short for retrieval augmented generation, links a generative model to an external retrieval layer so responses can be grounded in indexed content, document stores, or search results rather than model memory alone. In NHI and agentic AI environments, that retrieval layer is part of the security boundary because it determines what data an agent can see, what it can cite, and whether the output reflects current or approved sources.
Definitions vary across vendors on how much of the pipeline belongs to RAG versus the surrounding application stack. NHI Management Group treats RAG as the end-to-end pattern that includes ingestion, indexing, retrieval, ranking, and generation because each stage can expose secrets, internal records, or restricted knowledge. That distinction matters when applying NIST Cybersecurity Framework 2.0 controls for data protection and access governance, and when aligning retrieval permissions with identity-aware policy. The most common misapplication is treating RAG as a model-only feature, which occurs when teams secure prompts but leave the underlying corpus, connectors, or vector index broadly accessible.
Examples and Use Cases
Implementing RAG rigorously often introduces an access-control and freshness tradeoff, requiring organisations to weigh broader model usefulness against tighter data boundaries and indexing overhead.
- An internal support agent retrieves approved incident runbooks from a knowledge base while excluding customer records that the user is not entitled to see.
- A finance copilot answers policy questions from a controlled document repository, with retrieval limited to the current version of compliance guidance and audit artifacts.
- A software engineering assistant searches approved architecture docs and API references, but blocks source trees that may contain embedded Ultimate Guide to NHIs findings on secret sprawl and service-account exposure.
- A customer-facing chatbot uses retrieval from public help content only, avoiding internal ticket data or private case notes that would create privacy and leakage risk.
- An operations agent pulls from a time-bounded index so answers reflect current inventory, incident status, or policy updates instead of stale archived content.
For retrieval systems that federate across services, practitioners often reference NIST Cybersecurity Framework 2.0 to anchor data handling and access review expectations across the pipeline.
Why It Matters in NHI Security
RAG setups become a security concern because they can quietly extend an agent’s reach beyond its intended authority. If the retriever can access more documents than the user or workload should see, the model may surface restricted content, secrets, or sensitive operational details even when the model itself is not compromised. That is why NHI Management Group treats retrieval permissions as part of identity governance, not just search quality.
The risk is not theoretical. NHI Mgmt Group reports that 79% of organisations have experienced secrets leaks, and 77% of those incidents resulted in tangible damage, which shows how quickly overbroad retrieval can turn knowledge access into exposure. The same pattern appears when service accounts, vector stores, and connectors are left with excessive privileges or stale embeddings. Ultimate Guide to NHIs also notes that 97% of NHIs carry excessive privileges, a reminder that RAG often inherits the same privilege creep seen in other machine identities. Organisations typically encounter the blast radius only after a leakage, hallucinated citation, or access review failure, at which point RAG setup becomes operationally unavoidable to address.
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 CSF 2.0, NIST Zero Trust (SP 800-207) and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 | Retrieval paths can expose secrets and overbroad data access if not constrained. |
| OWASP Agentic AI Top 10 | AGENT-04 | Agent tool use and retrieval governance apply when LLMs fetch external context. |
| NIST CSF 2.0 | PR.AC-4 | Identity-based access control governs who and what can retrieve protected context. |
| NIST Zero Trust (SP 800-207) | SA-1 | Zero Trust requires continuous verification for data retrieval across service boundaries. |
| NIST AI RMF | AI risk management covers data provenance, privacy, and lifecycle risks in RAG. |
Restrict retriever access, inventory connectors, and audit indexed sources for privilege creep.