Triage Bolt's "RLS Policy Always True" warning: when it's fine and how to fix it
Updated · Applies to: Bolt, Supabase
TL;DR fix: "RLS Policy Always True" means a policy has no condition that limits rows: USING (true) or WITH CHECK (true). RLS is technically enabled, but for that operation every role the policy names can touch every row. Bolt says it may write these policies when your site has no sign-in, and that it flags them on every project even when public access is intended. Triage each flagged table into one of three buckets from Bolt's docs: visitors can only view (keep a read-only SELECT policy), visitors can submit (INSERT only, no reads), or private (add sign-in and scope policies to auth.uid()). Any always-true UPDATE or DELETE on a public site means any visitor can change or wipe the table.
Steps
- Open the Security Audit and list the flagged policies. In Bolt, open your database settings and the Security page (titled Security Audit). Bolt says it uses the same checks as Supabase's Security Advisor. Note each table and policy flagged RLS Policy Always True.
- See what each policy really allows. Run the pg_policies query below (Supabase SQL editor if you use your own Supabase project). Look at cmd (SELECT, INSERT, UPDATE, DELETE, ALL), roles and the qual / with_check columns. A 'true' there means no restriction.
- Put each table in a bucket: view-only, submit-only or private. Portfolio, menu, blog posts: visitors view only. Contact form, waitlist, reviews: visitors submit only. Orders, messages, anything personal: private, which needs sign-in.
- Remove always-true write policies first. An always-true UPDATE, DELETE or ALL policy for anon on a site without sign-in lets any visitor change or delete every row. Drop those before anything else.
- Apply the bucket's policies, via Bolt or SQL. Ask Bolt to update the policies (sample prompt below), or run the SQL yourself. Then reopen the Security page; Bolt's docs say to check it again after any database change.
- Retest logged out. From a private window, try to read the submit-only and private tables and to update or delete a row. All of those should fail or return nothing.
What Bolt is telling you
Bolt’s Security Audit runs the same database checks as Supabase’s Security Advisor. “RLS Policy Always True” is Supabase’s lint 0024: a policy whose USING or WITH CHECK is true (or a tautology like 1=1). Supabase’s description of the impact, per operation:
- SELECT: any user with that role can read all rows
- INSERT: any user can insert any data
- UPDATE: any user can modify any row
- DELETE: any user can delete any row
Bolt’s docs explain why you’re seeing it: if you haven’t asked Bolt to add sign-in, it “might write policies that allow any visitor to view, add, change, and delete the data in your database.” Bolt flags these on every project, even when public access is intended, so the warning needs triage, not panic.
Step 1: list what’s actually allowed
select tablename, policyname, cmd, roles, qual, with_check
from pg_policies
where schemaname = 'public'
order by tablename, cmd;
Rows where qual or with_check is true are your always-true policies. cmd = ALL covers every operation. roles = {public} means the policy has no TO clause and applies to every role, including anon.
Step 2: put each table in a bucket
These are the three options from Bolt’s own docs:
| Bucket | Examples | anon can |
|---|---|---|
| Visitors can only view | portfolio, menu, blog posts | SELECT only |
| Visitors can submit | contact form, sign-ups, reviews | INSERT only |
| Private | orders, messages, profiles | nothing; add sign-in |
Step 3: the SQL for each bucket
Replace the table and policy names with what Step 1 showed.
View-only (public content):
drop policy if exists "Allow all" on public.posts; -- the always-true ALL policy
create policy "Anyone can read posts"
on public.posts for select
to anon, authenticated
using (true); -- intentional, read-only
This SELECT will likely still be flagged. That’s expected for genuinely public content. What matters is that there’s no always-true INSERT, UPDATE or DELETE.
Submit-only (contact form):
drop policy if exists "Allow all" on public.contact_messages;
create policy "Anyone can submit a message"
on public.contact_messages for insert
to anon, authenticated
with check (true);
-- No SELECT / UPDATE / DELETE policy for anon: visitors can't read others' submissions.
Read submissions from the Supabase dashboard or server code with a secret key, never from the browser.
Private (needs sign-in first):
drop policy if exists "Allow all" on public.orders;
create policy "Users read own orders"
on public.orders for select to authenticated
using ( (select auth.uid()) = user_id );
create policy "Users create own orders"
on public.orders for insert to authenticated
with check ( (select auth.uid()) = user_id );
Without sign-in there’s no auth.uid() to check, which is why Bolt’s docs say private data needs sign-in added to the site.
Or ask Bolt
Bolt’s docs give this example prompt:
Update the policies for my database so visitors can only view the posts table, and can only add rows to the contact_messages table.
A fuller version for a mixed app:
Review every RLS policy flagged "RLS Policy Always True". For each table:
- public content (posts, menu): SELECT only for visitors, no insert/update/delete
- form tables (contact_messages, waitlist): INSERT only for visitors, no select/update/delete
- private tables (orders, messages, profiles): add sign-in and scope every policy
to (select auth.uid()) = user_id
Never use USING (true) on UPDATE or DELETE. Show me the final policy list.
Then reopen the Security page and retest from a logged-out private window.
For the general Supabase version of this problem (including the November 2026 Lovable scan figures and a two-minute check), see fix USING (true) policies that make a table publicly readable. On Lovable, the same kind of policy shows up as a security finding in the Publish dialog: see Lovable won’t publish because of security findings. RLS can also be skipped by views and SECURITY DEFINER functions.
When to get help
Get help if you're not sure which tables hold personal data, if adding sign-in breaks your app, or if Bolt keeps regenerating always-true policies.
Want us to look at your app?
VibeCPR Rescue Reports are launching soon: we scan your repo and live app, and a human verifies every critical finding. Join the waitlist for early access and founder pricing. You'll also get Patch Notes, our weekly fixes newsletter.
FAQ
What does "RLS Policy Always True" mean in Bolt?
Bolt's docs say it means a policy has no conditions that limit who can access a row. In Supabase's Advisors this is lint 0024 (permissive RLS policy): always-true expressions like USING (true) or WITH CHECK (true) "effectively bypass the security that RLS is meant to provide".
RLS is enabled. How is the table still public?
RLS decides which rows a request can touch by running your policies. A policy of USING (true) allows every row, so enabling RLS changes nothing for that operation. Anyone with your site's public key, which ships in the browser, can call the database directly without going through your pages.
Can I ignore the warning?
Sometimes. Bolt says it flags this on every project, even when public access is what you want, and that it's acceptable only if you're comfortable with every visitor being able to do what the policy allows. A read-only SELECT on genuinely public content is a reasonable thing to keep. Always-true UPDATE or DELETE on a public site almost never is. Supabase also lists public read-only tables like blog posts and product catalogs as false positives.
What about a contact form? Visitors have to insert.
Keep an INSERT policy for anon and give anon no SELECT, UPDATE or DELETE policy. Bolt's docs describe this as visitors can add data but not read, change or delete what other people submitted. The insert policy may still be flagged; that one can be intentional.
Is "to authenticated using (true)" safe?
Only if every signed-in user should see every row. If anyone can sign up, that is close to public. For private data use a condition like (select auth.uid()) = user_id.
Sources
- Bolt docs: Database security settings (Security Audit, RLS Policy Always True)
- Supabase Advisors: 0024 permissive RLS policy
- Supabase docs: Row Level Security
Related fixes
- AI agent pushed API keys to GitHub? git commit --no-verify skipped your pre-commit hook
- Fix a surprise AI API bill: rate limits and spend caps
- Your app is public to anyone with the link: a share link is not a login
- Fix secrets leaked via Claude Code .claude/settings.local.json
- Fix "Your Cloud Firestore database has insecure rules" (Firebase email)
- Login lockout keyed only on email? Rate-limit by IP and account without locking users out
- Fix Lovable "Invalid API key" after rotating Supabase keys (anon, publishable, secret)
- Lovable won't publish because of security findings? What each finding means and how to fix it
- "Sign in with Google" lets anyone in: restrict who can use your app (allowlist, domain check, RLS)
- Fix Stripe sk_live keys left in MCP or agent config
- Fix Stripe webhook "No signatures found matching the expected signature for payload"
- Fix Supabase auth redirecting to localhost after deploy
- Fix Supabase Edge Function "blocked by CORS policy" (preflight)
- Fix Supabase "infinite recursion detected in policy for relation" (42P17) in RLS
- Form says success but no row in Supabase (or Stripe webhook returns 200 but writes nothing)
- Fix "new row violates row-level security policy for table" (Supabase)
- Supabase only returns 1,000 rows? Fix the silent max rows limit in Lovable and Bolt apps
- Fix Supabase "permission denied for table" (42501) on new tables after Oct 30, 2026
- Fix a Supabase public Storage bucket that lets anyone list or download your files
- Supabase Realtime leaking rows or not receiving changes: fix RLS and the publication
- Supabase RLS not working on the server? Your API uses the service_role or secret key
- Fix Supabase RLS policy USING (true) that makes a table publicly readable
- Your app's rules only live in the frontend: move them into Supabase
- Fix a Supabase SECURITY DEFINER function anyone can call through /rest/v1/rpc
- Fix Supabase .single() "JSON object requested, multiple (or no) rows returned" (PGRST116)
- Stop Supabase users from upgrading their own plan or making themselves admin
- Fix a Supabase view that bypasses RLS: security_invoker and revoking anon write grants
- Fix "404: NOT_FOUND" on refresh in a React/Vite app on Vercel (vercel.json rewrite)
- Fix "Module not found: Can't resolve" on Vercel (works locally)
- Is my Vite dev server exposed? Check --host / server.host and patch the RCE (GHSA-p4f5-76q4-ffq7)