Postgres RLS with Tenant Guard
Use the CLI to plan safe Row‑Level Security and validate Prisma changes.
Plan policies
bash
pnpm prisma-tenant-guard rls --planbash
npm exec prisma-tenant-guard rls --planbash
yarn prisma-tenant-guard rls --planbash
bunx prisma-tenant-guard rls --planThis generates RLS suggestions based on your models and tenant keys.
Apply and check
- Apply the generated SQL under a migration.
- Validate:
bash
pnpm prisma-tenant-guard checkbash
npm exec prisma-tenant-guard checkbash
yarn prisma-tenant-guard checkbash
bunx prisma-tenant-guard checkEnforce at runtime
All Prisma access goes through the Tenant Guard extension; unsafe paths throw. Pair with AuthzKit decisions to compile where/select for least‑privilege data access.