Spacefast has launched! Read our founder’s blog post

Vibe Coding Security: 12 Checks Before You Publish Your App

Twelve checks to run before your AI-built app goes live, each with a prompt you can paste into your AI.

Published

17 min read

On this page

Quick answer AI coding tools write code that works for the person testing it, and that person is usually the owner with full access. Security problems show up when strangers arrive, so they stay hidden until the app is public. A short checklist run before launch catches most of them.

Key takeaways

  • The AI builds for "it runs" by default. Security has to be asked for, check by check, or it usually doesn't happen.
  • Most leaks come from a few places. Keys left in the code, databases that answer anyone, and pages that never check who is asking.
  • Every check here comes with a prompt. You don't need to read the code yourself to run the list, though you do need to read what the AI tells you back.
  • Publish privately first. A private link with a password lets you test with real people before strangers and bots can reach the app.
  • Keep a way back. If a fix breaks something, rolling back to the last good version should take seconds.

When security company Escape scanned about 1,400 apps built with AI,1 it found more than 400 leaked secrets, like API keys anyone could copy.

None of those builders meant to leak anything. Their AI wrote code that worked, and nobody asked it to make that code safe.

Before you make your app public, run these 12 checks. Each one takes a few minutes, explains the risk in plain words, and comes with a prompt you can paste into your AI.

Why AI-Built Apps Have Security Gaps

When you ask an AI for a feature, it aims for one thing: the feature should run when you try it. Whether a different user could see your data, or a bot could hammer the login form, isn’t part of the request unless you add it.

Then you publish it. An app you built for yourself becomes a public address that anyone can open, including bots that crawl new sites looking for exposed keys.

Escape’s state of vibe-coded app security report1 also counted 2,038 highly critical vulnerabilities and 175 cases of exposed personal data across those apps.

The problem isn’t limited to app builders. In Veracode’s tests of more than 100 models, 45% of test cases introduced a known security flaw,2 and larger models didn’t do much better than smaller ones.

Asking the AI to review its own work helps, but it isn’t enough. The same model that skipped a check while building will often skip it while reviewing, which is why each of the 12 checks names exactly what to look for.

The 12 Checks at a Glance

Use the table as a quick scan, then work through each check in order. The first five are the ones that cause the worst leaks, so fix those before anyone outside your team gets the link.

# Check What Goes Wrong Fix Before Launch?
1 No keys or passwords in the code Anyone who sees the code can use your paid services Yes
2 Secret keys stay on the server Keys sent to the browser are public Yes
3 Every page and API checks sign-in Private screens open without logging in Yes
4 Users see only their own data Changing an ID in the address shows someone else’s records Yes
5 Database denies access by default The database answers anyone who asks Yes
6 Inputs are checked on the server Bad data or injected commands reach the database Yes
7 User content can’t run as code A comment or name field runs a script in other people’s browsers Yes, if users can post
8 Packages are real and current A made-up or outdated package installs something harmful Yes
9 File uploads are limited Huge or harmful files fill storage or reach other users Yes, if you accept files
10 Sign-in and forms have rate limits Bots guess passwords or flood your forms Before you share widely
11 Production settings are locked down Error pages reveal internals, other sites call your API Yes
12 You can undo a bad change A broken fix takes the app down with no way back Before your first update

The 12 Vibe Coding Security Checks

Each check follows the same pattern. You get the risk in one sentence, a way to check it without reading code, the fix, and a prompt to give your AI. Run the prompts one at a time so the answers stay focused.

1. No API Keys or Passwords in the Code

An API key is a password that lets your app use a paid service, and if it sits in your code, anyone who sees the code can run up your bill.

How to check: Ask your AI to list every key, token and password in the project. Then search the files yourself for words like “key”, “secret” and “token” to confirm the list is complete.

The fix: Move each secret into an environment variable, which is a setting stored where the app runs instead of in the files. Then rotate any key that was ever in the code, since old copies may already be saved somewhere.

Prompt:

2. Secret Keys Stay on the Server

Anything sent to the visitor’s browser can be read by that visitor, so a secret key in front-end code is public no matter how well it’s hidden.

How to check: Open your live app, right-click, choose View Page Source or open the developer tools, and search for your key’s first few characters. If you can find it, so can everyone else.

The fix: Calls that need a secret key should run on the server, with the browser asking your server for the result. Some services also issue public keys made for browsers, which are safe only when paired with strict rules on what they can do.

