Tenant isolation
Isolation between tenants is enforced by the database itself, through PostgreSQL row-level security. It is enabled and forced on every table that holds a tenant's data.
- Requests run under a database role that cannot bypass it, and every request runs in its tenant's context.
- The platform's own work that has no tenant context (sign-in before a tenant is known, the first-run setup, the operator's console, host jobs) uses a separate connection. Every module that touches it is listed with its reason, and a test fails on one that is not.
- The platform's own tables give the application role nothing beyond what each needs, and a test reads the database's grants to hold every exception to its stated reason (since 2026.11.1).
- Filters written in the application's queries are defence in depth, not the boundary.
- Tested in every release, against a real PostgreSQL:
- every route and every MCP tool is asked for another tenant's ids and for a hidden project's, and must answer as if they did not exist;
- the paths that run outside a request (background jobs, exports, signed file links, live updates) each run with two tenants of the same shape, and each must keep to its own.