two-tenant-verify
Skill0 starsChanged 3 days agoMITView on GitHub
Verify tenant isolation by exercising a data change as a second tenant and confirming the first tenant's data is invisible — in the running app, not just tests. Use after changing data-access code on a multi-tenant SaaS, before merging, or when the user asks to prove isolation holds or test for leaks end to end.
In this repository4 other files it gives its agents.
- cross-tenant-leak-reviewerSkill
- hardenSkill
- migration-safety-checkSkill
- tenant-scope-auditSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Boot the stack against the seeded data: Use the project's scripts/dev.sh (or create a one-command launcher if none exists — the friction is …
- Distinctive: line 34
Check the response body, not just the UI — leaked data sometimes renders blank but is present in the payload, cache, or search results.
- Distinctive: line 46
If you could not run the app, say so — do not infer isolation from reading code.
≈ “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
Two-tenant verification
Green tests are not proof of isolation. A test fixture with one tenant will pass even when a query has no tenant filter at all, because there is only one tenant's data to return. The only honest check uses two tenants.
The rule
A data change is done when you have logged in as a second tenant and confirmed the first tenant's data is invisible — in the running app, not just green tests.
Procedure
- Seed two tenants. Adapt the template at
${CLAUDE_SKILL_DIR}/scripts/seed-two-tenants.sql.templateto the project schema. Each tenant gets one clearly-labeled secret row (SECRET-A,SECRET-B). - Boot the stack against the seeded data. Use the project's
scripts/dev.sh(or create a one-command launcher if none exists — the friction is why this step gets skipped). - Exercise the changed path as Tenant B. Authenticate as
user-b@example.comand hit the exact endpoint/page/job the change touched. - Assert the boundary, both directions:
- As Tenant B, you can see
SECRET-Band neverSECRET-A. - As Tenant A, you can see
SECRET-Aand neverSECRET-B. - Check the response body, not just the UI — leaked data sometimes renders blank but is present in the payload, cache, or search results.
- As Tenant B, you can see
- Cover the non-DB vectors the change touched: trigger the background job and confirm it only processed Tenant B's rows; check that cached responses aren't shared; confirm search returns only the caller's tenant.
Report
State exactly what you exercised and what you observed, e.g.: "Logged in as Tenant B, opened /documents and the export job: saw SECRET-B only, SECRET-A absent from the page, JSON payload, and the export file. Isolation holds." If you could not run the app, say so — do not infer isolation from reading code.
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.

