Protecting Sensitive Company Data in Enterprise RAG
Imagine that an employee asks a company AI assistant, “What changes are planned for our department?” The assistant searches thousands of internal files and returns a clear answer. The problem is that part of the answer came from a confidential restructuring document the employee was never allowed to open. The search was semantically accurate: the document closely matched the question. The security decision was wrong.
This is the permission gap in enterprise retrieval-augmented generation, or RAG. RAG can make policies, manuals, reports, and other organizational knowledge easier to use. Yet a relevant document is not necessarily an authorized document, and a retrieved passage is not necessarily current or correct. Before an organization lets an AI assistant search sensitive files, it should enforce permissions during retrieval, synchronize those permissions, test for leakage and misinformation, and maintain human accountability for consequential answers.
How RAG Turns Company Files into Answers
A conventional large language model generates an answer from patterns learned during training. It may not know a company’s private information, and its built-in knowledge can become outdated. RAG adds an external retrieval step. Lewis and colleagues (2020), who introduced a foundational RAG architecture, combined a language model’s internal knowledge with a searchable external collection. This design allows the system to consult information without retraining the entire model whenever documents change.
In an enterprise system, documents are usually divided into smaller passages called chunks. An embedding model converts each chunk into a vector, a numerical representation of its meaning. When a user asks a question, the system converts that question into another vector. A vector database compares the question with stored vectors and returns passages that are mathematically similar. The language model receives those passages as context and generates an answer. In a well-designed interface, the answer also links to its supporting documents.
The vector database therefore does more than store files. It helps decide which organizational information enters the model’s working context. That position makes retrieval quality, document freshness, and access control central to the trustworthiness of the final answer.
Why the Technology Is Emerging
RAG is built from technologies that are individually established: databases, search, identity management, machine learning, and language models. Their combination at enterprise scale is much newer. Pan, Wang, and Li (2024) identified more than twenty commercial vector-database management systems produced within approximately five years, with large language model applications helping drive that growth. The rapid appearance of systems, architectures, and operating practices indicates fast development rather than a settled market.
Its maturity is therefore uneven. Semantic search and vector indexing are established enough for production. Identity-aware retrieval and document-level filtering are operational, but they require careful engineering. Less settled are reliable permission synchronization across connected systems, consistent authorization when answers combine sources, and evaluation of the complete retrieval-and-generation system. RAG is no longer a laboratory idea, but secure enterprise RAG is not yet a standardized document-management capability.
A company-reported Morgan Stanley case illustrates both adoption and the work needed to support it. The firm says its internal assistant retrieves information from a knowledge base of about 100,000 documents and is used by more than 98 percent of advisor teams. Morgan Stanley also reports expert review, use-case evaluations, and daily regression testing (OpenAI, n.d.). Because the account comes from the companies involved, it demonstrates organizational use rather than independently proving that every permission control is effective.
Real Value Without Guaranteed Accuracy
The attraction is easy to understand. A RAG assistant can help employees find policy details, summarize technical manuals, compare project reports, answer support questions, and locate evidence across files whose exact wording they do not know. Semantic retrieval is particularly useful when a user’s phrasing differs from the language in the document. It can also make answers easier to update because administrators can revise the knowledge collection instead of retraining a model.
Research shows meaningful benefits, but also a reason for caution. Krishna and colleagues (2025) evaluated demanding questions that required information from multiple sources. Their baseline model achieved about 0.40 accuracy without retrieval, while a multi-step retrieval pipeline achieved 0.66. That improvement is substantial, but 0.66 also means the system remained wrong on roughly one-third of the benchmark questions. Retrieval improved performance; it did not create certainty.
Evidence from legal research makes the limitation even clearer. Magesh and colleagues (2025) tested three commercial AI legal-research products that use RAG. The systems hallucinated between 17 and 33 percent of the time, despite having access to legal sources. This result should not be applied mechanically to every company assistant, but it demonstrates an important principle: supplying documents does not guarantee that the model will select, interpret, or describe them correctly. High-stakes answers still require citations, user review, and a way to abstain when evidence is weak.
When Retrieval Becomes a Data Leak
Accuracy is only half of the problem. An answer can be factually correct and still be inappropriate because the user was not authorized to receive it. Zeng and colleagues (2024) experimentally showed that RAG systems can be attacked to expose information from private retrieval databases. Their work treats the retrieval collection itself as a sensitive attack surface, not merely a helpful source of context.
The Open Worldwide Application Security Project (OWASP, 2025) similarly identifies sensitive-information disclosure and vector-and-embedding weaknesses as major risks in language-model applications. Weak separation between user groups can produce cross-user or cross-department leakage. Malicious or poorly governed documents can poison retrieval and influence answers. Old policies can remain highly similar to a question and outrank the current version. Even permission metadata can become stale when an employee changes roles, but the vector index has not yet synchronized with the source system.
These failures share one cause: semantic similarity answers “What text resembles this question?” It does not answer, “May this user see the source?” Authorization must therefore constrain the search before restricted text is added to the model’s context. Asking the language model to hide sensitive information after retrieval is too late; the protected material has already crossed the security boundary.
Close the Permission Gap Before Deployment
The most important technical control is document-level authorization at query time. Microsoft’s Azure AI Search documentation (2026) describes storing user or group permissions with indexed documents, carrying the caller’s identity into a query, and excluding results whose permission metadata does not authorize that caller. As of November 2026, security filters and native permission checks for supported data sources are generally available; some newer features, such as access controls based on Microsoft Purview sensitivity labels, remain in preview. The same principle applies beyond one product: preserve the source system’s access-control information, attach it to every indexed chunk, and filter candidates before they reach the model.
Implementation details matter. If one document becomes twenty chunks, every chunk must inherit the same restriction. If a person leaves a group, permission changes must reach the index quickly enough to prevent stale access. Shared vector stores need access restrictions for each tenant (an organization or customer whose data is kept separate), as well as for departments and individual users. When identity or permission data is missing, the system should deny access by default rather than assume access is allowed. Organizations should also encrypt data, protect query and response logs, restrict administrative access, and monitor unusual retrieval patterns.
Controls must also address answer quality. Responses should show their sources and relevant dates so users can inspect the evidence. Content owners should establish review and expiration rules for policies and procedures. Evaluation sets should include ordinary questions, ambiguous requests, attempts to extract restricted data, and questions spanning multiple permission levels. Tests should measure whether the assistant finds useful passages and blocks unauthorized access attempts across different users, permissions, document types, and failure conditions. These tests provide evidence of effectiveness, but no finite set of tests guarantees that every possible unauthorized retrieval will be blocked.
Govern the System Not Just the Model
Technical filtering cannot replace organizational responsibility. The NIST Generative AI Profile recommends managing generative AI risks across design, development, deployment, operation, and evaluation (Autio et al., 2024). For enterprise RAG, that means assigning owners for source collections, documenting which data may be indexed, defining acceptable uses, recording retrieval decisions, and creating procedures for correcting harmful answers and reporting possible exposure.
Organizations should begin with a controlled, human-reviewed pilot using low-risk documents and a small authorized group. Expansion should occur only after tests provide evidence that unauthorized retrieval is blocked under the conditions evaluated, permission changes reach the index correctly, citations remain reliable, and named owners can investigate incidents and approve changes. Security, document, legal, privacy, and business teams should record these results instead of treating a successful demonstration as proof of readiness.
| Question | What a satisfactory answer looks like |
|---|---|
| Identity | The authenticated user and group memberships reach every retrieval request. |
| Permissions | Each document chunk carries current access metadata, and unauthorized matches are removed before model context is built. |
| Evidence | Answers show sources and dates, and the system can decline when support is weak or conflicting. |
| Testing | Evaluation includes leakage attempts, stale permissions, poisoned content, and cross-tenant questions. |
| Accountability | Named owners monitor logs, correct content, investigate incidents, and approve expansion. |
RAG can make organizational knowledge more accessible and useful, but access must remain governed by the underlying resource, not by similarity alone. The central management question is not whether the assistant can find a document. It is whether the organization can prove that the assistant retrieved the right document, for the right person, under current permissions, and communicated its limits. Closing that permission gap is what turns an impressive search demonstration into a responsible enterprise system.
References
-
Autio, C., Schwartz, R., Dunietz, J., Jain, S., Stanley, M., Tabassi, E., Hall, P., & Roberts, K. (2024). Artificial intelligence risk management framework: Generative artificial intelligence profile (NIST AI 600-1). National Institute of Standards and Technology.
-
Krishna, S., Krishna, K., Mohananey, A., Schwarcz, S., Stambler, A., Upadhyay, S., & Faruqui, M. (2025). Fact, fetch, and reason: A unified evaluation of retrieval-augmented generation. Proceedings of NAACL 2025, 4745–4759.
-
Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W., Rocktäschel, T., Riedel, S., & Kiela, D. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems, 33.
-
Magesh, V., Surani, F., Dahl, M., Suzgun, M., Manning, C. D., & Ho, D. E. (2025). Hallucination-free? Assessing the reliability of leading AI legal research tools. Journal of Empirical Legal Studies, 22(2), 216–242.
-
Microsoft. (2026). Document-level access control in Azure AI Search. Microsoft Learn.
-
Open Worldwide Application Security Project. (2025). OWASP top 10 for LLM applications 2025.
-
Pan, J. J., Wang, J., & Li, G. (2024). Survey of vector database management systems. The VLDB Journal, 33, 1591–1615.
-
Zeng, S., Zhang, J., He, P., Xing, Y., Liu, Y., Xu, H., Ren, J., Wang, S., Yin, D., Chang, Y., & Tang, J. (2024). The good and the bad: Exploring privacy issues in retrieval-augmented generation (RAG). Findings of the Association for Computational Linguistics: ACL 2024, 4505–4524.
-
OpenAI. (n.d.). Morgan Stanley uses AI evals to shape the future of financial services.



