Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Multi Tenancy?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-multi-tenancy)
---
name: multi-tenancy
description: Multi-tenant SaaS — isolation models (pooled, bridge, silo), tenant context propagation, row-level security, noisy neighbours, per-tenant limits, tenant-aware caching and logging, data residency, tenant onboarding and offboarding. Use when serving several customers from shared infrastructure (multi-tenancy, tenant isolation, row-level security, noisy neighbour, SaaS).
metadata:
category: architecture
---
# Multi-tenancy
## Purpose
Serve many tenants from shared systems without any tenant seeing or harming another.
**Use when:** designing or reviewing SaaS data and runtime isolation.
**Not for:** single-tenant deployments.
## Inputs
- Tenant requirements, compliance, scale.
## Outputs
- Isolation model, tenant context design, tests for isolation.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "multi-tenancy"` for prior decisions, patterns and anti-patterns.
## Steps
1. **Model.** Choose pooled, bridge or silo per data class using `decision-analysis`.
Done when model is recorded in an ADR.
2. **Context.** Derive tenant from credentials, propagate through calls, jobs and events.
Done when no code path lacks tenant context.
3. **Enforce.** Enforce in storage (RLS or scoped repositories) and caches.
Done when defense in depth exists.
4. **Test.** Two-tenant tests for every data access path.
Done when cross-tenant access returns 404.
## Best practices
- Tenant id never from request body.
- Per-tenant rate limits and quotas.
## Common mistakes
- Background jobs without tenant scope.
- Cache keys without tenant id.
## Example
Pooled Postgres with RLS policies keyed on `app.tenant_id` set per transaction; isolation tests per repository.
## Reusable prompt
```text
Apply the Multi-tenancy skill (.agents/skills/multi-tenancy/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Choose the isolation model, design tenant context propagation and enforcement, and list isolation tests.
Return: Isolation model, tenant context design, tests for isolation..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```