Vibe coding guideSecurity basics for vibe-coded apps
Keep your keys, data and users safe.
Built an app with AI? A few basics keep your keys, your data and your users safe. A plain checklist that works with any tool, from secret keys to database access rules, and how 3Edit helps.
About 8 minutes to readLast updated
On this page
The journey at a glance.
Why security needs a moment of your attention
When you build by chatting, you see the pages, not the code and settings behind them. That is the joy of it, but it also means you may not notice where a key ended up, or who a database table lets in. An AI agent builds what you ask for, so it helps to ask for the safe version and then check it.
The good news: most problems in small apps come down to a handful of basics, and each has clear advice from the people who make the tools. Supabase, for example, explains that its publishable key is meant to be public, so it only reaches what row level security allows. Get these basics right and you have covered a lot of ground.
It isn’t a rare problem. In October 2025 the security company Escape reported a scan of over 5,600 publicly available vibe-coded applications, in which it found more than 2,000 vulnerabilities, 400+ exposed secrets and 175 instances of exposed personal data.
The security checklist
These checks work with any tool. Each links to the official advice behind it.
| Check | What to do | Official advice |
|---|---|---|
| Secret keys stay on the server | Use secret keys only in server code. In a Next.js app, only variables that start with NEXT_PUBLIC_ reach the browser, so never give a secret key that prefix. | Next.js: environment variables |
| Know which keys are public | Treat any key in the browser as visible to everyone. Stripe’s publishable key can go in front-end code; its secret key can’t. | Stripe: API keys |
| Keys stay out of Git | Keep keys in environment settings, not in your code, and never commit them. If one is exposed, rotate it straight away. | GitHub: secret scanning |
| Row level security is on | Turn on row level security for every table in an exposed schema, then add policies for who may read and change rows. | Supabase: row level security |
| The secret database key stays private | Never put Supabase’s secret key in a browser, a shipped app or source control. | Supabase: API keys |
| Access is checked on the server | Deny access by default, and check permissions on the server. Hiding a button or a page isn’t a permission. | OWASP: Authorization Cheat Sheet |
| Input is checked on the server | Validate form input on the server, even when the browser checks the same fields. | OWASP: Input Validation Cheat Sheet |
| Test keys first, live keys later | Use test keys while you test and live keys only when you’re ready for real payments; each mode has its own keys. | Stripe: API keys |
| Try it as different people | Sign in as a visitor, a member, the owner of some data and an admin, and try to see or change what each one shouldn’t. | OWASP: Authorization Cheat Sheet |
A security self-check in your browser
You don’t need special tools for a first look. Try each of these on your live site, in a normal browser, and compare what happens with the middle column.
| Try this | What you should see | Official advice |
|---|---|---|
| Enter a wrong password many times in a row. | After repeated failures, sign-in slows down or is blocked for a while. | OWASP: Authentication Cheat Sheet; Supabase Auth also applies rate limits to sign-ins. |
| Sign in with an email that has no account, then with a real one and a wrong password. | The same message both times, such as “Wrong email or password”, so nobody can find out who has an account. | OWASP: Authentication Cheat Sheet |
| Signed out, in a private window, open your admin pages and a private page’s address. | You are sent to sign in, and no admin page or private data appears. | OWASP: Authorization Cheat Sheet |
| Open the page source, then the DevTools Network panel, reload, and search for words such as “secret”. | Only publishable or public keys. A Stripe secret key or a Supabase secret key never appears. | Stripe: API keys; Supabase: API keys |
| Look at how your checkout takes card details. | Card numbers are typed into your payment provider’s own form and go straight to the provider, never to your pages, server or database. | Stripe: payment information sent directly to Stripe without passing through your servers |
| Scan your live address with MDN’s HTTP Observatory, or look at the response headers in the Network panel. | Security headers such as Strict-Transport-Security and a Content Security Policy; fix what the report flags. | OWASP: HTTP Headers Cheat Sheet |
Can one user reach another user’s data?
One of the most useful security tests for a small app takes just two accounts. Sign in as person A and create something private. Then sign in as person B and try to open it: paste A’s address, or swap the ID in one of B’s own addresses for A’s. B should get “not found” or “no access”, every time.
Why this matters: if the app shows A’s data simply because B asked for its ID, the server isn’t checking who is asking. OWASP calls this an insecure direct object reference and advises verifying the user’s permission on every access. It is a common and serious gap, and broken access control is first in OWASP’s 2025 Top 10. The fix belongs on the server and in the database rules, not in the menu. For the step-by-step version, see the testing guide.
Keep it safe after launch
Security isn’t only a launch-day job. A few habits keep things tidy once your app is live:
- Rotate keys from time to time. OWASP’s Secrets Management Cheat Sheet advises rotating secrets regularly, so a stolen one only works for a short time.
- Act on a leaked key at once. GitHub’s secret scanning detects credential leaks, and its advice on an alert is to rotate the affected credential immediately. In Stripe, rotating a key revokes it and creates a replacement that works straight away.
- Keep admin access small. Give admin rights only to the people who need them, and check the list now and then. OWASP’s Authorization Cheat Sheet calls this enforcing least privilege.
- Retest access after big changes. When the AI adds a new page or table, try it again as a visitor and as an ordinary member.
- Read more. The OWASP Top 10, now in its 2025 edition, is a good next read on web application security risks. Before launch, also test your app end to end.
What these basics don’t cover
This guide covers the basics most small apps miss. It is a starting point, not a security sign-off. It doesn’t cover:
- Flaws in your own rules: a refund that can be claimed twice, or a free trial that never ends. These are business-logic problems, and only you know the rules.
- A penetration test: a security professional attacking your app on purpose, with permission.
- Heavy traffic: whether the app stays up and safe under a large number of visitors.
- Law and compliance: data protection, payment and sector rules that apply to your business.
- Get expert help before launch if your app stores health information, takes payments at scale, collects children’s data, or would cause real harm if its data leaked.
How 3Edit helps keep your app secure
3Edit looks after several of these basics for you. It isn’t a full security audit or a penetration test, so the checklist above is still worth your time.
- Keys stored locally. You add keys with 3Edit’s secure key form and its “Save secure key” button. The form says: “Stored locally for this project. Values are not sent to AI or saved in chat. Add the same keys to your live deployment environment before publishing.”
- Left out of downloads and GitHub. Project downloads and GitHub uploads leave out the env files, which is where keys live.
- Your Supabase connection, encrypted. Your Supabase connection details are stored encrypted on your computer, using your operating system’s protection.
- A secret scan before publishing. Publishing runs checks first, including a “Private secret scan”. If a private key is found in your site’s files, publishing stops with “Publishing is blocked”, names the problem and asks you to remove the key. A missing key is only a warning (“Publishing with warnings”): the site can go live, and that feature waits for its key.
- Keys on your host. When 3Edit publishes your site, it copies your saved keys to the host for you, as encrypted production environment variables, on 3Edit hosting or on your own Vercel. Private database keys are server-only. Your site gets an HTTPS address, and custom domains come with DNS steps and a verification check.
- Row level security on your own Supabase. 3Edit turns on row level security and creates access rules for the public, signed-in members, the owner of a row and admins, and ordinary users can’t change their own role. It then tests the rules as a visitor, a signed-in user, the owner, another user and an admin, and rolls the test data back. It is the same idea as the two-user test above, run by 3Edit against your database rules; your own test checks the finished app.
- You become the admin. The first account created on a store becomes its admin, and 3Edit’s publishing advice says: “Create your own account on your store before you publish, so you become its admin.” See open your store admin.
- Stripe in the starter kits. The payment settings page explains that the secret key is used only on the server and kept private, and tells you to use Stripe test keys while testing and live keys when you are ready to take real payments. Only a verified owner or admin can change the payment settings, and a newly entered secret key is checked with Stripe.
- More on building. See the Web Builder for how 3Edit builds with your own Supabase, GitHub and Vercel.
Helpful links
Security
- owasp.orgOWASP Top 10
- cheatsheetseries.owasp.orgAuthorization Cheat Sheet (OWASP)
- cheatsheetseries.owasp.orgInput Validation Cheat Sheet (OWASP)
- cheatsheetseries.owasp.orgSecrets Management Cheat Sheet (OWASP)
- supabase.comRow Level Security (Supabase)
- supabase.comAPI keys (Supabase)
- nextjs.orgEnvironment variables (Next.js)
- docs.stripe.comAPI keys (Stripe)
- docs.github.comAbout secret scanning (GitHub)
- cheatsheetseries.owasp.orgAuthentication Cheat Sheet (OWASP)
- cheatsheetseries.owasp.orgInsecure Direct Object Reference Prevention Cheat Sheet (OWASP)
- cheatsheetseries.owasp.orgHTTP Security Response Headers Cheat Sheet (OWASP)
- developer.mozilla.orgHTTP Observatory (MDN)
- supabase.comRate limits (Supabase Auth)
- docs.stripe.comIntegration security guide (Stripe)
Research
More guides.
Building with AI? Here is where to go next, or see every guide.
- How to test a vibe-coded app before launchA plain checklist for pages, forms, sign-up, payments in test mode, real phones and the production build.Read the guide
- AI coding agent stuck in a loop?Why agents get stuck, five fixes that work in any tool, and how to switch engines in 3Edit and carry on.Read the guide
- The 3Edit Web BuilderBuild websites, web apps and MVPs by chatting, in standard Next.js code you own.See the Web Builder
- Create your Supabase account and connect it to 3EditCreate your free Supabase account and organisation, then connect it to 3Edit in one click.Read the guide
- SEO for vibe-coded websitesUnique titles and descriptions, a sitemap, Search Console and content search engines can see: a practical checklist for any tool.Read the guide
About the author.
Written by Humayun Rashed, founder of 3Edit. He also runs 3Edit’s free in-person AI website building and vibe coding course in London.
Questions people ask.
Only the publishable key. Supabase’s docs explain that anyone can read it, so it only reaches what row level security allows: turn row level security on for every table. The secret key must never go in a browser, a shipped app or source control.
A database setting that decides which rows each user may read or change. Supabase advises enabling it on every table in an exposed schema, then adding policies for each kind of user, such as visitors, members and admins.
Rotate it straight away: create a new key, revoke the old one and take it out of your code. GitHub’s secret scanning detects credential leaks and advises rotating the affected credential immediately.
Because it tells strangers who uses your app. OWASP advises a generic error message whether or not the account exists, such as “Wrong email or password”.
Keys saved with 3Edit’s secure key form are stored locally for the project, and the form says the values are not sent to AI or saved in chat. Project downloads and GitHub uploads also leave out the env files where keys live.
No. 3Edit turns on row level security with access rules on your own Supabase and tests them as different users, and it scans for private keys before publishing, but it doesn’t do a full security audit or a penetration test. Use the checklist on this page before launch.
Test keys while you test, and live keys when you are ready to take real payments. Each Stripe mode has its own set of keys, and test transactions don’t move funds.
Start vibe coding today.
Download 3Edit for Mac or Windows and build your first professional website in minutes.