Prompt:

3. Every Page and API Checks Who Is Signed In

Authentication means checking who someone is, and AI-built apps often check it on the main screen while forgetting the pages and API routes behind it.

How to check: Sign out, then paste the address of a private page straight into your browser. Do the same for any API addresses your AI mentions. Each one should send you to sign in or return an error.

The fix: Add a sign-in check to every private page and every API route on the server, using one shared function so a new route can’t skip it by accident.

Prompt:

4. Users Can Only See Their Own Data

Even with sign-in working, an app can show one user another user’s data if it trusts whatever record ID arrives in the request. Security teams call this IDOR, short for insecure direct object reference.

How to check: Create two test accounts. With the first, open a record and note its ID in the address bar. Sign in as the second account and paste that address. You should get an error, never the first user’s record.

The fix: Every request that reads or changes a record has to confirm on the server that the record belongs to the signed-in user, or that the user has a role that allows access.

Prompt:

5. The Database Denies Access by Default

Some databases used by AI tools, such as Supabase, can be queried straight from the browser, and if access rules are off, anyone with the public address can read every table.

How to check: In your database dashboard, look at each table’s access rules. In Supabase this is row-level security, or RLS, and the Supabase RLS docs3 say to turn it on for every table the app exposes.

The fix: Turn on row-level security for every table, then add rules that allow only what each user needs, such as reading their own rows. Start from “deny everything” and open access one rule at a time.

Prompt:

6. Every Input Is Checked on the Server

Forms and URLs accept whatever a visitor types, and without checks, crafted input can change what your database query does. This attack is called injection, and it has been on the OWASP Top 10 list of web risks for years.

How to check: Ask your AI how each form and API route checks its input, and whether database queries are built by joining text together. That joining is the pattern injection relies on.

The fix: Validate every input on the server for type, length and format, and use parameterized queries, which keep user input separate from the database command. Checks in the browser help honest visitors and do nothing to stop a crafted request.

Prompt:

7. User Content Can’t Run as Code

If people can post names, comments or messages, a visitor can type a script instead of text, and an unprotected app will run it in every other visitor’s browser. This is cross-site scripting, or XSS.

How to check: Type a harmless test like <b>hello</b> into a comment or name field and save it. If the word shows up bold, the app is treating user input as code. In Veracode’s tests, models failed to block XSS in 86% of cases.2

The fix: Make sure user content is escaped before it’s displayed, so it appears as plain text. Avoid features that insert raw HTML from users, and if you need rich text, use a sanitizer library that strips scripts.

Prompt:

8. Every Package Is Real and Up to Date

AI tools sometimes suggest software packages that don’t exist, and attackers register those names to slip in harmful code. Researchers presenting at USENIX Security tested 16 code models and found that made-up packages averaged at least 5.2% of suggestions from commercial models and 21.7% from open-source ones.4

How to check: Ask your AI for the full list of packages the app installs. Look each one up on its registry, such as npm or PyPI, and check it has a real history, recent updates and a meaningful number of downloads.

The fix: Remove anything you can’t verify, update the rest to current versions, and run the package manager’s audit command, such as npm audit, to flag known vulnerabilities.

Prompt:

9. File Uploads Are Limited

An upload form with no limits lets anyone send huge files that fill your storage, or files dressed up as images that other users then download.

How to check: Try uploading a very large file and a file with the wrong type, such as an .exe file renamed to .jpg. Both should be rejected with a clear message.

The fix: Set a maximum size, accept only the file types you need and check the real file type on the server. Store uploads away from your app’s code and give them new random names.

Prompt:

10. Sign-In and Forms Have Rate Limits

Without a limit on attempts, a bot can try thousands of passwords against one account or fill your contact form with spam overnight.

How to check: Ask your AI whether any route limits how often the same visitor can call it. Then submit your own sign-in form with a wrong password 20 times in a row and see whether anything slows you down.

The fix: Add rate limits to sign-in, sign-up, password reset and any form that sends email or costs money per request. A common starting point is a handful of attempts per minute per visitor.

Prompt:

11. Production Settings Are Locked Down

Settings that help while building, such as detailed error messages and open access from any website, give attackers a map of your app once it’s public.

How to check: Visit a page that doesn’t exist and trigger an error on purpose. You should see a plain message, never file paths or code. Check that the address starts with https and that debug mode is off.

