VibeSecCheck
Home/Security Guides/vibe-coding-security-prompt
High RiskAI Builders & StacksCursorClaude CodeLovableBolt.newv0

Copy-Paste Vibe Coding Security Audit Prompt

Asking an AI coding assistant 'is my app secure?' produces vague platitudes. Giving it a structured, threat-modeled security prompt forces it to inspect exact file boundaries, SQL policies, and auth checks.

Why AI Builders Introduce This

Generic prompts let LLMs skim files superficially and mark insecure defaults as 'fine for an MVP'. A concrete checklist prompt constrains the model to verify each trust boundary line by line.

Real-World Exploit Impact
  • Uncovers silent auth bypasses and unverified server actions before users hit production
  • Produces actionable diffs instead of generic security advice
  • Prevents regressions when embedded in .cursorrules or CLAUDE.md

Vulnerable Pattern vs. Production Fix

Weak Security Prompt (Produces False Confidence)text
Can you check my codebase and tell me if there are any security issues?
Make sure everything looks good before I launch on Product Hunt.
Threat-Modeled .cursorrules / CLAUDE.md Guardrail
## Mandatory Security Rules (Never Violate)
- NEVER expose secret API keys via NEXT_PUBLIC_* or VITE_* env vars.
- NEVER trust userId, role, plan, or price from client request bodies.
- EVERY Supabase table in public schema MUST enable RLS with explicit auth.uid() policies.
- EVERY mutation route MUST verify server session + ownership (IDOR check).
- EVERY webhook route MUST verify cryptographic signatures on raw body bytes.

Copy-Paste AI Fix Prompt (Cursor · Lovable · Bolt · Claude Code)

Act as an offensive AppSec reviewer auditing this vibe-coded repository. Inspect all API routes, Server Actions, Edge Functions, middleware, config files, and SQL migrations. Report ONLY concrete, verifiable vulnerabilities with exact file paths and line numbers across these 7 classes:
1. Secret leakage (keys in NEXT_PUBLIC_/VITE_ or hardcoded strings).
2. Database authorization (Supabase RLS disabled, USING (true) policies, or service_role used in client code).
3. Auth & IDOR (routes missing session checks or trusting client-supplied userId/teamId/price).
4. Payment & webhook flaws (missing Stripe/LemonSqueezy signature checks or client-writable subscription tables).
5. Unthrottled AI/LLM or email endpoints vulnerable to wallet-draining abuse.
6. SSRF / open redirect / raw SQL / dangerouslySetInnerHTML injection vectors.
7. Missing security headers (CSP, HSTS, X-Frame-Options, nosniff) or public sourcemaps.
After listing findings sorted by severity, wait for my approval or patch CRITICAL items directly.

How to Verify Your Fix Worked

  1. 1Save the guardrail snippet into .cursorrules or CLAUDE.md so every future prompt follows it.
  2. 2Run the audit prompt once after implementing auth and again right before deploying.
  3. 3Validate external posture with VibeSecCheck live URL scanner to catch build-time leaks.

Frequently Asked Questions

Should I put security rules in .cursorrules or CLAUDE.md?

Yes. Placing non-negotiable rules about RLS, server-only secrets, and session verification in .cursorrules or CLAUDE.md stops the AI from re-introducing vulnerabilities during feature sprints.

Can an LLM find every security bug in its own code?

No single check catches everything. Combine static prompt audits with an external passive URL scan (like VibeSecCheck) and manual incognito testing of your API endpoints.

Does this prompt work in Lovable and Bolt.new?

Yes — paste the prompt directly into Lovable chat or Bolt.new, and ask it to list findings first before applying migrations and edge function patches.

Related Security Playbooks