Skip to main content

Multi-tenant RAG retrieval leakage: vectors aren't anonymous, and filtering by user isn't always isolation

VolumeVolume 4 · RAG and agentsTechniqueRAG & agent privacyAudiencePrivacy Engineer · Security Engineer · ML EngineerPrivacy riskHighMaturityExperimentalEvidenceOfficial docs

In one sentence: multi-tenant RAG privacy depends on authenticated identity, document authorization, retrieval / re-ranking / context, and caches together. Vectors are not anonymization, and namespaces do not authorize callers. Filter before unauthorized content leaves the trusted boundary; post-filtering inside a trusted retrieval service is not inherently a disclosure, and Azure security trimming is not invariably application-side post-filtering.

Mechanism: what happens on my side​

I answer from supplied retrieval results; I cannot replace system decisions about each chunk’s authorization. A trusted backend derives tenant scope from authenticated identity and current permissions, supplying allowed documents to retrieval, re-ranking, and generation. Unauthorized content sent to an external model, re-ranker, user-visible response, or log is a separate disclosure point.

Embedding inversion is a related representation risk: with raw vectors, an attacker can attempt reconstruction under particular encoders / priors. Not every vector is inevitably recoverable verbatim; see embedding inversion.

Threat surface: where authorization can be lost​

  • A caller forges tenant / namespace / group_ids and the backend trusts them.
  • Retrieval is correct but re-ranking, context, traces, caches, exports, or backups use broader rights.
  • Permissions are revoked but stale caches or persistent memory still return content.
  • Source text is restricted while raw vectors are downloadable, enabling inversion attempts; at-rest encryption does not stop a credentialed query service reading them.

How the defense works​

Separate authentication, authorization, and partitioning: namespaces / shards control where data lives; permissions control who can select it. A trusted backend binds identity and checks authorization before retrieval results leave its boundary. ANN pre-filtering / post-filtering are execution and recall choices, not binary safety labels. Filtering after content already reached a model or external log is too late.

Buildable recipe​

SystemChecked primitiveAdditional authorization condition
PineconeNamespace-level partitioning; shared-index metadata approaches also documentedSelect namespaces from identity; do not permit arbitrary caller switching
Azure AI SearchOData security filters; separate native ACL supportA string principal is not authentication; bind filters in a trusted backend. Check vector pre/post modes separately
WeaviateSeparate shard per tenantRestrict tenant selection, collection rights, and credentials
QdrantPayload tenant fields / indexes and tiered multitenancyPartition optimization is not automatic authorization; check JWT/server filters and read/write endpoints
PostgreSQL / pgvectorRLS and FORCE ROW LEVEL SECURITYSuperusers/BYPASSRLS still bypass; owners normally bypass. Use low-privilege app roles, trusted tenant variables, and pool resets
1. Derive identity and current ACL from authenticated sessions; reject arbitrary caller-selected tenants/groups.
2. Scope queries, re-ranking, generation, raw-vector exports, traces, and caches consistently.
3. Minimize sensitive indexed fields; retain lineage for document/vector/cache erasure and revocation.
4. Insert synthetic tenant canaries; test reads/search/exports/updates/post-revocation using distinct real identities.
5. Keep positive controls for legitimate same-tenant and authorized-shared access; blanket denial is not isolation success.

Minimal testable assertion: under A/B identities, B cannot retrieve A’s unauthorized canary through responses, model / external-re-ranker context, returned vectors, user-visible traces, or caches, while A’s allowed read succeeds. Repeat after revocation and cache updates. All assertions must hold together; finite success does not prove every path safe.

Real cases and product scope​

Official docs describe deployable primitives; this entry does not certify individual account configurations. Azure’s security-filter pattern is string-based query filtering without authenticating the principal; native ACL and data-source / API eligibility require separate checks. PostgreSQL’s current stable documentation is 18 while 19 remains RC; a “current” URL does not identify your deployment version.

OpenAI’s 2023 cache incident is an adjacent state-isolation failure, not a vector-RAG disclosure demonstration. The provider reports possible exposure affecting about 1.2% of Plus subscribers active in a particular nine-hour window, not confirmed viewing of all affected records. It illustrates the need for shared-state authorization and ownership checks.

Residual risk and trade-offs​

Strict authorization can change recall and cost; measure the effect rather than assume a shared large index always improves recall over correct partitioning. Filters do not recover already-exported vectors or old logs; propagate permission changes and erasure. Cross-session bleed and data lifecycle expand these state concerns.

Version notes​

Applicable versions

Checked Pinecone / Weaviate / Qdrant, Azure security/vector filters, PostgreSQL RLS, and embedding research on 2026-10-29. Actual account permissions were not inspected; native ACL source/API eligibility and preview status need deployment-time checks. Review by 2026-12-29, earlier for identities, ACL/tenant APIs, RLS roles, re-ranking/logging/caching, or product eligibility.

Further reading and sources​