The fix: Turn off debug output, force HTTPS, and limit which websites can call your API, a setting called CORS. Add security headers, which tell browsers to block risky behavior. On Spacefast you can set security headers in a _headers file.5

Prompt:

12. You Can Undo a Bad Change

A security fix can break a feature, and without a saved copy of the last working version, you’re debugging live while users wait.

How to check: Find out where your current version is saved and how long it would take to bring back yesterday’s version. If the answer involves rebuilding from memory, you don’t have a way back yet.

The fix: Use version control such as Git, back up your database on a schedule, and publish somewhere that keeps every version so you can roll back without a rebuild.

Prompt:

Where You Publish Matters Too

The checks cover what’s inside your app. Where you publish it decides who can reach it while you work through them.

On Spacefast, you decide who can open your app.6 When your AI publishes, you can invite people by email, send a share link or set a password, and you switch it to public only when the checks are done.

That makes it a safe place to work through the checklist. A reviewer can try to open another user’s records or break your forms, while bots and strangers can’t reach the app at all.

Every publish that changes files is saved as its own version, so if a fix in check 7 breaks your comments, you can point the live link back to an earlier version without rebuilding. Every Space gets HTTPS automatically, and you can keep secrets in environment variables instead of your files.

Spacefast is built by Automattic, the company behind WordPress.com,7 and runs on the same infrastructure. You can read more about the team behind Spacefast.

Spacefast doesn’t scan or fix your code, so the 12 checks are still yours to run. Publishing privately just lets you run them before anyone else can open the app. Compare Spacefast plans when you’re ready to go public.

When to Bring In a Human

A checklist catches the common gaps. It doesn’t replace a person who tests your app the way an attacker would, and some apps need that person before launch.

Get a professional security review if your app takes payments, stores health or financial data, holds personal details for people other than you, or will have more than a small circle of users.

The same goes for anything in a regulated field, such as healthcare, finance or education. Rules like GDPR in Europe or HIPAA in the US carry their own requirements, and an AI can’t confirm you meet them.

A Final Prompt for Your AI

Once you’ve worked through the checks, run one last pass that covers all of them together. It often catches something a single check missed, especially in features you added late.

Final security pass:

Ship It Safely

Run the 12 checks before your app goes public, starting with keys, sign-in and database access, since those cause the worst leaks.

Publish to a private link first, let a few people try to break it, and keep every version so a bad fix is a quick rollback. When you’re ready, connect Spacefast to the AI you already use and ask it to publish.

FAQ

Is Vibe Coding Safe?

Vibe coding is as safe as the checks you run on what it produces. The AI writes working code quickly but rarely adds protection unless you ask for it. Running a security checklist before launch and publishing privately first makes it safe enough for most personal projects. Apps with payments or personal data also need a human review.

What Are the Biggest Vibe Coding Security Risks?

The biggest risks are API keys left in the code, databases with access rules turned off, and pages or API routes that don’t check who is signed in. Escape’s scan of about 1,400 vibe-coded apps found more than 400 leaked secrets, which makes leaked keys one of the most common problems.

Is AI-Generated Code Less Secure Than Human Code?

AI-generated code repeats the most common patterns it has seen, including insecure ones, and Veracode found known flaws in 45% of the coding tasks it tested. Human code has bugs too, but a developer often adds access checks out of habit, while the AI adds them only when the prompt asks.

Can I Ask the AI to Fix Security Issues Itself?

Yes, and it’s usually the fastest way to fix them, as long as you name the exact problem. A vague request like “make it secure” gets vague results. Ask about one check at a time, ask the AI to show its changes before applying them, and test the result yourself.

How Do I Keep My App Private While I Test It?

Publish to a private link instead of a public address, invite only your testers and add a password if your platform supports one. On Spacefast, you can share a Space by invite, share link or password, so your app stays out of public view until you choose to make it public.

Do I Need a Security Audit for a Vibe-Coded App?

You need one if the app handles payments, health or financial data, personal details of other people, or a large number of users. For a personal tool or a prototype shown to a few people, the 12 checks and a private link are usually enough to start.

Sources

  1. Escape, vibe-coded apps report ↩ ↩2

  2. Veracode, GenAI code research ↩ ↩2

  3. Supabase, RLS documentation ↩

  4. USENIX Security, package hallucinations study ↩

  5. Spacefast, routing docs ↩

  6. Spacefast, plans and pricing ↩

  7. Spacefast, about Spacefast ↩

Make it with Spacefast.

Set it up yourself

Works with any AI