ShipGuardScan a site

Bolt.new + Supabase RLS Checklist

Updated 2026-10-26

Bolt.new apps backed by Supabase typically keep the schema in SQL migration files and query tables from the browser with the public key. That makes the migrations the best place to review your access rules. Work through this list before you share the app.

Read every migration for three lines

For each create table in supabase/migrations/*.sql, look for enable row level security and at least one create policy per operation the app performs. A table created in a later migration without these is the most common gap.

grep -nE "create table|enable row level security|create policy" supabase/migrations/*.sql

Watch for policies that look right but are not

  • to authenticated using (true): every signed-in user can read every row. Fine for shared reference data, wrong for per-user data.
  • Insert policies without with check (auth.uid() = user_id): users can create rows that claim to belong to someone else.
  • Update policies with using but no with check: a user can move their row to another user_id.
  • Filtering by user id only in the frontend: anyone calling the API directly simply leaves the filter out.
create policy "own rows: insert" on public.tasks
  for insert to authenticated with check (auth.uid() = user_id);
create policy "own rows: update" on public.tasks
  for update to authenticated using (auth.uid() = user_id) with check (auth.uid() = user_id);

Storage and functions

Keep user uploads in private buckets with policies on storage.objects that check the path or owner. Third-party API keys (OpenAI, Stripe secret, email) belong in Edge Function secrets, not in VITE_ variables, because anything with that prefix is bundled into the browser.

Test before launch

Create two test accounts. As the second one, call the API directly and try to read, edit and delete the first one's rows. Repeat signed out. Run a free passive ShipGuard scan too: it lists the tables your bundle writes to, which is a good cross-check against your migrations.

Checklist

  • Every table in supabase/migrations has RLS enabled
  • Policies exist for each operation the app uses
  • Per-user policies use auth.uid(), with check on insert and update
  • No using (true) on private tables
  • Private buckets + storage.objects policies for uploads
  • No secret keys in VITE_ variables or client code
  • Two-user and signed-out API tests pass

Copy-paste fix prompt

Review all SQL files in supabase/migrations. For every table, make sure Row Level Security is enabled and that each operation the app performs has a policy scoped with auth.uid() = user_id, using WITH CHECK on insert and update. Replace any USING (true) policy on private data. Write the fixes as a new migration and list which client queries rely on each policy.

FAQ

Bolt's app works fine. Doesn't that mean RLS is right?

No. Over-permissive policies also make the app work. Broken RLS usually shows up only when someone calls the API outside your UI.

Do I need RLS if every page requires login?

Yes. Login controls who can sign in. RLS controls which rows each signed-in user can reach, and the API is reachable without your pages.

Check your deployed app in seconds

Free passive scan: leaked keys, Supabase exposure, public config files and headers.

Run a free scan