Is your Bolt app secure?
Bolt.new is a safe tool to build with. A Bolt app is secure when its Supabase tables have row level security, no secret key sits in a VITE_ variable, and the site it deploys sends security headers.
Updated
Check your live site now
Free, no signup, read only. A grade and plain fixes in seconds.
What Bolt does for you, and what it leaves to you
Bolt.new, from StackBlitz, builds and runs your app in the browser and can deploy it for you, with Netlify as a long-standing option. Apps are often a Vite and React front end with Supabase for the database and login.
Bolt gets the code running and online. It does not decide your database access rules or which variables are safe to expose, and it cannot tell a paid API key from a public one when both are named VITE_. Those parts are yours.
Security mistakes Bolt apps commonly make
- Supabase tables created by a migration without row level security, so anyone with the public anon key can read them.
- A secret key in .env with a VITE_ prefix, such as VITE_OPENAI_API_KEY. Vite puts every VITE_ value into the JavaScript bundle.
- The Supabase service_role key used in front end code to get past a permissions error.
- No _headers file on the Netlify deploy, so no CSP and no clickjacking protection.
- An AI feature that calls OpenAI or Anthropic directly from the browser instead of through a Supabase Edge Function or Netlify Function.
The .env in a Bolt project holding VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY is normal. Those two are meant to be public. The problem is any other VITE_ value that is a secret.
Where the fixes go in a Bolt project
- Row level security: in Supabase, as a migration Bolt writes or in the SQL editor. Confirm in the Supabase dashboard.
- Secret API keys: in Supabase Edge Function secrets or Netlify environment variables without a VITE_ prefix, used only in the function.
- Security headers on Netlify: a _headers file in public/, which Vite copies into dist on build.
/*
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self' https: data: blob: 'unsafe-inline' 'unsafe-eval'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'; form-action 'self'; upgrade-insecure-requests
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()Check this project for security. Enable row level security on every Supabase table and add policies so users only access rows where user_id = auth.uid(). Find any VITE_ variable that holds a secret, move the call that uses it into a Supabase Edge Function, and read the key there from the function's secrets. Add a public/_headers file with security headers. Show me the SQL and file changes first.Bolt app security checklist
- Open .env and read every VITE_ variable. Only the Supabase URL, the anon or publishable key and other public config belong there.
- Rotate any secret that had a VITE_ prefix and was deployed.
- In Supabase, run the Security Advisor and fix every RLS error.
- Read the policies on tables with personal or paid data.
- Add public/_headers and redeploy.
- Scan the live URL.
How to check your deployed Bolt app
Test RLS the way a stranger would, with the anon key from your own site and no login:
curl 'https://YOUR-PROJECT.supabase.co/rest/v1/YOUR_TABLE?select=*&limit=5' \
-H 'apikey: YOUR_ANON_KEY'Rows back means the table is public. An empty list or a permission error means it is protected.
An outside scan checks what your deployed site hands to every browser: secret keys in the HTML and JavaScript bundles (including a Supabase service_role JWT, while the anon key is correctly treated as public), public .env and .git files, security headers, the https redirect, cookie flags and CORS. It cannot read your database, so the curl test and the Security Advisor are how you check RLS.
Questions
Is bolt.new safe to use?
Yes, as a tool. The security questions are about the app it builds: database rules, where keys live and which headers the deployed site sends.
Is it safe that my Supabase anon key is in my Bolt app?
Yes. The anon key is designed to be public. It only exposes data when a table is missing row level security or has a policy that allows everyone.
Why is my OpenAI key visible in my Bolt app?
Because it is in a VITE_ variable, and Vite copies those into the JavaScript bundle. Rotate the key, then call OpenAI from an Edge Function or Netlify Function instead.