Generate Supabase RLS Policies
briefkit_generate_rls_policiesGenerate complete Row Level Security (RLS) policies for Supabase tables and user roles, with SELECT, INSERT, UPDATE, DELETE policies per role, admin overrides, and security notes for server-only tables.
Instructions
Generate complete Row Level Security (RLS) policies for Supabase — SELECT, INSERT, UPDATE, DELETE policies for each table and role combination. Includes security notes and server-only table restrictions.
Args:
tables (array of strings): Table names to generate policies for
roles (array of strings): User roles in the application
Returns: Complete SQL with RLS enable statements, per-table policies, admin overrides, and security notes. Handles server-only tables (payments, audit_log, webhook_events) automatically.
Examples:
"Generate RLS for profiles, orders, payments with Owner and Member roles" -> tables=["profiles", "orders", "payments"], roles=["Owner", "Member"]
"RLS policies for a marketplace with Seller and Buyer" -> tables=["profiles", "listings", "orders", "reviews", "payments"], roles=["Owner", "Seller", "Buyer", "Admin"]
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tables": "<tables>",
"roles": "<roles>"
},
"name": "briefkit_generate_rls_policies"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tables | Yes | Table names to generate RLS policies for | |
| roles | Yes | User roles in the application |