Home / Blog / “But We Asked the AI for Secure…
AI and LLM Security
“But We Asked the AI for Secure Code”: Five Minutes, Three Vulnerabilities
A development manager told me proudly they now build five times faster with AI. I asked about security. Five minutes later I had found three vulnerabilities in the AI's code.
A few weeks ago a long-time client - someone I have worked with for years, now a development manager at a lovely little startup - called to ask my advice about security in their system.
He told me, full of enthusiasm: “We've moved to developing with AI. It's just insane - we write a prompt, we get code, and we build our system five times faster.” I smiled, because I had heard this quite a lot lately.
I asked: “And what about security?”
He said: “Obviously it's fine - the model knows Best Practices better than anyone, right?” (Hint: not always.)
They gave me an example of code the AI had written - a small API that connects to a database and manages users. Within five minutes I had found:
- A classic SQL injection, because the parameter went straight into the query.
- An endpoint that returned user data with no real authorization check.
- A JWT created with no expiration at all.
The manager looked at me and said: “But we asked for 'secure code' in the prompt…”
And here is the simple truth: an AI model does not understand security. It does not know what is genuinely dangerous in your system. It knows how to imitate code that looks correct from the outside - not how to think like an attacker.
AI is an incredible tool. It accelerates development, it raises ideas, it closes off annoying corners. But secure code still requires people who live security - people who know which questions to ask, and who can see what the ordinary eye misses.
The moral: if you hand the AI all of your development with no human eye that understands secure coding, you are not developing faster. You are just developing your vulnerabilities faster.
I first shared a version of this as a LinkedIn post on 2025-08-11. It is republished here, lightly edited, so it is easier to find and reference. — Erez Metula
Keep reading
More from the blog
AI and LLM Security
Somebody Wired the Darknet Into Your AI. What Could Go Wrong?
One MCP server packing 66 tools, feeding onion-site content straight into your model's context. The darknet is the most hostile input that…
Read itAI and LLM Security
Every Week Someone Asks Me When AI Will Replace Pentesters
Datadog released a scanner that sends your code to an LLM instead of matching patterns. After 20 years in this field: the…
Read itAI and LLM Security
Your AI Coding Tool Walks Straight Past Your Defences
A prompt injection hidden in a README, and the tool writes to your zshenv. Every new shell runs the attacker's code. And…
Read itTell us what the system does and what worries you.
If a penetration test is not what you need yet, we will say so.