RLS — Row-Level Security
·article·2026-06-12
RLS — Row-Level Security
Definition
Database-enforced filtering of rows by tenant/project: even a buggy application query cannot return another tenant's data, because the database itself refuses.
Worked Example
Policy sketch:
CREATE POLICY tenant_isolation ON cost_items
USING (tenant_id = current_setting('app.tenant_id')::uuid);
A SELECT without the right tenant context returns zero rows —
regardless of what the application code asked for.
Interpretation & Pitfalls
RLS is defense in depth: application-layer checks fail; the database backstop holds.
In TupicFinance
RLS policies run across the database tables as part of the platform's layered security model.