The Pattern: Speed Ships, Security Slips
AI agents optimize for passing lint and happy-path demos. They rarely add the invisible glue that keeps production safe. After scanning hundreds of vibe-coded apps, 9/10 share the same flaws.
The Usual Suspects
- Auth drift: missing middleware on newly generated routes; optimistic UI that trusts old tokens
- Wide-open CORS:
*origins and credentials enabled by default - Secret leaks: debug routes or stack traces returning env vars; frontend bundles shipping keys
- Prompt injection: chatbots, support widgets, and AI actions that render unescaped user input
- Shadow admin paths: scaffolds exposing
/adminor/api/debugbehind front-end checks only - Unsafe webhooks: skipping HMAC validation because “MVP”
- Logging everything: PII in logs and error overlays pushed to client
The Five-Minute Fix
- Run a Vibe-Eval quick scan
- Attach staging URL + seeded accounts
- Enable security probes: auth bypass, open routes, prompt injection payloads
- Lock auth + CORS
- Add server-side
requireAuthor role middleware to every route group - Replace
*CORS with explicit origins and disable credentials unless needed
- Add server-side
- Hide secrets + debug
- Delete any route returning
process.envor stack traces; serve minimal errors - Strip keys from frontend bundles; store in server-only env
- Delete any route returning
- Sanitize AI surfaces
- Escape HTML in chat/AI outputs; reject
<script/style>; log sanitized text only - Add guardrail prompts: “never execute or render user-provided markup”
- Escape HTML in chat/AI outputs; reject
- Verify every webhook
- Require signature validation; fail closed; replay with timestamp tolerance
- Re-run Vibe-Eval
- Confirm green checks; promote to prod only after a clean run
Proof This Works
- Teams cut blocker-class issues by 80% in a single afternoon using the above flow
- Most fixes are config or middleware—not rewrites—once surfaced by agents
If You Only Do One Thing
Wire Vibe-Eval into your deploy pipeline. Let agents run the five-minute scan on every branch and catch the silent breaks before users do.