Searchable transcript of How Developers Secure AI-Generated Code: 5 Security Best Practices — IBM Technology (11:28). Search for a phrase, then click its timestamp to jump straight to that moment in the video.
Captions sourced from the original video on YouTube, published by IBM Technology. The video, its captions and all related intellectual property remain the property of their respective owners; AINotes claims no ownership. Provided for research, accessibility and search — see the Transcript Notice and Copyright Policy.
AI is changing software development faster than any technology shift we've seen in decades. 40 years ago, when I was banging out code in the early days of my career, the process was incredibly complex, time-consuming, and error-prone. Today, developers can generate code, tests, agents, multi-step AI tasks, and even workflows with just a prompt. Quite simply, AI is a game changer.
But there's a challenge. Security practices that were designed for human written code and slower development cycles don't automatically scale to AI assisted development. If security only happens at the end of the process as a retrofit, the quality suffers and the whole process comes to a screeching halt. The solution comes from an unexpected source.
It turns out that Beyonce knew what she was talking about when she sang to the left, to the lift. Yeah, security needs to shift. To the left. Security begins at the earliest stages of development and continues throughout the software development cycle if we're doing it correctly. These concepts aren't new, although to be honest, we haven't always practiced them as we should, but in the AI era, shift left means more than just running a few security tools earlier in the process.
It means things like this. What? Are we gonna validate? When do we validate it? And how do we build confidence in AI-generated solutions? Let's take a look at five key principles of shift-left security to improve the results of AI-assisted development. AI-Generated code does not equal trusted code. So the first principle is simple. Trust the outcome, not just the generation.
One of the most deceptive things about AI-generated code. Is that it often looks correct. It compiles, it runs, it passes all the security tests. So we think this is okay, but it can still create a security risk down below that you don't see. And that's the part that we're not aware of. Just because the technical implementation appears successful doesn't mean the solution is secure.
Developers increasingly need to validate things like the permissions, the data leaks. If those are occurring, and how are we handling failures? Does the system fail safe or fail in an open dangerous condition? For example, an AI-generated service might correctly retrieve customer information from the database, but should it really have access to all of the information that's in there?
Is sensitive data potentially being exfiltrated from the organization? What happens if authentication fails? And also what happens if malformed data ends up into this database and corrupts it. Well, this is the stuff that's not so easy to see. This is the part that has asked the question, not just does the code work, but is it secure? The question that does the cold provide expected results and behave securely under real world conditions is what we need to be asking.
That's the outcome we need validate. The second principle is security starts during development. Traditionally, many organizations treated security reviews almost as an afterthought. So what would happen is, we've got developers finish their coding, then the components are built, the functions are tested, the code gets committed, and then the security review happens.
Basically, it's a checkbox at the end of the process. That model never really worked well and struggles even more in an AI assisted development environment. Because history teaches us that the earlier you find a bug, the cheaper it is to fix. If you find it once it's already gone into production, super expensive. Find it early in the process is pretty cheap.
And security bugs are actually no different in that regard. And when code generation can happen in seconds, waiting until the end creates bottlenecks and increases risk. So shift left security improves validation into the development process itself. This means automatically running static source analysis, dynamic pin testing, penetration testing, scanning for embedded secrets, policy validation, compliance checks, all of that stuff, and doing this while the code is being created.
The goal here is to reduce unpleasant surprises later in the life cycle by shifting left. Here's an important reality of AI-generated development. AI doesn't just create code. It also introduces dependencies. So we've got things like new packages, new libraries, new services, new integrations. Every dependency adds capability, which is good, but every one of those dependencies also adds risk, which isn't so good.
Developers often focus on reviewing generated source code while overlooking what that code depends on. It's all happening under the covers through the miracles of AI. So it's kind of out of sight, out of mind. But security incidents originate from the software supply chain rather than just the application logic itself in some cases. That's why generated dependencies should also undergo the same level of scrutiny as the generated code.
We need to review things like package reputation, vulnerabilities, licensing, source integrity. Organizational standards. In AI assisted development, dependency validation isn't optional. It's part of secure code generation. This may be the most important shift of all. Many serious security issues aren't caused by poor coding practices. They're caused by incorrect assumptions.
Consider questions like who should actually access the data and what actions are allowed? What business rules need to be applied? And what information should remain protected. An AI model may generate code that is technically elegant and follows development best practices, but if the requirements are misunderstood, the solution can still violate security policies.
Here's what I mean. A generated workflow may correctly process financial data, yet at the same time, it may also expose that information to users who should never see it in the first place. That's not as much a coding problem as it is an intent problem. So we have to consider the intent with this. And with AI, you have to be especially clear about that intent.
In Greek mythology, King Midas wished that everything he touched would turn to gold. He got his wish and nearly starved as a result because it turns out you can't eat gold. As AI generates increasingly sophisticated code at machine speed, developers become more responsible for validating the output. There's still work for you to do here. In other words, we're no longer just reviewing code quality, we're reviewing whether the AI solved the right problem in the right way.
The fifth principle is that security must become an ongoing practice, not just some final checkpoint at the end. As I mentioned previously, organizations have historically concentrated security activities near release at the ended. But AI assisted development produces change continuously. Which also means security validation must also happen, wait for it, continuously.
That means it's gonna continue even after release. So if you think about the process, we develop, test, deploy, monitor, and improve, and all of that stuff needs security. Security operates in every one of those components in the loop. So how would we realize that? Where we've got to have things like vulnerability detection, using some of the best AI frontier models as well so that we're right on top of all the vulnerabilities.
We're going to do dependency monitoring and patching. We're gonna also do policy verification and enforcement and change validation. So the question isn't just did it pass once, but does it continue to pass? Does it continue be secure? The question is whether confidence is maintained over time. For instance, an AI frontier model recently found a zero day vulnerability in an open source operating system that had been hiding in plain sight for 27 years.
Lesson from that, security is never done. It has to become a living part of the process that evolves alongside the software. As AI becomes more agentic, it will increasingly perform multi-step work. Across services, repositories, pipelines, and configurations. At that point, reviewing individual files becomes insufficient. Security depends on understanding the entire workflow.
The hardest security problems aren't hidden in a single function. They're found in unintended consequences across connected systems. That means agents need guardrails to tell them what they can and can't do, what is appropriate and what's not. They need identities so that they're accountable and we can see who did this and why they need access controls that limit the access capabilities that they have so that they can't change things we didn't intend and they need monitoring and human in the loop oversight without the
proper oversight and enforcement agents can run amok and act as risk amplifiers rather than productivity tools. Here's the new reality. We have to secure fast and validate continuously. AI is accelerating software development. That means we can generate more code in a minute than we used to be able to do in an entire day. And that means we're gonna generate a lot more code.
And that mean more code means more functionality. It also means more complexity. And complexity is the enemy of security. Speed alone doesn't create value, trust does. The organizations that succeed will be the ones that embed security directly into everyday development workflows. Not as a compliance exercise, not as a release gate, but as a continuous validation practice.
Because in the age of AI assisted development, the goal is no longer to simply review the code. The goal is to confidently verify outcomes across an ever expanding and increasingly complex code base and do it faster than we've ever done before. And remember to the left, to the left.