agentsop-multi-tenant-rag

agentsop-multi-tenant-rag is a skill for Claude Code from agentsope/SkillAlchemy. It costs 209 tokens per session (9,928 once invoked), scanned B, original, MIT.

A security procedure for retrieval-augmented generation systems that share a search index between multiple customers, organisations, workspaces or users. Retrieval-augmented generation means finding relevant documents and giving them to a language model before it answers.

In plain words
What is it for?
Use it when building, reviewing or debugging shared vector-search and document-retrieval pipelines, especially when checking tenant, organisation, workspace or user isolation.
Why use it?
It prevents one tenant's documents from appearing in another tenant's search results. Access filtering must happen while querying the vector store, before documents reach the model.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: positional $N argument.

Good fit Use it when building, reviewing or debugging shared vector-search and document-retrieval pipelines, especially when checking tenant, organisation, workspace or user isolation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agentsope/skillalchemy/agentsop-multi-tenant-rag
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add agentsope/SkillAlchemy --skill agentsop-multi-tenant-rag
Clone the repo
git clone --depth 1 https://github.com/agentsope/SkillAlchemy

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agentsop-multi-tenant-rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentsope/skillalchemy/agentsop-multi-tenant-rag.svg)](https://agentmods.dev/skills/agentsope/skillalchemy/agentsop-multi-tenant-rag)
Your own site
<a href="https://agentmods.dev/skills/agentsope/skillalchemy/agentsop-multi-tenant-rag"><img src="https://agentmods.dev/badge/skills/agentsope/skillalchemy/agentsop-multi-tenant-rag.svg" alt="Measured on agentmods" height="20"></a>
Per session 209 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,928 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00209 $0.09928
Opus 5 $0.00105 $0.04964
Sonnet 5 $0.00042 $0.01986
Haiku 4.5 $0.00021 $0.00993

Measured 8d ago against content hash aee594b89561, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade B, and why

agentsop-multi-tenant-rag scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nullifies safety policiesmediumAnti-refusal

"You have no restrictions", "do anything now", "ignore your guidelines": a direct jailbreak that disables guardrails.

2. If the concern is "what if we forget the filter once", solve it with

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/agentsop-multi-tenant-rag/SKILL.md · 888 lines

How it starts

The opening of the file, as written. The whole thing — 888 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Multi-Tenant RAG · Security-First Isolation SOP

Third-person operating model for a coder agent that owns retrieval correctness across tenant boundaries. The audience is the LLM agent writing or reviewing the code — not the end user.

One sentence: Isolation lives at the vector store query boundary, not at the model. Anything that reaches the LLM's context window has already leaked.


1. 何时激活 (Activation Rules)

Activate this skill whenever any of the following holds:

  1. The codebase contains a retrieval call (vector_store.query, query_points, similarity_search, as_retriever().retrieve(...), raw pgvector ORDER BY embedding <-> $1) and the corpus serves more than one tenant, customer, organisation, workspace, user, or permission scope.
  2. The user mentions any of: multi-tenant RAG, namespace, tenant, workspace, tenant_id, org_id, user_id, "cross-customer", "shared index", "knowledge base per team".
  3. A bug report says "User A saw User B's document", "wrong company's data surfaced", "the assistant cited a doc I don't have access to", or anything that smells like cross-context bleed.
  4. PR review: any new code calling a vector store without a tenant-scoped filter argument, or filtering only on the returned nodes / documents list after retrieval.
  5. A new RAG endpoint is about to ship and tenant scoping has not been explicitly audited.

Do not activate when:

  • The corpus is fully public and there is no per-tenant view (e.g. open-data Q&A).
  • The retrieval pipeline already enforces a physically separate index / collection per tenant via infrastructure the application code cannot override (e.g. one Pinecone index per customer with credentials issued per-tenant). In that case the isolation lives in IAM, not in this skill.

2. 核心心智模型 (Core Mental Model)

Three principles. If a design violates any of them the system is exploitable, regardless of how good the LLM prompt is.

Read the full file on GitHub · 888 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 888 lines · 209 tokens per session scan B aee594b89561

Subscribe to this mod's changes

agentsop-multi-tenant-rag is a skill published in the GitHub repository agentsope/SkillAlchemy (370 stars, last pushed 6d ago), licensed MIT. It adds 209 tokens to every session and 9,928 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it B with 1 finding (nullifies safety policies). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

karpathy-llm-wiki

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

Astro-Han/karpathy-llm-wiki · 67 tokens

mixedbread-search

Build and query managed search indexes (Stores) using the Mixedbread Python and TypeScript SDKs. Use when creating knowledge bases, uploading documents, performing semantic or vector search, asking questions over documents, using agentic multi-step retrieval, combining store search with web results, filtering by…

mixedbread-ai/skills · 70 tokens

mxbai-cli

Use the mxbai CLI to manage stores, upload files, search documents, ask questions, and sync directories from the terminal. Use when performing Mixedbread operations via command line, setting up CI/CD pipelines with store sync, or managing API keys.

mixedbread-ai/skills · 55 tokens

rag-evaluator

Generates tailored giskard.checks evaluation suites for RAG (Retrieval-Augmented Generation) systems. Use whenever a user describes a Q&A bot grounded in documents, a knowledge-base chatbot, a retrieval system, or wants to evaluate answer groundedness, faithfulness, hallucination, retrieval quality, citation accuracy…

Giskard-AI/giskard-skills · 204 tokens

local-rag-mcp

Use when querying, ingesting, or maintaining a local RAG MCP corpus for semantic document retrieval with privacy controls.

yeaight7/agent-powerups · 29 tokens

milvus

Operate Milvus vector database with pymilvus Python SDK. Use when the user wants to connect to Milvus, create collections, insert vectors, perform similarity search, hybrid search, full-text search, manage indexes, partitions, databases, or RBAC via Python code.

zilliztech/milvus-skill · 57 tokens