agentsop-multi-tenant-rag

Enforce tenant isolation at vector store query boundaries in RAG pipelines.

287|16|Updated May 20, 2026
One-click install
npx skills add https://github.com/agentsope/SkillAlchemy --skill agentsop-multi-tenant-rag
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agentsop-multi-tenant-rag
Source: https://github.com/agentsope/SkillAlchemy/tree/main/skills/agentsop-multi-tenant-rag
Command: npx skills add https://github.com/agentsope/SkillAlchemy --skill agentsop-multi-tenant-rag

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents cross-tenant data leakage in multi-tenant retrieval-augmented generation (RAG) systems by enforcing tenant isolation at the vector store query boundary, before retrieved content reaches the LLM context.

Core Features & Use Cases

  • Tenant Isolation SOP: Provides a security-first operating model for designing, reviewing, and debugging retrieval pipelines where a shared vector store serves multiple tenants.
  • Query-Time Filter Enforcement: Encodes the non-negotiable rule to filter at the vector store query (and never after retrieval or after rerank), including per-vendor filter syntax and framework adapters.
  • Production-Ready Verification: Includes cross-tenant property tests, runtime assertions, audit logging guidance, and defense-in-depth patterns (namespace/tenant primitives plus filter belt-and-braces).

Quick Start

Ask your coding agent to apply the agentsop-multi-tenant-rag isolation SOP to every vector store query in your multi-tenant RAG pipeline and generate the required cross-tenant tests plus runtime assertions.

Frequently Asked Questions about agentsop-multi-tenant-rag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent cross-tenant data leakage in a multi-tenant RAG pipeline?▼

Prevent cross-tenant data leakage in a multi-tenant RAG pipeline by enforcing tenant isolation directly at the vector store query boundary using deterministic filters, rather than relying on post-retrieval filtering. This ensures secure retrieval.

What is the best way to enforce tenant isolation in a shared vector database?▼

The best way to enforce tenant isolation in a shared vector database is to pass an immutable tenant key from the authenticated session directly into vendor query arguments, applying query-time filters before content reaches the LLM.

Why does filtering tenant data after retrieval fail to secure RAG pipelines?▼

Filtering tenant data after retrieval fails to secure RAG pipelines because sensitive records are already fetched into memory, risking exposure before post-retrieval or rerank operations apply tenant isolation filters.

How do I implement cross-tenant property tests for vector store queries?▼

Implement cross-tenant property tests for vector store queries by writing runtime assertions that verify query-time filters fail closed on violations, ensuring no tenant can access another tenant's data across different frameworks.

Does this multi-tenant RAG isolation approach work with any vector database vendor?▼

Yes, this multi-tenant RAG isolation approach works across frameworks and vendors by adapting per-vendor filter syntax, allowing you to wire deterministic tenant filters into any shared-index retrieval flow.

When do I need to apply query-time filters for tenant isolation in RAG ingestion?▼

You need to apply query-time filters during RAG ingestion by designing metadata with an immutable tenant key from the authenticated session, ensuring the shared vector store can securely scope queries per tenant.