Authorization inside your Postgres. Sharing, groups and nested folders in one policy file, compiled to row-level security. No second service, no data to sync.
The rules read the tables your app already has. Relations come from your own columns and link tables, permissions are built from them and inherited down trees of folders or teams. Nothing to copy into an authorization service and keep in step.
Enforced by Postgres
Row-level security filters every read and checks every write. The app signs in each transaction and queries its tables as usual. A refused write says which rule and why.
A change you can review
Tests next to the policy, invariants checked in many small worlds, and on each pull request a review that says who gains or loses access.
Plain SQL, shipped as migrations
Each change to the policy is a migration for the tool your app already uses (Alembic, Django, Prisma, Drizzle Kit, Rails, Laravel, Ecto, EF Core, sqlx, goose, dbmate, Flyway or plain SQL). Any Postgres 16, 17 or 18. No extension, no superuser, and what lands in the database is SQL you can read.
app role app_user -- the Postgres role the app connects astype user = app.userstype folder = app.folders owner : user = owner_id -- a relation read from a column parent : folder = parent_id editor : user = app.folder_editors(folder_id -> user_id) -- ... or from a link table can edit = owner or editor or parent.edit -- inherited down the tree can view = editrules app.folders select : view update : edit update owner_id : owner -- only the owner gives it away update parent_id after : parent.edit -- moved only under a folder they may edit
The app says who is asking, then runs its usual queries:
sql
BEGIN;SELECT authz.act_as('user', '42');SELECT * FROM app.folders; -- only the folders 42 may viewUPDATE app.folders SET name = 'Plans' WHERE id = 7; -- 0 rows unless 42 may edit folder 7COMMIT;
The SDKs turn a write that changed nothing into a 404 (the row can't be seen) or a 403 that says which rule refused it and why.
It fits when your app's data is in one Postgres database, and who may see or change a row depends on other rows: its owner, the members of a team (teams inside teams), a folder or a project that passes access down, a tenant, what people share with each other. It is for you if you were about to add an authorization service and keep it in step with the database, or if your hand-written row-level security has become hard to test and to change.
It doesn't fit when what decides access is in several databases or outside Postgres, when a browser reads the tables through Supabase's Data API, or when one tree takes many moves and links a second. And if you need an outside audit or a vendor behind it today: rowstile is in beta, with one maintainer, and nobody outside has audited it.
Next: Getting started goes from a schema to a policy, its tests, the edit loop and the first migration. Pick your stack for the SDK that does the signing in for you.