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.
Topic: Machine Learning in AI & Data · Tools
Also covers: AI in Cybersecurity, SOC & Blue Team
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?
- What Are Documented Examples?
- What Risks Does AI Introduce?
- Which Guardrails Should Teams Use?
- How Do You Check AI-Suggested Dependencies?
- What Should an AI Coding Policy Include?
- How Do You Measure Whether AI Is Helping Security?
- References
Where Does AI Help Software Security?
| Task | How AI helps |
|---|---|
| Code review | Flags risky patterns and explains them |
| Fixing scanner alerts | Proposes patches for static analysis findings |
| Fuzzing | Writes harnesses that increase coverage |
| Triage | Groups duplicates and summarises impact |
| Threat modelling | Drafts 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?
- Require human review for all AI-generated changes.
- Keep SAST, dependency scanning and secret scanning in CI.
- Restrict AI agents' permissions; no direct production access.
- Use approved AI tools with clear data handling terms.
- 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?
| Area | Example rule |
|---|---|
| Approved tools | Only company-approved assistants with data protection terms |
| Data | No secrets, customer data or proprietary algorithms in prompts to unapproved services |
| Review | All AI-generated code reviewed like any other contribution |
| Dependencies | New packages verified before adding |
| Agents | No 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
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0