saas-multitenancy
Skill0 starsChanged 12 days agoMITView on GitHub
Enforce multi-tenant data isolation, trusted tenant context, row-level security, and noisy-neighbor limits. Use for shared customer infrastructure, not membership lifecycles or private agent context sharing.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- TheWayWithin/agent-11their own version, first seen Aug 4, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- TheWayWithin/agent-11★ 20same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository68 other files it gives its agents.
- skills/web-development/adapters/copilot-instructions.mdCopilot instructions
- accessibility-auditSkill
- agent-handoffSkill
- ai-tool-securitySkill
- api-designSkill
- audit-loggingSkill
- background-jobsSkill
- bulk-reporting-exportSkill
- changelog-generatorSkill
- ci-cdSkill
- codebase-onboardingSkill
- code-reviewSkill
- code-simplificationSkill
- context-engineeringSkill
- context-privacySkill
- data-import-exportSkill
- debuggingSkill
- dependency-auditSkill
- deprecation-and-migrationSkill
- design-tokensSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- environmental-telemetrySkill
- erp-accountingSkill
- erp-domain-designSkill
- erp-inventorySkill
- erp-procurementSkill
- erp-salesSkill
- feature-flagsSkill
- forms-and-validationSkill
- frontend-stateSkill
- frontend-ui-engineeringSkill
- git-workflowSkill
- identity-access-managementSkill
- incremental-implementationSkill
- java-code-standardsSkill
- java-deliverySkill
- kerangkaSkill
- mcp-builderSkill
- membership-managementSkill
- observabilitySkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- product-analyticsSkill
- quarkus-observabilitySkill
- quarkus-persistenceSkill
- quarkus-securitySkill
- quarkus-serviceSkill
- quarkus-testingSkill
- responsive-layoutSkill
- rest-api-contractSkill
- saas-billingSkill
- saas-onboardingSkill
- security-hardeningSkill
- shipping-and-launchSkill
- skill-creatorSkill
- skill-evaluationSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
Test two tenants with colliding identifiers, absent and forged scope, reused connections, failed transactions, exports, and retries.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SaaS Multi-Tenancy
Overview
Make the tenant boundary enforceable across requests, persistence, asynchronous work, and shared infrastructure. Authentication, membership, and isolation are separate checks.
When to use
- Choosing pooled, schema, database, or infrastructure isolation for customer data.
- Preventing cross-tenant access in queries, caches, files, search, exports, and workers.
- Testing connection-pool reuse and per-tenant resource fairness.
Hand off when
| Need | Skill |
| Invitations, member status, and owner transfer | membership-management |
| Tenant provisioning, suspension, and deletion | saas-onboarding |
| Private agent notes and context audiences | context-privacy |
| Quarkus persistence implementation | quarkus-persistence |
Process
- Classify global and tenant-owned data. Choose isolation from contractual residency, restore, scale, and operational requirements; document residual shared-service risks.
- Resolve a requested tenant, then verify the authenticated actor's active membership or scoped service credential. A header, host, URL, or signed stale claim is not enough.
- Propagate immutable verified scope explicitly or through a correctly bounded runtime context. Fail closed when missing; clear it after each request and worker execution.
- Enforce scope on reads and writes, including raw SQL and bulk operations. In pooled schemas use scoped unique keys and composite foreign keys to prevent cross-tenant links.
- For PostgreSQL RLS, use a restricted runtime role and transaction-local settings on the same connection. Check both USING and WITH CHECK; test privileged bypass separately.
- Namespace caches, search filters, storage objects, signed downloads, and job payloads. Workers verify job ownership and current policy before constructing fresh context.
- Apply aggregate tenant quotas, concurrency limits, and bounded queues; optional IP limits supplement rather than replace tenant-wide noisy-neighbor controls.
- Test two tenants with colliding identifiers, absent and forged scope, reused connections, failed transactions, exports, and retries. Never use an admin role only.
Red flags
- Treating RLS, database-per-tenant, or a tenant ID in a message as an absolute guarantee.
- Runtime roles with superuser, BYPASSRLS, ownership, or unnecessary privileged functions.
- Client-selected scope, unscoped foreign keys, or context surviving connection reuse.
- Assuming every identity must be duplicated per tenant instead of classifying global data.
Verification
- Cross-tenant reads, writes, links, files, and exports are denied under the runtime role.
- Missing scope fails closed; connection and worker reuse never inherit another tenant.
- Per-tenant restore, throttling, and privileged administration have explicit boundaries.
References
references/isolation-strategies.md- isolation choices and transaction-safe RLS.references/tenant-context.md- verified scope across synchronous and asynchronous work.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

