Security
From zero to DevSecOps: a roadmap that doesn't need a security team
How to go from no security process to shift-left, one small step at a time.
Security · 5 min read · 19 Oct 2026
The ways AI-generated code quietly introduces vulnerabilities, and how to review it.
AI code assistants are good enough now that a developer can ship a feature mostly written by a model. The code usually compiles, often works, and sometimes is more readable than what a tired human would write. The part that gets people into trouble is the assumption that working code is secure code.
Models are trained to produce code that looks right, not code that’s safe. The vulnerabilities they introduce tend to be subtle, because they’re the average of a lot of insecure code written by humans.
A model’s training data includes years of code written against old versions of libraries and frameworks. Ask it to write something in a language where the secure way of doing things changed recently, and it may confidently produce the old, vulnerable pattern — the deprecated crypto call, the connection string with the password in it, the regex that was known to be unsafe.
The code runs, so nobody questions it. The fix is to treat AI output as a first draft and check it against the current version of the library you’re actually using.
Models hallucinate library names, function signatures and configuration options. In security terms this matters in a specific way: a developer pastes in a call to a “validation” or “sanitisation” function that sounds right but doesn’t exist, and the code still compiles because the model also wrote the function — doing nothing.
This is hard to spot in review, because it reads plausibly. It’s worth explicitly checking every function the AI wrote that claims to validate, sanitise, authenticate or encrypt.
Authentication and authorisation are the least glamorous part of an application, and they’re where AI code is weakest. The model writes the happy path — the feature that works when the right user calls it — and quietly omits the check that the wrong user can’t. Endpoints that should require login don’t. Objects fetched by ID aren’t checked against ownership.
A human reviewer skims for “does it work”. You have to specifically look for “who can call this, and what can they access”.
The model doesn’t know your users, your data or your compliance obligations. It writes generic code for a generic problem. The security holes that matter most to you — the personal data flow, the third-party integration, the internal API that should stay internal — are exactly the things the model can’t reason about.
The process is the same as reviewing human code, with the emphasis moved.
None of this is a reason to stop using AI assistants — the speed gain is real. It’s a reason to treat the output the way you’d treat code from a new contractor: promising, but not trusted until you’ve checked the security-sensitive parts yourself.
Keep reading
Security
How to go from no security process to shift-left, one small step at a time.
Security
What prompt injection looks like in real systems, why there's no complete fix, and the layers that shrink what an attack can do.
Security
The Model Context Protocol gives AI agents real tools. Here's what can go wrong, and a checklist for connecting MCP servers safely.
Next step
Book a scoping call and talk it through with our team.