HomeRulesBND004
BND004 · High severity

Authenticated policy is not tenant-scoped.

Signing in proves identity, not tenant membership. An unconditional authenticated policy can let every customer account reach every row.

Detection condition

The rule reports a policy granted to authenticated when USING or WITH CHECK reduces to true. It intentionally does not guess whether a shared table is safe; intentional shared data can be ignored explicitly after review.

Why it matters

This is a common category error: the policy verifies that a user exists but never relates that user to the organization_id or tenant_id of the protected row.

Typical remediation

Correlate the active identity to the row's tenant through a trusted membership relation. For UPDATE, constrain both the existing row with USING and the proposed row with WITH CHECK.

Unsafe authenticated policysql
create policy "users read projects"
on public.projects for select
to authenticated
using (true);
Protect the boundary

Make tenant isolation a repeatable pull-request check.

Run the deterministic scanner locally without database credentials, then add Cloud only when your team needs shared history.

Find unscoped policies Read the quickstart