RAG Data-Leakage and Access-Control Testing
Test whether your RAG pipeline leaks documents across users, roles or tenants through retrieval, caching, citations or logs, using seeded canary documents and role-based test personas.
- Capability:
- AI Security & Compliance
- Industry:
- SaaS & AI Product Companies
Who it is for
- CTO of a multi-tenant SaaS
- Head of Platform Engineering
- CISO
- AI Search or Copilot Product Lead
The problem
RAG lets your assistant answer from customers' own documents, tickets and records. It also creates a new path to that data: a query, an embedding search and a prompt. If permissions are not enforced at retrieval time, or if caches and logs mix tenants, one customer's question can surface another customer's content.
Filters applied after retrieval
Permissions checked only after the top results are fetched, or only in the UI, can still leak content into the prompt and the answer.
Shared indexes across tenants
A single vector index with metadata filters is only as safe as every query path that remembers to apply them.
Stale permissions
When a user loses access to a document, its chunks often stay retrievable until the next full re-index.
Leakage outside the answer
Citations, semantic caches, analytics events and tracing tools can carry another tenant's chunks even when the answer looks clean.
What we build
We test your RAG feature for data leakage and access-control gaps from the outside in and the inside out. We seed each test tenant, role and user with unique canary documents, then use test personas to query through every entry point: chat, search, API and integrations. Any canary that appears in an answer, citation, cache hit, log or trace where it should not is a finding. We also review the retrieval code path, index design and permission sync, test what happens when access is revoked or a document is deleted, and check whether uploaded documents can carry instructions that change the assistant's behaviour. Findings map to OWASP LLM risks for sensitive information disclosure and vector and embedding weaknesses.
- Canary documents seeded per tenant, role and user to detect leakage
- Persona-based queries across chat, search, API and integration entry points
- Permission revocation and deletion tests for stale chunks
- Cache, citation, analytics and trace leakage checks
- Indirect prompt injection tests through uploaded or synced documents
- Review of retrieval code paths, index design and permission sync
How it works
- 01Map the data pathWe map ingestion, chunking, indexes, permission sync, retrieval, caching and logging for the RAG feature.
- 02Seed canariesUnique canary documents are added for each test tenant, role and user.
- 03Query as each personaTest personas query through every entry point and try to reach content they should not see.
- 04Change permissionsWe revoke access, delete documents and move users between groups, then query again.
- 05Detect and reviewCanary hits in answers, citations, caches and traces are flagged and confirmed by a tester.
- 06Report and retestFindings come with fixes to retrieval filters, index design or sync, and are retested after changes.
Architecture
- Data path review
- Ingestion and chunking review
- Index and namespace design review
- Permission sync review
- Test setup
- Canary document generator
- Test tenants, roles and personas
- Test execution
- Entry point drivers for chat, search and API
- Permission change scripts
- Detection
- Canary detector across answers and citations
- Cache, log and trace scanner
- Reporting
- Tester review
- Findings with leakage paths and fixes
Inputs and outputs
Inputs
- Staging environment with at least two test tenants
- Test users for each role and permission level
- Architecture of ingestion, vector store and retrieval
- Read access to logs, traces and caches in staging
- List of connected sources such as Google Drive, SharePoint, Confluence or Jira
Outputs
- Data path diagram with trust boundaries
- Leakage findings with exact path and evidence
- Revocation and deletion test results
- Fixes for retrieval filters, index design and permission sync
- Reusable canary test suite
Where people stay in control
A tester confirms every canary hit and traces the leakage path before reporting it. Your engineers decide on the fix, such as per-tenant indexes or retrieval-time permission checks.
Integrations
- Vector stores such as pgvector, Pinecone, Weaviate, Qdrant, Elasticsearch or OpenSearch
- Connected sources such as SharePoint, Google Drive, Confluence or Jira
- Identity provider and permission service
- Tracing tools such as Langfuse or LangSmith
- CI pipeline for canary regression
Guardrails
- Synthetic canary content only, never real customer documents
- Testing limited to test tenants in staging
- Canaries removed after testing
- Findings shared only with named contacts
- Read-only access to logs and traces
Compliance notes
- Maps to OWASP Top 10 for LLM Applications categories for sensitive information disclosure and vector and embedding weaknesses.
- Evidence of tenant isolation supports obligations on access to personal data under GDPR and the DPDP Act 2023.
A typical pilot
Duration: 2 to 3 weeks
One RAG feature with two or three test tenants and its main connected source, tested in staging.
Deliverables
- 01Data path diagram
- 02Canary test suite
- 03Findings report with fixes
- 04Retest results
- 05Suite handed over for CI
What we measure
- Leakage paths found
- Confirmed canary exposures by path: answer, citation, cache, log or trace.
- Revocation lag
- Time between revoking access and the document no longer being retrievable, measured in tests.
- Entry points covered
- Entry points tested against those in scope.
- Retest results
- Leakage paths confirmed closed after fixes.
FAQs
01Do you need access to our customers' data?
No. We work only with synthetic canary documents in test tenants. That is enough to show whether isolation holds.
02We use metadata filters in a shared index. Is that unsafe?
Not necessarily. It depends on whether every query path applies the filter and whether caches and logs respect it. Testing shows where the gaps are; some teams then move high-risk tenants to separate namespaces or indexes.
03Can uploaded documents change how the assistant behaves?
They can, if retrieved text is treated as instructions. We test this with planted content and recommend ways to keep retrieved data separate from instructions.
04How do we keep this tested after the first round?
The canary suite can run in CI on every change to retrieval, indexing or permission sync, so regressions are caught before release.
Related use cases
- SaaS & AI Product Companies
LLM Application Penetration Test (OWASP LLM Top 10)
A scoped pentest of your LLM feature and the app around it: prompt injection, data disclosure, output handling, excessive agency and system-prompt leakage, with reproducible evidence.
- SaaS & AI Product Companies
Continuous AI Security Regression in CI
Run versioned prompt-injection, jailbreak and data-leakage suites in CI on every prompt, model, tool or index change, and block releases that regress past agreed severity thresholds.
- Capital Markets & Wealth Management
Data-Leakage Testing for Internal Research Copilots
Test internal research and RM copilots for leakage across information barriers, research entitlements and client data, including prompt injection through ingested documents.
- Legal
Confidentiality and Privilege Leakage Testing for Legal AI
Test your legal copilot, contract tool or client chatbot for cross-matter leakage, privilege exposure, prompt injection hidden in documents and weak access controls, with evidence and fixes.

Founded by Akhilesh Mittal. 8 years building a security platform for a New Zealand company. IIT ISM Dhanbad and IMT Ghaziabad. Builds production agentic AI.
Scope a first test on one AI feature
Pick the LLM feature, agent or voice bot that worries you most. We will agree a short written scope and show you verified findings with evidence.