Part 6 of 12 · 2 min read
What the simulation measured
Cross-tenant failures with and without each control, and the isolation-strength trade-off.
How to read the failures table: each row compares the same scenario with and without one specific control; "0" in the right column means the control fully closed that particular leak.
| Failure (simulated) | Without the control | With the control |
|---|---|---|
| Filter forgotten (100 endpoints) | 60 other-tenant rows | 0 (scoped repository) |
| Tenant id from the model (1,000 injected attempts) | 306 leaks | 0 (tenant from session) |
| Shared cache key (4,000 requests) | 2,675 wrong-tenant answers | 0 (tenant in key) |
| Small tenant retrieval, post-filter top-5 | 0.00 to 1.03 of 5 own results | 5 of 5 (namespace) |
| Noisy neighbour: tenant B served | 24% | 100% (per-tenant quota) |
| Offboarding with an incomplete registry | data left in 2 of 6 stores | none (full registry) |
What to notice: the cache row is the largest leak by count (2,675 of 4,000) and the cheapest to fix. The only change needed is folding the tenant into the cache key, shown in cache_leak_sim as (t, p) if tenant_keyed else p.
An erasure registry is what the last row depends on. It is a plain list of every store that offboarding has to reach: primary database, vector index, response cache, trace store, object files, and backups. Knowing only 4 of the 6 stores above left data behind in exactly the 2 the registry did not know about. Nothing can be erased from a store nobody remembered to list.
How to read the isolation-strength table: read top to bottom as both the strength of the boundary and its cost increase together; there is no option that is both strongest and cheapest.
| Isolation model | Strength | Cost |
|---|---|---|
| Shared tables, scoped queries, RLS | relies on code and policy correctness | lowest |
| Schema or namespace per tenant | stronger boundaries, per-tenant erasure | medium |
| Database or deployment per tenant | strongest, per-tenant keys and regions | highest |
What to notice: most of this module's fixes (scoped repositories, namespaces, tenant-keyed caches, quotas) live in the cheapest row. They close the specific leaks measured above. They do not require a full database-per-tenant architecture.
{{svg:boundaries|Where tenant data can cross, and the control at each place.}} {{svg:results|Cross-tenant failures with and without controls.}}