What are the security risks of AI-assisted coding ("vibe coding"), and which measures counter them?
Risks: vulnerable or hallucinated code, sprawling dependencies, leaked IP and secrets, AI-assisted reverse engineering, licence violations, skill erosion. Measures: treat AI as a tool, verify manually, test everything, scan for secrets and licences, monitor AI use, apply DLP and train developers.
AI helps with code generation and refactoring, test automation and debugging, and code review and vulnerability detection. Each benefit has a matching risk:
| Risk | Why it happens |
|---|---|
| Vulnerable code | Models reproduce the insecure patterns they were trained on |
| Broken or hallucinated code | Plausible-looking calls to APIs or packages that don't exist |
| Complex architectures, many sub-libraries | Generated code pulls in dependencies nobody chose |
| Leaked IP and secrets | Source code and keys pasted into an external service |
| AI-assisted reverse engineering (AIARE) | Attackers use the same tools on your binaries |
| Licence violations | Output that copies licensed code |
| Skill erosion | Developers stop understanding the code they ship |
The measures follow from "use AI as a tool, not as a coworker". Someone accountable reviews every line. In practice: discover and assess all AI use, verify manually, keep classic SAST/DAST in the loop, run secret and licence scanners, monitor AI use, apply DLP, and keep secure coding training going.
Go deeper:
Vibe coding (Wikipedia) — origin of the term and documented security incidents
OWASP Top 10 for LLM applications — the risks of the tools themselves