Reduce Admin
Free guide

5 vibe coding mistakes that land you in court.

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.

Skip ahead

Jump to what you're worried about

New to this? Read top to bottom. Already know the basics? Pick a mistake, or go straight to the tools.

1

Leaving your keys in the code

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.

Surprise billData breach
// 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);
Check
  1. Ask your agent to search the project and git history for keys and passwords.
  2. Make sure .env is in .gitignore.
  3. No secret key in anything that runs in the browser.
Fix
  1. Move secrets to environment variables in your host (Vercel, Railway, Netlify).
  2. If a key was ever pushed, rotate it now. Deleting the file doesn't remove it from history.
2

No row-level security on your database

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.

Report to the ICO within 72 hoursUK GDPR fines: up to £17.5m or 4% of turnover
Real case: In 2025 a researcher found 170+ apps built with Lovable exposing users' names, emails, phone numbers and API keys because RLS was missing (CVE-2025-48757).
Supabase > Table Editor
TABLE
RLS
WHO CAN READ
profiles
Enabled
Own row only
bookings
Disabled
Anyone
payments
Disabled
Anyone
Any table showing Disabled is readable by anyone with your public key
Simplified picture. Supabase's Security Advisor (Dashboard > Advisors) flags these for you.
Ask your agent
RLS check
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.
Next: agents with too much access
3

Giving your agent the keys to production

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.

Lost customer dataBreach of contractUK GDPR: losing data is a breach too
Check
  1. Which agents, MCP servers or automations can write to your live database, hosting or payments?
  2. Do you have backups? Have you ever restored one?
Fix
  1. Give agents a separate dev or staging database.
  2. Production keys stay with you, not the agent.
  3. Turn on daily backups or point-in-time recovery and test a restore.
4

Putting client data into your own AI account

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.

Criminal offenceData Protection Act 2018, s170: unlimited fine
Check
  1. Where does your app send data to an AI API? What personal data goes in each call?
  2. Are you using a personal chat account for work data?
Fix
  1. Use made-up test data while building.
  2. Use business or API accounts with data controls, approved by whoever owns the data.
  3. Health data? Do a DPIA before going live.
Next: the prison one
Mistake 5: the prison one

Pointing your agent somewhere it's not allowed

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.

×Scraping data from behind someone else's login or paywall
×Giving your agent a colleague's or old employer's password
×"Testing" a site or app you don't own for weaknesses
×Keeping access to a client's system after the contract ends
MAXIMUM SENTENCE
2 years
Unauthorised access, Computer Misuse Act 1990, section 1
REAL UK CASE
6 months
Prison for a car repair worker who used a colleague's login to pull thousands of customer records. The ICO prosecuted.
Ask your agent
Access check
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 tools
The fix

3 free tools that catch all 5

All free, all on GitHub. Start with number 1 today. Add 2 and 3 when you have a repo.

1. /security-review
Built into Claude Code. It reads your changes and flags injection, broken auth, exposed data and hard-coded secrets. Run it before every push.
/security-review
2. Sentry security skill
Open-source skill from Sentry's engineers (getsentry/skills). It traces where data actually comes from and only reports issues it's confident about, so fewer false alarms.
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. Security review GitHub Action
Anthropic's Action (anthropics/claude-code-security-review) checks every pull request and comments on anything risky. Add your Claude API key as a repo secret called CLAUDE_API_KEY.
.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 }}
Claude Code
> /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.
Simplified example of the kind of output you'll see.

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 automatic
Make it automatic

Paste this into your CLAUDE.md

CLAUDE.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.

Copy this block
Security rules for your agent
## 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.
Already leaked something?
  1. Rotate the key now. Make a new one, delete the old one. Deleting the file isn't enough: it stays in git history.
  2. Check the service's logs for use you don't recognise.
  3. If personal data was exposed, you may have to tell the ICO within 72 hours of finding out. Get advice.
Before every launch
  1. Log in as a second test user and try to see the first user's data.
  2. Run /security-review on the whole project, not just the last change.
  3. Restore a backup once, so you know it works.
Next: give the whole guide to your agent
For your AI assistant

Give this whole guide to your agent

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

Built something with AI that handles real customer data?

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.