DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • AI in Cybersecurity: An Overview
  • AI Risk Management Framework: A Technical Deep Dive for AI Developers
  • NIST AI Risk Management Framework: Developer’s Handbook
  • Dynatrace Perform: Day Two

Trending

  • Performing and Managing Incremental Backups Using pg_basebackup in PostgreSQL 17
  • Unmasking Entity-Based Data Masking: Best Practices 2025
  • AI-Based Threat Detection in Cloud Security
  • How Trustworthy Is Big Data?
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. A Framework for Maintaining Code Security With AI Coding Assistants

A Framework for Maintaining Code Security With AI Coding Assistants

Learn more on how implementing the right framework, software developers can select and use AI coding tools without introducing serious security flaws in their software.

By 
Philip Piletic user avatar
Philip Piletic
DZone Core CORE ·
Jan. 26, 24 · Analysis
Likes (4)
Comment
Save
Tweet
Share
5.0K Views

Join the DZone community and get the full member experience.

Join For Free

Over the past few years, AI has steadily worked its way into almost every part of the global economy. Email programs use it to correct grammar and spelling on the fly and suggest entire sentences to round out each message. Digital assistants use it to provide a human-like conversational interface for users. You encounter it when you reach out to any business's contact center. You can even have your phone use AI to wait on hold for you when you exhaust the automated support options and need a live agent instead.

It's no wonder, then, that AI is also already present in the average software developer's toolkit. Today, there are countless AI coding assistants available that promise to lighten developers' loads. According to their creators, the tools should help software developers and teams work faster and produce more predictable product outcomes. However, they do something less desirable, too—introduce security flaws.

It's an issue that software development firms and solo coders are only beginning to come to grips with. Right now, it seems there's a binary choice. Either use AI coding assistants and accept the consequences, or forego them and risk falling behind the developers that do use them. Right now, surveys indicate that about 96% of developers have already chosen the former. But what if there was another option? What if you could mitigate the risks of using AI coding assistants without harming your output? Here's a simple framework developers can use to pull that off.

Evaluate Your AI Tools Carefully

The first way to mitigate the risks that come with AI coding assistants is to thoroughly investigate any tool you're considering before you use it in production. The best way to do this is to use the tool in parallel with a few of your development projects to see how the results stack up to your human-created code. This will provide you an opportunity to assess the tool's strengths and weaknesses and to look for any persistent output problems that might make it a non-starter for your specific development needs.

This simple vetting procedure should let you choose an AI coding assistant that's suited to the tasks you plan to give it. It should also alert you to any significant secure coding shortcomings associated with the tool before it can affect a live project. If those shortcomings are insignificant, you can use what you learn to clean up any code that comes from the tool. If they're significant, you can move on to evaluating another tool instead.

Beef up Your Code Review and Validation Processes

Next, it's essential to beef up your code review and validation processes before you begin using an AI coding assistant in production. This should include multiple static code analyses passed on all the code you generate, especially any that contain AI-generated code. This should help you catch the majority of inadvertently introduced security vulnerabilities. It should also give your human developers a chance to read the AI-generated code, understand it, and point out any obvious issues with it before moving forward.

Your code review and validation processes should also include dynamic testing as soon as each project reaches the point that it's feasible. This will help you evaluate the security of your code as it exists in the real world, including any user interactions that could introduce additional vulnerabilities.

Keep Your AI Tools Up to Date

Finally, you should create a process that ensures you're always using the latest version of your chosen AI tools. The developers of AI coding assistants are always making changes aimed at increasing the reliability and security of the code their tools generate. It's in their best interest to do so since any flawed code traced back to their tool could lead to developers dropping it in favor of a competitor.

However, you shouldn't blindly update your toolset, either. It's important to keep track of any updates to your AI coding assistant change. You should never assume that an updated version of the tool you're using will still be suited for your specific coding needs. So, if you spot any changes that might call for a reevaluation of the tool, that's exactly what you should do.

If you can't afford to be without your chosen AI coding assistant for long enough to repeat the vetting process you started with, continue using the older version. However, you should have the new version perform the same coding tasks and compare the output. This should give you a decent idea of how an update's changes will affect your final software products.

The Bottom Line

Realistically, AI code generation isn't going away. Instead, it likely won't be long before it's an integral part of every development team's workflow. However, we've not yet reached the point where human coders should blindly trust the work product of their AI counterparts. By taking a cautious approach and integrating AI tools thoughtfully, developers should be able to reap the rewards of these early AI tools while insulating themselves from their very real shortcomings.

AI Dynamic testing IT Framework security

Opinions expressed by DZone contributors are their own.

Related

  • AI in Cybersecurity: An Overview
  • AI Risk Management Framework: A Technical Deep Dive for AI Developers
  • NIST AI Risk Management Framework: Developer’s Handbook
  • Dynatrace Perform: Day Two

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!