Imagine a consultant loses access to an internal project note on Friday. On Monday, the company’s assistant can still summarize it because a cached answer or indexed copy remains available. This is a hypothetical lifecycle failure: the source folder is correctly locked, but another copy still serves the old permission. Testing the original upload alone would miss it.
Locate the permission decision before the answer
OWASP’s November 3, 2026 publication of GenAI Data Security Best Practices v2 Part 1 provides a recent data-security signal. The narrower engineering question here is how your assistant handles document permissions over time. OWASP’s data-security resource.
RAG retrieves material to include in a model’s context. OWASP recommends preserving access metadata on document chunks and enforcing permission before that material reaches the model. A prompt asking the model to keep secrets cannot substitute for this boundary. OWASP RAG security guidance.
Sketch where your product chooses the document set, checks permissions and assembles context. Include a reranker or follow-up retrieval if one exists. Observe the selected context in an authorized test environment; checking only the final prose can hide a retrieval error that the model happened not to repeat.
Build a small document fixture
Create a few invented documents whose expected visibility is easy to verify. The following fixture stays within one test workspace so it examines document-level permissions, rather than repeating a general customer-isolation test.
| Synthetic document | Initial visibility | Distinctive test fact |
|---|---|---|
| Shared project handbook | Staff and test consultant | The review room is named Cedar |
| Engineering-only implementation note | Engineering staff | The fictional release label is Amber Kite |
| Temporary consultant briefing | Staff and test consultant until revoked | The sample delivery route is Orchard Ferry |
Ask ordinary questions that should retrieve each fact, plus paraphrases that avoid its exact wording. Confirm an authorized user can retrieve the protected document first. Otherwise, a missing answer from the consultant might simply mean the index never contained the document.
For every query, record the user, expected document set, selected chunk identifiers, context contents in the restricted test trace, and final response. Inspect citations and previews too: an answer can omit the fact while exposing a restricted filename or passage. The SaaS tenant isolation guide covers the separate cross-customer boundary.
Measure what happens when access changes
Microsoft’s document-access overview explains that native query-time controls evaluate permission metadata already synchronized into the index. A source permission change must reach that metadata through the documented update mechanism. Some native approaches are preview features; check your deployed version. Azure AI Search document permissions.
Revoke the test consultant’s briefing access and record the time. Query immediately, after the documented synchronization step, and after the system’s declared revocation deadline. Record the first point at which the protected chunks stop entering new context. If the product promises immediate revocation, an eventual update does not satisfy that promise.
Test inherited permissions separately from direct document grants. In Microsoft’s SharePoint indexer preview, parent-scope permission changes require an explicit refresh even though certain item-level changes are detected incrementally. This illustrates why a successful file-level test cannot establish folder-level behavior. SharePoint permission synchronization.
Document the accepted delay and the mechanism that denies access during it. If synchronization fails, the owner needs an observable failure and a defined restriction path, not an indefinitely stale permission.
Warm the cache before testing denial
First ask as an authorized staff user and verify that the answer uses the protected note. Then ask the same question as the consultant, using a separate session. Repeat with a paraphrase if the application uses semantic caching, which reuses answers for similar questions. Keep the expected permission rule identical.
A cache hit still needs the relevant authorization checks. OWASP’s cache guidance addresses application caches as well as HTTP caches and recommends testing stored responses after access changes. Check every cache actually present in your request path. OWASP web cache security.
Run the revocation case with a warm cache and a cold cache. If only the warm case leaks, record the entry’s origin and invalidation behavior. Also test a new conversation: that separates a newly retrieved answer from content the same user had already received in an earlier chat.
Permission changes must reach every serving copy.
The test briefing starts accessible, then loses access and is removed from active retrieval.
Seed the fixture
Index harmless facts with explicit document permissions.
Trace retrieval
Compare the caller’s access with the chunks sent to the model.
Revoke and repeat
Change access, warm the cache and verify the next query.
Delete and verify
Check indexed chunks, previews and reusable answers.
Each check uses a known synthetic document, an expected access rule and an observable result.
Delete the document and follow its copies
Use a disposable copy of the briefing for deletion testing. Record the parent document identifier and associated chunk identifiers before removing it. Verify the next permitted retrieval, citation preview and cached response no longer supply that deleted copy. Check background re-indexing too, so an old job does not restore it.
Deletion is implementation-specific. Microsoft documents that Azure Storage indexers require an explicit deletion strategy; removing a blob alone does not establish that its search document disappeared. Its guidance also identifies limitations for one-to-many indexing. Check the strategy used by your chunking pipeline. Azure AI Search deletion detection.
Separate removal from live retrieval from the handling of backups, audit records and previously delivered answers. Write down each store’s owner and retention behavior. Do not report “all copies deleted” from a single successful search test. For this check, the immediate acceptance condition is that deleted content cannot re-enter a new answer through the tested paths.
Retain a reproducible permission test
Keep the synthetic fixture, user membership, index version, synchronization events, cache state and query trace together. After a repair, rerun the original leak case and an allowed retrieval. Repeat the affected checks when you change chunking, permission mapping, retrieval routing or answer caching.
Protect the evidence itself. Routine logs should avoid full sensitive documents and credentials; retain only the necessary restricted test capture. OWASP logging guidance.
A Sectiv assessment can be scoped around the retrieval path and access rules described here. Our software combines AI-assisted web, API and source testing with validation and expert configuration and support. Book a demo with the document lifecycle you want to examine.
Common questions
Does a private vector database prevent RAG data leakage?
It limits who can connect to the database. The application still needs to decide which documents each user may retrieve. Test the document permission rule through the assistant’s own request path.
Is a refusal from the assistant a passing result?
Only if the relevant protected content was also excluded from the model context and other output surfaces. A refusal can hide an earlier retrieval mistake. Inspect the selected chunks, citations and response using synthetic fixtures.
Can revocation remove an answer someone already received?
It cannot reliably retract content already delivered to that person. Define the behavior for existing chats and stored transcripts separately, and ensure new retrievals and shared caches respect the changed access rule.
YOUR NEXT STEP
Make your AI security checks specific to your business.
Bring the workflow, permission rules and test environment to scope a Sectiv assessment.
Book a demoReferences & further reading
- GenAI Data Security Best Practices v2 – Part1
- OWASP RAG Security Cheat Sheet
- Document-level access control in Azure AI Search
- Use a SharePoint indexer to ingest permission metadata
- OWASP Web Cache Security Cheat Sheet
- Change and delete detection using indexers for Azure Storage in Azure AI Search
- OWASP Logging Cheat Sheet

