Key Takeaways
- AI coding assistants are now the default for most developers, and they produce working code far faster than any team could by hand.
- That speed has a cost. Research keeps finding that a large share of AI-generated code ships with a known security flaw.
- The common problems are boring and repeatable: injection flaws, leaked secrets, weak settings, and open-source packages nobody checked.
- Automated scanning catches most of these while the code is still fresh, which is the cheapest moment to fix anything.
- A scan tells you what might be wrong. A human penetration test tells you what an attacker could actually do. Strong teams use both.

A workplace of a software developer – illustrative photo. Image source: Alexandru Acea via Unsplash, free license
Building an app used to take a team weeks. Now a developer can describe a feature in plain language and watch an AI assistant write it in minutes. That shift is real, and it is not slowing down. Most developers already lean on these tools every day, and many new products are built with AI writing a large share of the code.
The problem is that fast code is not the same as safe code. An AI assistant is trained to produce something that works, not something that holds up against a determined attacker. It will happily reuse an old library with a known hole, drop a secret straight into the source, or skip a check that a careful engineer would never miss.
None of this means you should stop using AI coding tools. It means security has to move at the same speed. For teams building AI products, from chatbots to image recognition and other AI tools, the stakes are higher, because these apps often touch sensitive data and customer trust from day one. The good news is that the fixes are well understood and easy to build into the way you already work.
Why AI Coding Tools Changed the Security Game
For years, security teams worried about the code a company wrote. Now they also have to worry about the code a company generates. The volume is the first shift. When one developer can produce the output of five, the number of lines that need checking grows just as fast.
The Speed Is Real, and So Is the Risk
The pace is the whole story. Security firm Apiiro reported in mid-2025 that teams using AI assistants were generating code up to four times faster, but surfacing around ten times more security findings in the process. By June 2025, it counted thousands of new security issues appearing every month in code that AI helped write.
The habits around that code make it worse. In Checkmarx research on the state of application security, most organizations admitted they knowingly ship code with vulnerabilities still in it, usually under pressure to hit a deadline. Fast tools plus deadline pressure is exactly how avoidable flaws reach production.
So the picture is not that AI writes terrible code. It writes plausible code quickly, and a real share of it hides a flaw. At human review speed, nobody can keep up with that on their own.
Where the Weak Spots Show Up
The flaws are not exotic. They are the same mistakes that have caused breaches for years, now produced at a larger scale. The ones that show up most often include:
- Injection flaws, where user input reaches a database or system command without being cleaned first.
- Cross-site scripting, where an app renders untrusted input straight into a page.
- Weak or missing authentication, where a login or token check is sloppy or absent.
- Hardcoded secrets, where an API key or password sits right in the source code.
- Outdated dependencies, where the code pulls in an old package with a public, known vulnerability.
Each one is fixable. The challenge is finding all of them across code that is being written faster than anyone can read.
Scanning Early: Catch Problems While the Code Is Fresh
The cheapest time to fix a security flaw is the moment it is written, while the developer still has the whole thing in their head. The most expensive time is after a breach. The gap between those two moments runs into the hundreds, sometimes thousands, in time and money.
That is the whole case for scanning early, an idea often called “shifting left.” Instead of waiting for a security review near launch, you check the code as it is created, inside the pull request your developers are already looking at. Good scanning covers more than one layer. It checks your own code for risky patterns, lists every open-source package you pull in and flags the ones with known flaws, hunts for secrets that should never be in source, and reviews container images and cloud settings for weak configuration.
Pulling all of that into one place, instead of running five separate tools that do not talk to each other, is what makes it stick. A platform like Aikido brings these checks together and, just as important, filters the results down to the issues that are actually reachable in your app, so your team fixes what matters instead of drowning in alerts.
Dependencies You Never Chose
When an AI assistant writes a feature, it rarely writes it alone. It reaches for libraries and pulls in packages, and most teams have no clear idea what ends up in there. You pick a few directly, and those pull in dozens more behind the scenes, called transitive dependencies.
AI tools make this worse by suggesting whatever package fits the task, including ones that are outdated or no longer maintained. A known flaw in a public library is one of the easiest ways into an app, because attackers scan the whole internet for software still running the vulnerable version. Automated dependency scanning is the only practical way to know what you are actually shipping.
Secrets and Settings Left in the Open
The second quiet risk is configuration. AI-generated code often works on the first try, which feels great, but “it works” and “it is locked down” are different things. A storage bucket set to public, a database with a default password, or an API key written straight into a file can all slip through because the app still runs fine without anyone fixing them. These issues do not throw errors. They just sit there, open, until someone finds them, which is exactly what automated checks are built to catch.
Scanning Alone Isn’t Proof: Where Human Testing Comes In
Automated scanning is fast and thorough at catching known patterns. What it cannot do is think like an attacker. A scanner checks for the flaws it already knows about. It does not chain three small weaknesses into one real break-in, abuse business logic that looks fine on paper, or get creative the way a motivated human will.
That is the job of a penetration test. A skilled tester scopes the work with you, probes the app, and tries to reach something that matters, like customer data or admin access. The result is not a list of maybes. It is proof of what an attacker could actually do, with fixes ranked by real risk instead of a generic score.
This matters even more for apps built quickly with AI, because the gaps tend to be the kind a scanner misses. An AI assistant might wire up a feature that works perfectly for a normal user but falls apart the moment someone sends input it did not expect. Only hands-on testing tends to surface that.
Choosing who runs the test is its own decision. Day rates vary widely, and some providers sell a glorified scan as a pentest. A written scope and a sample report tell you far more than a headline price. For teams that want a deeper look, comparisons of US penetration testing companies are a useful starting point for understanding what a real engagement should include and what questions to ask before you sign. For most products, the right rhythm is a full test once a year and again after any major change, with automated scanning keeping the routine issues down in between.
Building a Simple, Repeatable Security Habit
You do not need an enterprise budget or a large security team to do this well. You need a short set of steps that run every time, so nothing depends on anyone remembering. A practical order that works for small and mid-sized teams looks like this:
- Turn on dependency and secrets scanning first. These catch the most commonly abused issues and barely change how people work.
- Move the checks into the pull request. When findings show up where developers already are, fixing them becomes normal instead of a separate task.
- Add multi-factor authentication anywhere there is a login, including internal admin tools, which attackers hit precisely because teams forget them.
- Scan container images and cloud settings before they go live, not after something breaks.
- Commission a penetration test once a year, and after any big release, to confirm the automated layers actually hold.
- Feed what the test finds back into your scans, so the same class of issue gets caught earlier next time.
The order matters because each step earns a little more trust. Once developers see that the tooling respects their time and flags real problems, they stop treating it as a roadblock and start treating it as part of shipping good work.
Preparing for What Comes Next
AI is not going to write less of our code. It is going to write more, and the security tools are adapting to match. A few shifts are already underway.
Testing is becoming continuous rather than a once-a-year event. The old model of a single annual pentest was built for a world where software changed a few times a year. When you ship daily, security validation has to keep pace, which is why more teams are blending ongoing automated checks with regular human testing.
Attackers are using AI too. The same tools that help your team move faster help them find and exploit flaws faster. That raises the floor on what “secure enough” means, and it rewards teams that build checking into their process rather than bolting it on at the end. This is just as true for the AI products themselves, so if you are building with modern AI tools, the model, the data, and the app around it all deserve the same care.
The teams that struggle will be the ones trying to secure AI-speed development with a slow, manual process. The teams that do well will treat security as something running quietly through the whole workflow, automated where machines are better and human where judgment is needed.
Building with AI coding tools is one of the best things to happen to software in years. It lowers the cost of trying ideas and puts real capability in the hands of small teams. Keeping that work safe does not mean giving up the speed. It means pairing the fast tools that write your code with the right checks that keep it honest, so the app you ship in a weekend is still standing a year later.
Frequently Asked Questions
Is AI-generated code less secure than human-written code?
On average, it carries flaws at a higher rate, and research has reported several times more security findings in AI-assisted code than in human-only code. The code is not useless, but it needs the same checks as any other code, applied consistently.
Can I just trust the AI tool to write secure code?
Not yet. AI assistants are built to produce code that works, not code that is hardened against attack. They will reuse old libraries, miss input checks, and sometimes leave secrets in place. Treat their output as a fast first draft that still needs scanning and review.
What is the single most useful first step?
Turn on automated dependency and secrets scanning inside your pull requests. These catch the most commonly abused issues, run without slowing anyone down, and give your team a short, real list to act on instead of a wall of noise.
Is a scan enough, or do I still need a penetration test?
You need both. Scanning is fast and great at known issues, but it cannot chain weaknesses together or abuse business logic the way a real attacker would. A penetration test confirms whether your defenses actually hold, which a scan cannot prove on its own.
How often should I run a penetration test?
For most apps, once a year and again after any major change, such as a new platform, a large feature, or a cloud migration. Regular automated scanning between tests keeps the routine problems from building up so the tester can focus on the hard ones.
Does adding security slow down development?
Done badly, it can. Done well, it speeds you up, because catching a flaw while the code is being written takes minutes, while fixing it after release costs far more time and disruption. The trick is building the checks into the workflow people already use instead of adding manual gates on top.
