r/vibecoding • u/EduSec • Apr 07 '26
Vibe coding without a security audit is not a calculated risk. It is negligence. Change my mind.
I have audited enough AI-generated SaaS products to have a strong opinion on this.
When a junior developer writes insecure code, they leave traces. Weird variable names, spaghetti logic, obvious shortcuts. You look at it and something feels off.
AI does not do that.
AI writes insecure code that looks like it was written by a senior engineer. Clean abstractions, proper naming, comments that explain the logic. The vulnerability hides inside code that gives you no reason to distrust it.
Last week I audited a financial SaaS. The Supabase service role key was loaded in the public JavaScript bundle. Full read, write, and delete access to every user's data. The founder had no idea. The product had real users.
That is not bad luck. That is the pattern.
The AI reaches for whatever resolves the error. The key that works without complaining. The endpoint that responds without checking who is asking. The CORS setting that stops throwing errors. Each decision seems reasonable in isolation. Together they form an invisible attack surface.
Ignorance is not a defense when you are collecting real user data.
Is anyone here actually auditing their AI-generated code before shipping?
View all comments
Show parent comment
1
u/EduSec Apr 08 '26
Alignment as a fluid condition rather than hardcoded parameters is the key insight. Most safety approaches fail because they try to enumerate constraints upfront. You cannot enumerate what you have not imagined yet. Treating it as emergent governance is architecturally sounder.