Skip to content
Back to skills

Multi Tenancy

ASecurity

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).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgosecurity

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill multi-tenancy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Multi Tenancy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Multi Tenancy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-multi-tenancy/badge)](https://www.skillsdirectory.com/skills/vectora-os-multi-tenancy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.