Is my AI-built app secure? Check for exposed keys and open tables
Last updated November 9, 2026
Two configuration errors occur frequently in AI-built apps. A secret key goes to the browser, or a database table has no access rules. Do the checks in this guide. Do these checks only on apps that you own.
Two types of key
This guide uses Supabase as the example, because many AI tools use Supabase. Other services have similar keys.
- Publishable key (the older name is anon key): This key can be in the browser. The database rules protect your data from people who have this key.
- Secret key (the older name is service_role key): This key can ignore the database rules. Keep this key on the server.
Names that start with NEXT_PUBLIC_ or VITE_ go to the browser. Do not use these names for a secret key.
Find secret keys
- Open the live app in your browser.
- Press F12 to open the browser tools.
- Click Sources.
- Press Ctrl+Shift+F to search all files. On a Mac, press Cmd+Option+F.
- Search for
service_role,sb_secret_,sk_live_andsk-. - Open your repository on GitHub and search for the same words.
If you find a secret key
- Make a new key at the provider.
- Put the new key in the secret settings of your host.
- Deploy the app and test the app.
- Remove the old key at the provider.
- Remove the old key from your code.
- Read the logs of the provider and find unusual use.
Examine the database rules
Row Level Security (RLS) is a set of database rules. These rules control which rows each user can read or change. If an exposed table has no RLS, a person who has the publishable key can possibly read and change the table.
- Open your project in the Supabase Dashboard.
- Open the Security Advisor.
- Read each report about a table that has no RLS.
- Enable RLS on each of these tables.
- Write a policy for each table. A policy is one access rule.
- Test each main task in your app.
A policy with using (true) lets all users read the data. Use this policy only for public data, such as a list of products.
Test the database as a stranger
This test sends a request with the publishable key only. Type this command in a terminal. Use your project address, table name and key.
curl "https://YOUR-PROJECT.supabase.co/rest/v1/YOUR_TABLE?select=*" \ -H "apikey: YOUR_PUBLISHABLE_KEY"
- If the result is
[]or a permission error, a stranger cannot read this table. - If the result shows rows of data, a stranger can read this table.
This test examines read access only. Also read your policies for insert, update and delete.
Test the app as a different user
- Make two test accounts, A and B.
- Sign in as A and add a record.
- Copy the address of the page that shows the record.
- Open a private browser window and sign in as B.
- Paste the address in the private window.
- Make sure that B cannot see the record of A.
A hidden button does not protect data. The server or the database must examine each request.
Two more checks
- Examine your file storage. Make sure that private files are not in a public bucket.
- Find packages that have known security problems. Read how to update packages.
If strangers could read personal data
Stop the problem first. Then read your logs to learn what people read. Get legal advice, because laws in many countries tell you to inform your users about a data breach.
How Uptendr helps
Each night, Uptendr scans for keys in your code and for packages that have known security problems. Uptendr then builds and checks each update, and sends it as a pull request. Uptendr does not examine your database rules, your sign-in logic or the access between users. Do these checks yourself or get a security review.
More guides
- Connect Lovable, Bolt, Replit, v0 or Base44 to GitHub
- How to update packages in an AI-built app without breaking it
- My app stopped working and I changed nothing: what to check
- How to read and merge a pull request when you don't code
- How to keep an AI-built app healthy after launch: a simple routine
- Lovable app broke after an edit: how to find the cause and recover