AI writes the code. Who checks it?
AI-generated code brings new risks, including packages that don't exist. How to catch them in CI.
AI-generated code brings new risks, including packages that don't exist. How to catch them in CI.

A growing share of the code in our repositories wasn't typed by a human. AI assistants write functions, tests, Dockerfiles and Terraform. Agents open whole pull requests. That's a huge productivity boost.
The increase in code volume means there's more to review, but the time available hasn't changed. Plus, AI-generated code has its own kind of mistakes. So the pipeline needs to do more checking.
Insecure patterns that look fine. AI learned from public code, and a lot of public code is insecure. SQL built from strings, disabled TLS verification, overly broad permissions, secrets in config files.
Outdated advice. Deprecated APIs, old library versions with known vulnerabilities, Kubernetes manifests using removed API versions.
Hallucinated dependencies. The AI suggests importing a package that sounds right but doesn't exist.
License problems. Generated code that closely resembles code under a restrictive license.
Bigger changes, less review. When generating code is easy, pull requests get larger, and large pull requests get worse reviews.
This one deserves its own section because it's new and sneaky.
Language models sometimes invent package names. Plausible ones, like requests-oauth-helper or express-secure-session. Researchers noticed that the same invented names come up repeatedly. So attackers can register those names on npm or PyPI and fill them with malware. When a developer, or an agent, trusts the suggestion and installs the package, the attacker's code runs.
It's a twist on typosquatting, and the community nicknamed it slopsquatting.
An AI suggesting a package isn't a recommendation. It's a guess, and attackers are betting on those guesses.
None of this needs exotic tools. It needs the normal DevSecOps toolbox, actually switched on and enforced:
Tools catch patterns. Humans still need to catch logic. A few habits help:
The pipeline checks what it can automatically, and a human checks what really matters. That's how it's always worked. AI just makes it harder because there's more code, written faster, by something that never hesitates.
My take: AI can write the code. Your pipeline and your reviewers still have to earn the right to ship it.
— Desly