Vibe-Code Security Checklist
Five checks a founder can run on an AI-built app in one afternoon: secrets, cross-account access, sessions, dependencies and backups, each with a command and a pass condition.
5 min read / Updated / Last checked
- Format
- Checklist · Intermediate
- Who it is for
- Founders and the builders they hire
- You leave with
- Run a secret scan, a two-account access test, session checks, a dependency audit and a backup check on your own app, and read the results.
The problem
GitGuardian's State of Secrets Sprawl 2026, published in March 2026, counted 28.65 million new hardcoded secrets added to public GitHub commits in 2025, a 34% increase on the year before. Secrets for AI services alone reached 1,275,105, up 81% [1]. Two months later, Verizon's 2026 Data Breach Investigations Report found that 31% of breaches now start with vulnerability exploitation, which passed stolen credentials as the top way in for the first time in the report's 19 years [2].
Apps built with AI tools sit close to both trends. In September 2025, Wiz Research described vibe-coded apps that ran the entire login check in the browser, and others that shipped third-party API keys and service account credentials inside client-side JavaScript [3].
A founder with a working app usually cannot get a security audit this week. What they can do is run a handful of well-known tools, try to break their own access rules with two test accounts, and check that a backup exists and restores. None of that needs a security background. It needs an afternoon, a staging copy of the app, and a clear idea of what a passing result looks like.
How it works
The afternoon covers five checks, ordered so the most damaging and cheapest findings come first.
Secrets. A secret is any value that grants access: an API key, a database password, a signing secret. Two scanners cover it. Gitleaks searches files and the full git history for secret patterns and exits with code 1 when it finds any [4]. TruffleHog can also ask the provider whether a found key is still live, and with --fail exits with code 183 when it finds results [5]. On Supabase, only the publishable key (sb_publishable_..., or the legacy anon JWT) may reach the browser. Secret keys (sb_secret_..., or the legacy service_role JWT) bypass row-level security and must stay on the server [6].
Access. Two test accounts, A and B. Account B tries to read, change and delete what A created, using the same public key and endpoint an attacker would use, not the app's screens.
Sessions. OWASP's Session Management Cheat Sheet asks for session cookies marked Secure, HttpOnly and SameSite, a new session ID after login, and server-side invalidation on logout [7].
Dependencies. npm audit compares the installed packages with a vulnerability database and, by default, exits non-zero if it finds any vulnerability. --audit-level sets the lowest severity that fails the run [8].
Backups. A backup counts only once it has been restored. On Supabase, Pro projects keep 7 days of daily backups, Team 14 and Enterprise up to 30, and Supabase recommends that Free projects export their own data regularly with the CLI. Database backups do not include files in Storage [9].
An afternoon security self-check
Fig. 01- Secretshistory, bundle, live keys
- Accessuser B against user A
- Sessionscookie flags, logout
- Dependenciesnpm audit, high and up
- Backupsrestore once, count rows
By the numbers
- new hardcoded secrets added to public GitHub commits in 2025 [1]
- 28.65M
- year-on-year growth in leaked AI service secrets, to 1,275,105 [1]
- 81%
- of breaches start with vulnerability exploitation in Verizon's 2026 DBIR [2]
- 31%
- of daily backups kept for a Supabase Pro project, 14 on Team [9]
- 7 days
- worst-case data loss with Supabase point-in-time recovery enabled [9]
- 2 min
| Check | Tool or step | Pass | Finding |
|---|---|---|---|
| Secrets in history | gitleaks git . | Exit code 0 | Exit 1: rotate every listed key, then clean history |
| Live credentials | trufflehog git ... --results=verified --fail | Exit code 0 | Exit 183: a working key is public, rotate it today |
| Keys in the bundle | Pattern and JWT role scan of the build folder | Only publishable or anon keys | Any sb_secret_, sk_live_ or service_role |
| Dependencies | npm audit --omit=dev --audit-level=high | Exit code 0 | Exit 1: upgrade, or record why the path is unreachable |
| Backups | Restore into a scratch project | Row counts match production | No backup, or a restore never tried |
The secret numbers set the order of the afternoon. Leaked keys are common, they keep working until someone rotates them, and leaked AI service keys grew more than twice as fast as secrets overall [1]. An AI provider key in a public bundle is a bill paid by the founder. The breach number explains the dependency check: exploiting a known vulnerability is now the most common way in, ahead of stolen credentials, and every package an app ships adds to what can be exploited [2].
Implementation
Run the script below from the repository root after a production build, on a branch or a fresh clone. It only reads. Install gitleaks and TruffleHog from their official releases first.
#!/usr/bin/env bash
# afternoon-audit.sh: run from the repo root after a production build. Read-only.
BUILD_DIR="${1:-.next/static}" # Vite and most SPAs: dist
mkdir -p audit
echo "== 1. Secrets anywhere in git history"
gitleaks git . --redact -f json -r audit/history.json
echo "gitleaks exit $? (0 clean, 1 leaks found)"
echo "== 2. Live credentials (verified against the provider)"
trufflehog git file://. --results=verified --fail
echo "trufflehog exit $? (0 none, 183 verified secret found)"
echo "== 3. Privileged keys in code the browser downloads"
grep -rEo 'sb_secret_[A-Za-z0-9_-]+|sk_live_[A-Za-z0-9]+' "$BUILD_DIR" | sort -u
grep -rhoE 'eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+' "$BUILD_DIR" | sort -u |
python3 -c '
import sys, json, base64
for tok in sys.stdin:
part = tok.split(".")[1]
claims = json.loads(base64.urlsafe_b64decode(part + "=" * (-len(part) % 4)))
flag = "BLOCKER" if claims.get("role") == "service_role" else "ok"
print(flag, "JWT with role:", claims.get("role"))'
echo "== 4. Known vulnerabilities in production dependencies"
npm audit --omit=dev --audit-level=high
echo "npm audit exit $? (0 nothing high or critical)"Step 3 exists because a legacy Supabase service_role key is a JWT, a signed token whose payload is base64 text, so the words "service_role" do not appear in the key as plain text. The script decodes every token it finds and prints its role. A line starting with BLOCKER means the browser holds a key that bypasses every row policy.
Read the results in this order. A verified secret from step 2 is an incident: rotate the key at the provider first, then remove it from the code, because rotation is what stops access and history rewrites do not reach existing clones. A gitleaks finding without verification still needs rotation if the value was ever real. For npm audit, avoid npm audit fix --force on a deadline: npm's own documentation warns that it can install SemVer-major changes [8].
Test it
The access check is the one a scanner cannot do. Create two users on a staging project, sign in as each through Supabase's auth endpoint, and call the REST API directly, the way an attacker with your public key would. The table name notes stands in for any table that holds user data.
#!/usr/bin/env bash
# Staging only. Two test users you created. Needs SUPABASE_URL, PUBLISHABLE_KEY,
# USER_A_EMAIL, USER_A_PASSWORD, USER_B_EMAIL, USER_B_PASSWORD.
set -euo pipefail
login() {
curl -s "$SUPABASE_URL/auth/v1/token?grant_type=password" \
-H "apikey: $PUBLISHABLE_KEY" -H "Content-Type: application/json" \
-d "{\"email\":\"$1\",\"password\":\"$2\"}" | jq -r .access_token
}
A=$(login "$USER_A_EMAIL" "$USER_A_PASSWORD")
B=$(login "$USER_B_EMAIL" "$USER_B_PASSWORD")
rest() { # rest METHOD PATH TOKEN [JSON]
curl -s -X "$1" "$SUPABASE_URL/rest/v1/$2" -H "apikey: $PUBLISHABLE_KEY" \
${3:+-H "Authorization: Bearer $3"} -H "Content-Type: application/json" \
-H "Prefer: return=representation" ${4:+-d "$4"}
}
ID=$(rest POST notes "$A" '{"body":"private note A"}' | jq -r '.[0].id')
echo "B reads: $(rest GET "notes?id=eq.$ID" "$B")" # expect []
echo "B changes: $(rest PATCH "notes?id=eq.$ID" "$B" '{"body":"x"}')" # expect []
echo "B deletes: $(rest DELETE "notes?id=eq.$ID" "$B")" # expect []
echo "No session: $(rest GET "notes?id=eq.$ID" "")" # expect [] or 401
echo "A still has: $(rest GET "notes?id=eq.$ID&select=body" "$A")" # expect the noteExpected result: every line from B and from the call without a session prints [] (or an error for the last), and the final line shows A's note unchanged. Any row in B's output is a launch blocker. Repeat for each table that holds user data. For how row policies produce these results, see Row-Level Security, Explained.
Then finish the afternoon by hand:
- Session cookie. In the browser's developer tools, the session cookie shows
Secure,HttpOnlyandSameSite=LaxorStrict[7]. If the app keeps its token in local storage instead, as many single-page apps do, any script injected into the page can read it. Record that for the audit. - Logout. Copy a request with its token, log out, then replay it. Expected: the refresh token is rejected at once, and the access token stops working when it expires. Know how long that is.
- Login in the browser. Search the bundle for the admin password or a hardcoded user list. Expected: nothing, since login runs on a server [3].
- Backup restore. Restore the latest backup into a scratch project and compare row counts for your three most important tables. Expected: counts match within a day of activity [9].
- Storage. If users upload files, confirm a separate copy exists. Database backups do not include them [9].
Decision
Run the afternoon before launch, and again after any large AI-generated change.
- A verified secret, a
BLOCKERline, or any row returned to user B stops the launch until fixed. Everything else gets an owner and a date. - Rotate first, clean code second. A key that was public is compromised whether or not anyone used it.
- On a Free plan, schedule your own exports. Paying for a plan with daily backups costs less than one lost customer table [9].
- This is a self-check, not an audit. It covers the most common holes in AI-built apps, not business logic, payments or abuse cases. For the full catalog, see The 12 Failure Modes of AI-Built MVPs, and for the standards mapping, OWASP Security Checklist for AI MVPs.
Sources
- [1]The State of Secrets Sprawl 2026 (opens in a new tab)GitGuardian, March 2026
- [2]Vulnerability exploitation top breach entry point, 2026 industry-wide DBIR finds (opens in a new tab)Verizon, May 2026
- [3]Wiz Research Finds Risks in 20% of Vibe-Coded Apps (opens in a new tab)Wiz Research, September 2025
- [4]Gitleaks (opens in a new tab)Gitleaks on GitHub, November 2026
- [5]TruffleHog (opens in a new tab)Truffle Security on GitHub, November 2026
- [6]API keys (opens in a new tab)Supabase Docs, November 2026
- [7]Session Management Cheat Sheet (opens in a new tab)OWASP Cheat Sheet Series, November 2026
- [8]npm-audit (opens in a new tab)npm Docs, November 2026
- [9]Database Backups (opens in a new tab)Supabase Docs, November 2026
Technical guidance, not legal or security certification.
Related resources
Need a technical review of an AI-built MVP?
Discuss your build