Enterprise RAG Security: Permissions, Data Leakage and Multi-Tenancy

2026-10-30

The security boundary is retrieval

A RAG application may combine confidential documents from many teams or customers. The model must never receive content that the requesting user is not authorized to see. Filtering only after generation is too late.

Enforce tenant and document permissions in trusted server code or the database before returning chunks. Vector similarity is a ranking signal, not an access-control mechanism.

Identity and document permissions

Connect the application identity to source-system permissions. Define what happens when access is revoked, groups change or a document is deleted. Store authorization metadata with indexed chunks and verify that it remains synchronized.

Test with two accounts that have different permissions. Include shared documents, revoked access and cross-tenant identifiers in the test suite.

Prompt injection and tool use

Retrieved documents are untrusted input. A malicious file can contain instructions to ignore safeguards, reveal secrets or call tools. Treat retrieved text as evidence, not policy. Keep privileged actions behind deterministic checks and human approvals where appropriate.

If the RAG system can take actions, limit tool scopes, validate arguments server-side and record approvals.

Data lifecycle and privacy

Document where originals, extracted text, embeddings, prompts and logs are stored. Define retention and deletion behavior for each. Minimize personal data in prompts and telemetry, and review the contractual terms of external model providers.

Do not assume embeddings are harmless or anonymous. Treat them as derived data that may still need access controls and lifecycle management.

Operational controls

Use encryption in transit and at rest, scoped service credentials, audit logs, rate limits, monitoring and incident response. Prevent one tenant from exhausting shared resources. Keep a reliable way to disable ingestion or generation when an incident occurs.

Review external parsers, connectors, vector services and model endpoints as part of the system's supply chain.

Audit checklist

Before launch, demonstrate that unauthorized chunks cannot reach the model, revoked permissions take effect, deleted content disappears from search, injection attempts do not override authorization and logs do not expose confidential material.

I can review an enterprise RAG architecture or existing implementation and turn these controls into concrete tests and prioritized engineering tasks.

Need a developer for the long run?

I can start now and work with you for months or years, not hand off after two weeks. Send me a message and we will talk through your project, requirements and next steps.

Ask about experience or services