AI lets anyone ship an app in a weekend. It also lets anyone leak their customers' data in a weekend. Here are the 5 mistakes that cause real trouble under UK law, the real cases behind them, and 3 free GitHub tools that catch them before you push.
20 minutes to set up. Inside: what each mistake looks like, how to check for it, the install steps for each tool, a rule block for your CLAUDE.md, and a guide you can hand straight to your AI.
Free. Works with Claude Code, Cursor, Lovable or Replit. Not legal advice.
New to this? Read top to bottom. Already know the basics? Pick a mistake, or go straight to the tools.
About 29 million secrets leaked on public GitHub in 2025, and AI-assisted commits leaked at roughly twice the normal rate (GitGuardian). Bots scan for keys around the clock. A live Stripe or OpenAI key can be abused within hours.
// What it looks like const stripe = Stripe("sk_live_51Hx...9fQ"); // What it should look like (server only) const stripe = Stripe(process.env.STRIPE_SECRET_KEY);
Supabase and Firebase apps put a public key in the browser. That's fine, if the database checks who's asking. Without row-level security (RLS), anyone with that key can read every user's data.
List every table in my Supabase project. For each one, tell me if row-level security is enabled and what the policies allow. Write the SQL to enable RLS and add a policy so users can only see their own rows (auth.uid() = user_id). Don't run it until I approve.
In July 2025, Replit's AI agent deleted a company's live database during a code freeze, then told the founder it couldn't be recovered. The agent had access, so it acted.
Copying customer or patient records out of the business system into your personal ChatGPT to "build something quick" can be a criminal offence, even with good intentions.
Agents will happily log in, click around and scrape whatever you point them at. The law doesn't care that an AI did the clicking. If you told it to, it's you.
List every website, API or system this project connects to. For each one tell me: whose account it uses, whether it gets round a login or paywall, and whether we have permission or an official API. Flag anything that needs written permission.
The safe rule: your own systems, official APIs, or written permission. Nothing else.
Next: the 3 free toolsAll free, all on GitHub. Start with number 1 today. Add 2 and 3 when you have a repo.
/security-review
claude plugin marketplace add getsentry/skills claude plugin install sentry-skills@sentry-skills
.github/workflows/security.yml
name: Security Review
on: pull_request
permissions:
pull-requests: write
contents: read
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- uses: anthropics/claude-code-security-review@main
with:
comment-pr: true
claude-api-key: ${{ secrets.CLAUDE_API_KEY }}> /security-review Reviewing 6 changed files... HIGH src/lib/stripe.ts:4 Live Stripe secret key hard-coded in client bundle. Fix: move to STRIPE_SECRET_KEY on the server. Rotate the key. HIGH supabase/migrations/001_init.sql Table "bookings" has row-level security disabled. Fix: enable RLS, add policy auth.uid() = user_id.
Using npm or pip packages? Add Trail of Bits' free skills too: /plugin marketplace add trailofbits/skills, then install supply-chain-risk-auditor to check your dependencies.
Next: make it automaticCLAUDE.md (or AGENTS.md in Cursor and Codex) is the file your agent reads every time it starts. Put these 5 rules in it and your agent checks itself before every push.
## Security rules Before any commit or deploy: 1. Run /security-review on the changes. 2. Never commit secrets. Use environment variables. 3. Never connect to the production database. 4. Never send personal data to a new AI service without asking me. 5. Never access a site or system I haven't confirmed we're allowed to use.
Copy everything in the box. Paste it into Claude Code, Cursor or ChatGPT inside your project and say: "Read this guide and run the security check on this project." It asks you 5 questions, checks all 5 mistakes and gives you a red, amber, green fix list.
# Vibe Code Security Check: guide for AI agents > **Human:** put this file in the root of your project (or paste it into Claude Code, Cursor or ChatGPT) and say: > "Read this guide and run the security check on this project." > From reduceadmin.com/vibe-code-security-guide > Not legal advice. It helps you catch common mistakes. It does not replace a proper security review for anything handling sensitive data. --- ## Your job (agent) Check this project for the 5 mistakes below before anything is pushed or deployed. Report what you find in plain English, rank it by risk, and fix only what the user approves. ## Rules 1. **Never print a full secret.** Show the first 4 characters and the file and line only. 2. **Never run anything against a system the user doesn't own** or hasn't given written permission to test. 3. **Never touch production.** Read-only checks only, unless the user says otherwise for a specific step. 4. Ask the user **one question at a time**, with an example answer. 5. Explain each finding as if to a beginner: what it is, what could happen, how to fix it. ## Step 1: Ask the user - What does the app do, and who uses it? - Does it store personal data? (names, emails, phone numbers, health, payments) - What's it built with? (e.g. Lovable + Supabase, Next.js + Vercel, Replit) - Where is the code? (GitHub repo name, public or private?) - Does any AI agent have access to the live database or hosting? ## Step 2: Check the 5 mistakes ### 1. Keys in the code - Search the whole project and git history for API keys, passwords and tokens (sk_, pk_live, AKIA, ghp_, eyJ, "password", "secret", "api_key"). - Check that .env files are in .gitignore and were never committed. - Check that no secret key is used in frontend code (anything that runs in the browser). - **Fix:** move secrets to environment variables. If one was ever pushed, tell the user to **rotate it now** (create a new key, delete the old one). Deleting the file is not enough: it stays in git history. ### 2. No row-level security (RLS) - If the project uses Supabase or Firebase, list every table or collection. - For Supabase: check RLS is **enabled** on every table and that policies limit users to their own rows. Tell the user to run Supabase's Security Advisor (Dashboard > Advisors). - For Firebase: check rules are not "allow read, write: if true". - **Fix:** enable RLS and write a policy per table, e.g. auth.uid() = user_id. Test by trying to read another user's row while logged in as a test user. ### 3. Agent with production access - Find any AI agent, MCP server or automation with write access to the live database, hosting or payments. - Check backups exist and have been restored at least once. - **Fix:** give agents a separate dev or staging database. Production keys stay with the human. Turn on point-in-time recovery or daily backups. ### 4. Personal data sent to AI tools - Find every place the app sends data to an AI API (OpenAI, Anthropic, Gemini, etc.). - List what personal data goes in each call. - **Fix:** send the minimum. Use business or API accounts with data retention controls, not personal chat accounts. If health data is involved, the user needs a DPIA before going live. Never copy customer records from a business system into a personal AI account. ### 5. Accessing systems you're not allowed into - Find any scraper, crawler, browser automation or API call to a third-party site. - For each one, ask: does it log in with someone else's credentials, get round a login or paywall, or break the site's terms? - **Fix:** remove it, or get written permission or use the site's official API. In the UK, unauthorised access is a crime under the Computer Misuse Act 1990. ## Step 3: Run the tools Tell the user to install and run these (all free): 1. Claude Code built-in review: in Claude Code, type /security-review 2. Sentry's security skill (open source, reports high-confidence issues only): claude plugin marketplace add getsentry/skills claude plugin install sentry-skills@sentry-skills Restart Claude Code, then ask: "Run a security review on this project." 3. Anthropic's GitHub Action (reviews every pull request): add .github/workflows/security.yml from github.com/anthropics/claude-code-security-review and add CLAUDE_API_KEY as a repository secret. 4. Optional, for dependencies: /plugin marketplace add trailofbits/skills, then install supply-chain-risk-auditor. ## Step 4: Report Write the report in this format: # Security check: [project], [date] Risk: RED / AMBER / GREEN ## Fix today (RED) - [finding], [file:line], [what could happen], [fix] ## Fix this week (AMBER) ## Fine for now (GREEN) ## Keys to rotate - [service], [first 4 chars], [where it was found] ## Step 5: Before every push from now on Add this to the project's CLAUDE.md or AGENTS.md: Before any commit or deploy: 1. Run /security-review on the changes. 2. Never commit secrets. Use environment variables. 3. Never connect to the production database. 4. Never send personal data to a new AI service without asking me. 5. Never access a site or system I haven't confirmed we're allowed to use. ## If something has already leaked 1. Rotate the key straight away. 2. Check the service's logs for use you don't recognise. 3. If personal data was exposed, the user may have to report it to the ICO **within 72 hours** of finding out (ico.org.uk/report-a-breach). Tell them to get advice. ## Done when - [ ] No secrets in code or git history (or all leaked ones rotated) - [ ] RLS on every table, tested with a second user - [ ] Agents have no production write access; backups tested - [ ] AI calls send the minimum personal data - [ ] No unauthorised scraping or logins - [ ] /security-review added to the pre-push routine
We review vibe-coded apps before they go live: keys, database rules, agent access and data flows, with a plain-English fix list.
Facts and tools checked November 2026. This guide is general information, not legal advice. Updated 6 November 2026.