How AI Is Changing Software Security: Benefits, Tools and Risks

AI is changing software security in two directions. It helps defenders by reviewing code for vulnerabilities, suggesting fixes for scanner findings, writing fuzz tests, and triaging large numbers of alerts; documented examples include GitHub's Copilot Autofix and Google's use of language models to generate fuzz targets in OSS-Fuzz.

Jul 18, 2025 - 16:38
Updated: 
101.7k

Machine Learning in AI & Data · Tools

AI in Cybersecurity, SOC & Blue Team

How AI Is Changing Software Security: Benefits, Tools and Risks

Quick answer: AI is changing software security in two directions. It helps defenders by reviewing code for vulnerabilities, suggesting fixes for scanner findings, writing fuzz tests, and triaging large numbers of alerts; documented examples include GitHub's Copilot Autofix and Google's use of language models to generate fuzz targets in OSS-Fuzz. It also creates risks: AI coding assistants can produce insecure code, invent package names that attackers then register, and be manipulated by prompt injection. Teams get the benefits safely by treating AI output like any untrusted contribution: reviewed, tested and scanned.

Key takeaways

  • AI is useful for scale: reviewing, triaging and testing more code than people can.
  • Research found developers using AI assistants sometimes wrote less secure code while feeling more confident.
  • Hallucinated dependencies can lead to installing malicious packages.
  • Keep security tests, reviews and scanning in place for AI-written code.
  • NIST SP 800-218A covers secure development practices for AI.

Table of Contents

Where Does AI Help Software Security?

TaskHow AI helps
Code reviewFlags risky patterns and explains them
Fixing scanner alertsProposes patches for static analysis findings
FuzzingWrites harnesses that increase coverage
TriageGroups duplicates and summarises impact
Threat modellingDrafts threat lists for designs to be reviewed

What Are Documented Examples?

  • Copilot Autofix: suggests fixes for CodeQL alerts; GitHub's documentation stresses reviewing every suggestion.
  • OSS-Fuzz: Google reported that AI-written fuzz targets found new bugs in open source projects, including OpenSSL (Google Security Blog).
  • DARPA AI Cyber Challenge: teams built systems that automatically found and patched vulnerabilities in open source code (DARPA).

What Risks Does AI Introduce?

  • Insecure suggestions: a Stanford study (Perry et al.) found participants with an AI assistant wrote less secure code in several tasks and were more likely to believe it was secure.
  • Hallucinated packages: assistants may suggest libraries that do not exist; attackers can register those names.
  • Prompt injection: AI agents reading untrusted code or issues can be manipulated, as listed in the OWASP LLM Top 10.
  • Data leakage: proprietary code sent to external services.
  • Licence issues: generated code resembling licensed code.

Which Guardrails Should Teams Use?

  1. Require human review for all AI-generated changes.
  2. Keep SAST, dependency scanning and secret scanning in CI.
  3. Restrict AI agents' permissions; no direct production access.
  4. Use approved AI tools with clear data handling terms.
  5. Follow NIST SP 800-218A for AI-related development practices.

How Do You Check AI-Suggested Dependencies?

# Does the package exist, and how old is it? (PyPI JSON API)
curl -s https://pypi.org/pypi/requests/json | jq '.info.name, .info.version, (.releases | keys | length)'

# npm: check publish history and maintainers
npm view express time.created maintainers

Be suspicious of packages that are brand new, have few releases or downloads, or names similar to popular ones. Related: AI in DevSecOps and open source vulnerability detection. WebAsha offers secure coding and AI security training.

What Should an AI Coding Policy Include?

AreaExample rule
Approved toolsOnly company-approved assistants with data protection terms
DataNo secrets, customer data or proprietary algorithms in prompts to unapproved services
ReviewAll AI-generated code reviewed like any other contribution
DependenciesNew packages verified before adding
AgentsNo production credentials for AI agents

CISA's Secure by Design principles and the NIST AI RMF support such policies.

How Do You Measure Whether AI Is Helping Security?

  • Time to remediate scanner findings before and after adoption.
  • Number of vulnerabilities found in review versus after release.
  • Rate of AI-suggested fixes accepted, rejected or reverted.
  • New vulnerabilities traced to AI-generated code.

Measuring outcomes avoids assuming benefits that may not materialise, a risk highlighted in research such as Perry et al.

References

Frequently Asked Questions

For code review, suggesting fixes, generating fuzz tests and triaging security findings.

It can. Research found AI assistants sometimes lead to less secure code, so review and test it.

Library names suggested by AI that do not exist, which attackers can register with malicious code.

A GitHub feature that suggests fixes for code scanning alerts, which must be reviewed before merging.

Yes, in some cases; DARPA’s AI Cyber Challenge and Google’s OSS-Fuzz work showed promising results.

Require human review, keep security scanning, restrict agent permissions and use approved tools.

NIST SP 800-218A, extending the Secure Software Development Framework.

Yes, through prompt injection in code, issues or documents they read.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.