RLS-preserving paths
Keep upstream database roles and PostgREST JWT semantics intact.
Keep tenant authorization in PostgreSQL RLS and application policy. Use Safe Boundary to preserve upstream identity and add read-only controls, masking, inference protection, and audit.
Why this exists
Tenant isolation is application- and schema-specific. Safe Boundary does not infer ownership or inject tenant_id predicates into arbitrary SQL.
It can preserve the role or JWT that drives existing RLS, then prevent raw configured values from leaving routed interfaces. This helps support tools and AI agents that need broad row visibility but not raw secrets.
What it does
Keep upstream database roles and PostgREST JWT semantics intact.
Hide configured customer values from support, analytics, or agent responses.
Record decisions with the identity or attribution available on each surface.
Support-tool scenario
Illustrative workflow: RLS decides which tenant rows are visible; Safe Boundary masks configured columns in the routed support path.
Support request
SELECT tenant_id, email, plan, last_seen
FROM customers
WHERE tenant_id = $1;Expected boundary behavior
Rows: decided by existing RLS
email: configured mask
plan / last_seen: policy-dependent
tenant_id injection: not performedHow it works
Test tenant isolation against each database role and JWT class.
Define columns that stay masked within allowed rows.
Protect support, AI, and REST paths with the matching surface.
Verify direct endpoints are unavailable to constrained callers.
Protected when
Important boundaries
Continue the story
See the exact row-security contract.
Mask PostgREST responses and stop filters from becoming inference oracles.
Understand trust boundaries, credentials, identity, and bypass conditions.
Start in observe mode and validate the policy against representative traffic before you enforce it. That gives the team evidence for each decision, along with explicit bypass controls for the cases that need a deliberate exception.