AST-based
The decision uses parsed PostgreSQL structure, including nested and multi-statement forms.
Safe Boundary parses PostgreSQL statements and resolves selected output to real catalog columns. That supports precise read-only decisions and eligible projection rewrites without fragile regex.
Why this exists
The current product rewrites eligible SELECT projections for masking. It understands aliases, stars, casts, and supported expression shapes well enough to identify protected output and refuse ambiguous cases.
It does not inject tenant predicates, repair application authorization, add arbitrary JOIN conditions, or reinterpret business logic. Those responsibilities remain in grants, RLS, and application policy.
What it does
The decision uses parsed PostgreSQL structure, including nested and multi-statement forms.
Projection output maps to schema types and columns before a mask is selected.
Protected output that cannot be proven safe is blocked rather than passed through raw.
Rewrite boundary
Illustrative SQL only. Safe Boundary does not inject tenant predicates or rewrite arbitrary business logic.
Incoming projection
SELECT customer_id, email, status
FROM customers;Eligible protected projection
SELECT customer_id,
mask_email(email) AS email,
status
FROM customers;How it works
Build a syntax tree from incoming SQL.
Map returned expressions to catalog columns and types.
Apply configured masks to eligible projection output.
Block protected shapes that cannot be rewritten safely.
Protected when
Important boundaries
Continue the story
Configure which columns are protected and preserve compatible response types.
Protect application, ORM, psql, and BI traffic on the PostgreSQL protocol.
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.