Tenant isolation is enforced by Postgres, and the API refuses to boot without it
Every tenant-scoped table has row-level security enabled and forced, with a tenant_isolation policy keyed on the request's tenant id, so an unscoped query returns zero rows rather than everything. The app connects as a role that cannot bypass those policies; the handful of pre-login lookups run through SECURITY DEFINER functions owned by a separate no-login role with a pinned search_path. At boot the API checks every one of those tables is forced and policied and refuses to start, naming the table, if any is not.
Where this livespackages/db/prisma/migrations/20260907000000_rls_roles_grants_policies/migration.sql · apps/api/src/server.ts

