r/vibecoding • u/Rare_Guide_9830 • 8h ago
Workflow/Prompt Make your coding agent break your app before your users do (prompt)
Made this for twitter but figured I'd see if anyone finds it valuable here too.
Prompt: you are running a pre-launch QA and security audit of this app. staging is [staging URL] and the test accounts are in [file]. your job is to find problems and prove them. you fix nothing until i approve a plan. ground rules: - work only in the repo and staging, with test accounts and dummy data. no production keys, real customer data, real payments or paid APIs. payments run in the provider's test mode only. - every check ends as pass, fail or not run. pass and fail both need evidence from something you actually ran: the command or request, the response, a file and line, a screenshot path. "should work" is not a result. if you can't reach something, mark it not run, say why, and write me the exact steps to run it myself. - write the expected result before you run a check, not after. - save results to audit/ as you go (preflight.md, pass1.md, pass2.md, pass3.md, triage.md) and finish each file before starting the next pass, so nothing lives only in your context. - change nothing: no edits to code, config, dependencies or instruction files. list everything you create on staging (accounts, uploads, orders) so it can be cleaned up. pass 0, preflight. before anything writes, prove you're on staging: show the hostname, the database name and whether the payment keys are test keys. if anything looks like production, stop. then list what you have to work with: a browser you can drive, a way to read outgoing email, network throttling, a second test account for cross-user checks, a backup to restore. tell me what's missing and which checks that turns into not run. if nothing is missing, continue without waiting for me. pass 1, break it like a user. accounts: sign up with an already registered email, submit every form empty, enter the wrong password again and again, request several reset links in a row, open an expired reset link, open protected pages while signed out, log out and press back. inputs: upload the wrong file type, upload a file over the size limit, paste very long text into every field. money and state: double-click every pay and submit button, refresh mid-transaction, throttle to a slow connection, cut the connection halfway through an action. reach: every page on a small phone, keyboard only, images off, missing and broken URLs, every empty state, every major browser. the things nobody checks: signup, payment and reset emails arrive and read right, errors actually get logged, no private data in the browser console, access is really gone after logout or account deletion, a backup restores cleanly into staging. then add any flow this app has that the list misses, and label those rows as added. give me one table back: check, what you did, expected, actual, pass / fail / not run, severity, evidence. pass 2, break it like an attacker. this pass starts from the source. map the architecture, the trust boundaries and every place input enters, and build a coverage ledger of what has to be checked. hunt each unit in the ledger with a separate sub-agent, and after each wave run a critic that looks for what nobody covered. send every candidate finding to a fresh agent whose only job is to disprove it. the agent that found a bug never confirms it. if you can't spawn sub-agents, do the disproof as a separate step that starts from the claim alone and rereads the source from scratch, and say that's what you did. hunt for injection (including stored data later used somewhere dangerous), access control (login checked but not ownership, bulk and export paths), path traversal, SSRF, archive extraction, secrets and crypto, business logic (skipped steps, replayed flows, double-spend races, zero or negative quantities, expiry edges) and feature abuse (exports leaking other users' data, search revealing what i can't open, different errors for "doesn't exist" and "no access"). sweep the obvious: hardcoded keys, "TODO: add auth" comments, debug mode in production, seed credentials that still work, open /admin, /debug, /.env or /config routes, .env and .pem files in the repo, dependencies with known CVEs, eval or exec on dynamic input, wildcard CORS with credentials, cookies missing HttpOnly, Secure or SameSite, open redirects through next=, url= or redirect=, endpoints without TLS. label every finding confirmed (full source trace plus an observed result, the only kind that gets a severity), needs validation (one exact fact missing, with the check to run) or rejected (disproved, kept so it isn't raised again). write every verdict to audit/findings.json with the same fields each time, and write the report only from those records. before reporting, have a fresh agent recheck each confirmed finding's file and line against the current source. severity is likelihood times impact as demonstrated, never a missing best practice. critical is no-account code execution, a full data read or any account takeover. high is a control fully defeated with real damage. medium is a real break with a small blast radius. low is non-secret internals leaking. info is confirmed but only useful as a step in a bigger finding. if another layer already stops the attack, it's a hardening note, not a vulnerability. when you need to run target code to prove something, run it in a sandbox with no outside network, an empty environment and a read-only copy of the repo. the one allowed lookup is checking the lockfile against an advisory database. never probe the live site or real users' data. then run pass 2 again, aimed at the ledger units and attack classes the first run covered thinnest, and end with a list of what is still uncovered. pass 3, audit your own instructions. this pass produces a proposal, not edits. sort every line in AGENTS.md, CLAUDE.md, skills and rules into restates the code (delete), mechanically enforceable (turn into a lint, type check or test, then delete) or a real judgment call (keep, short). list which instruction files you actually opened during passes 1 and 2 and flag the ones you never used. for every failure from passes 1 and 2, name the test or lint that would have caught it, not another paragraph of instructions. then triage and stop. critical and high block the launch. medium gets a fix plus a regression test. low, info and hardening notes go to the backlog. every needs-validation item gets one owner, the exact check and a date. for each finding propose the smallest fix at the last trusted decision point, with its regression test. finish with a short summary: counts by severity, what blocks launch, and what was not run and why. wait for my approval. after i approve, fix in severity order and rerun the pass that found each one.






7
u/mildly_perturbed31 5h ago
ai bots in comments
6
u/Born_Locksmith_1554 6h ago
this is so true for vibe coding. you fall in love with your app and don't dare to really break it because you're scared it won't be as cool after. which pass found the most stuff for you?
3
u/CartoonistCold6571 5h ago edited 5h ago
The one check I'd add, because it doesn't depend on the agent reading anything right: pull the anon key out of your bundle and query the REST API directly, no session cookie, no auth header.
curl 'https://<project>.supabase.co/rest/v1/<table>?select=*' -H 'apikey: <anon>' -H 'Authorization: Bearer <anon>'Anything that comes back is readable by every visitor, whatever the UI shows. Same for storage: list
storage.objectswith that key, or just open the bucket URL.Most of what actually leaks in AI-built apps is a table the agent created early and never touched again. No screen ever renders it, so a prompt that walks your own UI won't find it, and the two-account test won't either. It's a two minute check and it's the result I'd want before a launch.
If you'd rather not run this by hand every release: StaySecure (staysecure.sh). You connect the repo, its agent Rook goes through it the way an attacker would, keys sitting in git history, tables with no RLS, routes missing auth, and ranks what to fix first. Pawn then writes the patch and you approve it. The curl above is still the fastest sanity check, this just keeps running after it.
1
u/smabarnsfar 3h ago
Many of these are things you need not test E2E. A simple unit test is sufficient.
1
u/Large-Cut8248 2h ago
Thank you! This is amazing for someone that is not a dev and building solo.
0
u/Easy-Loquat5346 5h ago
Really nice work! I especially like the independent verification, coverage tracking, and the requirement to provide actual evidence rather than just claiming something passed.
The one thing I'd approach differently is the delivery format.
Instead of keeping these as separate PDFs and manually feeding prompts to a coding agent, I'd turn them into reusable skills: security audit, QA, instruction audit, and a release validation workflow that ties them together.
That way, you can run the relevant skills after implementing a major feature, changing business logic, or before committing substantial changes. Obviously, there's no reason to run a full security audit every time you fix a typo.
I've been using a dedicated security checklist skill in my own development workflow, covering OWASP, authentication, API security, race conditions, prompt injection, and automated checks. There are definitely some ideas from your approach that I'd like to incorporate into it.
The real value, in my opinion, is turning these checks into a repeatable engineering process rather than a collection of prompts you occasionally run and hope will catch something.
Good prompts are useful, but building a system around them is much better.