01
Tenant isolation in the database
- Every tenant-owned record carries a company identifier.
- Row level security is enabled on every exposed tenant table.
- Policies check membership and role using a fixed, empty search path so a caller cannot redirect lookups.
- Composite foreign keys make cross-company references impossible, not merely discouraged.
- Anonymous database access is revoked rather than restricted.
- Service credentials never reach the browser or a client bundle.