You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
P0: collectRLSPolicies silently strips authored org-scoped RLS policies when org-scoping is inactive (ADR-0105 F1 → D3) #3539
collectRLSPolicies (packages/plugins/plugin-security/src/security-plugin.ts ~L2785-2793) drops any RLS policy whose using expression contains the substring current_user.organization_id whenever org scoping is inactive (!this.orgScopingEnabled):
The comment states the intent: strip the platform's own wildcard tenant policies in single-tenant deployments. But the substring match also swallows app-authored policies that legitimately reference current_user.organization_id. A declared, authored security policy is silently unenforced — exactly the ADR-0049 ("no unenforced security properties") defect class.
Verified on main (2026-07-27). This is finding F1 of ADR-0105; the ADR marks it P0, shipping in the open edition independent of the rest of the ADR (decision D3).
Fix direction (ADR-0105 D3)
Stop substring-matching. Tag the platform's own wildcard tenant_isolation policies with a provenance flag (or match on object === '*' ∧ shipped-by-default), and strip only tagged policies when isolation is inactive.
An authored policy referencing an unavailable context variable follows the existing availability path: fails closed at resolution, surfaced by the isSupportedRlsExpression authoring lint. It is never silently dropped.
Acceptance
Authored policy with current_user.organization_id in using survives collection in a deployment without org scoping (fails closed at resolution, with lint surfacing — not dropped).
Platform wildcard tenant policies are still stripped when isolation is inactive (no behavior change for the intended case).
Activity
feat(authz)!: group tenancy posture + org scope as a first-class dime…
docs(adr): ADR-0105 D12 amendment — group posture activation is entit…