tenant-isolation

Enforce tenant isolation across data queries, storage, and background processing.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/marquesfelip/agents-and-skills --skill tenant-isolation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tenant-isolation
Source: https://github.com/marquesfelip/agents-and-skills/tree/main/skills/tenant-isolation
Command: npx skills add https://github.com/marquesfelip/agents-and-skills --skill tenant-isolation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Multi-tenant applications often leak data across tenants and suffer from inconsistent isolation controls. This Skill provides a structured approach to design, implement, and audit tenant isolation across queries, storage, and background processing.

Core Features & Use Cases

  • Design tenancy models (shared DB, schema-per-tenant, DB-per-tenant) with clear isolation boundaries.
  • Enforce tenant scope at the data-access layer and through database security mechanisms (e.g., row-level security).
  • Harden background jobs and queues to ensure they operate within a single tenant context and cannot process cross-tenant data.
  • Provide end-to-end testing and auditing to validate cross-tenant protections and detect leakage.

Quick Start

Set up tenant-scoped queries and enable tenant-level policies to prevent cross-tenant access.

Frequently Asked Questions about tenant-isolation

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

FAQPage Schema
How do I enforce tenant isolation in a multi-tenant application with a shared database?

Tenant isolation in a shared database is enforced by applying tenant_id tracking at the data-access layer and implementing row-level security policies to restrict cross-tenant access.

What is the best way to prevent cross-tenant data leakage in background jobs?

Preventing cross-tenant data leakage in background jobs requires hardening queues to operate strictly within a single tenant context, ensuring they cannot process data outside their tenant boundary.

How do I design tenancy models for SaaS applications with clear isolation boundaries?

Designing tenancy models involves choosing between shared DB, schema-per-tenant, or DB-per-tenant architectures, ensuring clear isolation boundaries are established across data queries and storage.

Does this approach support testing and auditing cross-tenant access controls?

Yes, tenant isolation includes end-to-end testing and auditing to validate cross-tenant protections, detect leakage, and ensure access controls function correctly across read and write operations.

Can I use row-level security to enforce tenant_id tracking across API boundaries?

Yes, row-level security enforces tenant_id tracking across API boundaries by applying tenant scope at the data-access layer, ensuring read and write operations cannot bypass tenant restrictions.

What are the limitations of tenant isolation in multi-tenant systems?

Limitations of tenant isolation include inconsistent isolation controls across shared databases or per-tenant schemas, requiring structured auditing to identify and prevent cross-tenant data leakage.