RAG is a powerful AI technology enabling LLM’s to retrieve information from a trusted external knowledge base (your documents or data) instead of its own ‘trained’ knowledge. In part 1 of this blog, we described how RAG can increase the quality of the LLM response tremendously. It prevents an LLM from hallucinating and ensures that responses are verifiable and based on reliable documents and data.
Though, RAG introduces several new security aspects that should be considered.
To implement RAG with an AI application, the organization’s proprietary documents or data need to be processed (vectorized) and utilized by the LLM to generate responses. Processing these documents raises extra concerns, particularly for organizations with strict security practices. The primary consideration is determining the suitable level of data governance required for transferring the documents and implementing the organization’s vectorized LLM content. The concerns are grouped into the following topics: data residency, access control, data lineage and audit trails, and data retention.
Organizations have implemented various levels of security policy strictness. The measures outlined below represent a quite strict set of policies. We recommend that organizations choose only those options that correspond to the requirements of their application.
1. Data Residency and Sovereignty
A core aspect of governance is to know where your data is located. When using a cloud RAG service, you need to confirm that your data, including the raw documents and the generated vector embeddings, will remain within your specified geographic region. This is crucial for complying with regulations like GDPR, the EU Data-Act or AI-Act.
- Provider Agreements: Your contract with a cloud provider must explicitly guarantee data residency. Be aware that some services, especially pre-release or “preview” offerings, may store or process data globally.
- Infrastructure Segregation: Ensure the service uses a dedicated infrastructure or a logical partition for your data to prevent cross-contamination with other customers.
- Data in Transit: During transfer from document storage to the RAG service, data should be encrypted using appropriate protocols.
‘To what extent can Providers with data centers outside Europe or with non-European ownership ensure adequate security provisions within their RAG solutions for European organizations?’
Achieving the required assurances in a RAG application also depends upon the third parties involved:
- When using the RAG service provided by an LLM provider, it is essential that the provider delivers the necessary assurances. Although some LLM providers state that they offer a high level of guarantees, these may not always meet the requirements of professional organizations.
- When utilizing a RAG service from an external third party, only those providers that can supply the necessary assurances should be considered.
- When choosing to develop a RAG pipeline internally, all required assurances should be addressed within the project.
2. Access Control and Permissions
Your company’s document management system probably has a sophisticated access control model (e.g., role-based or policy-based access control) that facilitates who can see which document. This same logic must be applied to the RAG system. In this way, users of the AI system employing RAG adhere to the same access control measures for the data or documents processed by the RAG pipeline.
- Document-Level Access: The most significant challenge is to ensure that a user querying the RAG system, can only retrieve and use documents that are authorized to be accessed in your original document management system. The vector database must be able to respect these permissions. This requires a strong integration between your identity and access management (IAM) system and the RAG service.
- Vectorization Pipeline: The process of creating vectors from your documents also has to respect access controls.
3. Data Lineage and Audit Trails
Governance is impossible without a clear, verifiable record of the data’s journey. If this is a requirement within your organization, it is important to provide for the RAG system an equivalent level of auditing as that used for internal documents.
- End-to-End Tracking: Establish a clear data lineage from the original document in your on-premises storage to its chunked form and then to its final vectorized representation. This lineage should be auditable and traceable.
- Comprehensive Logging: The RAG service should provide detailed logs of every action, including:
- Which documents were ingested and when.
- Which user queries led to the retrieval of specific documents.
- Which documents were ultimately used by the LLM to generate a response.
- Tamper-Proof Logs: These audit trails should be stored in a way that prevents them from being altered or deleted, ensuring their integrity for compliance purposes.
4. Data Retention and Disposal
Just as you have policies for deleting old documents, you need to have a protocol for the vectorized data. This can be complex because a single document might be represented by multiple vectors.
- Automated Deletion: The system should support an automated process for deleting vectors and their associated content when the original document is removed or updated. This is crucial for maintaining data hygiene and complying with “right to be forgotten” requests.
- Secure Disposal: When data is deleted, it must completely and securely be erased from all storage locations, including backups, to prevent accidental rediscovery. You should verify the cloud provider’s data destruction protocols.
When users perceive that an AI application provided by the organization addresses the issues mentioned above, they are more likely to trust and use the AI application.
Laiyertech has developed an AI software platform with RAG functionality, designed to address the here forementioned topics at a level appropriate for organizational use. This platform can be deployed on our cloud, the organization’s cloud, or in on-premises environments, and is available under a shared source license.
Our approach is to work collaboratively with your in-house software development team(s) or with your preferred IT vendors to realize an optimal AI application for the organization.
If you are interested in learning more about our experience with RAG and the implementation of RAG in collaboration with in-house software development and infrastructure teams, we will be pleased to discuss this further with you and your experts.