Fixing security vulnerabilities with AI
Feb 14, 2024Tiferet Gazit11 min read
Opens github.blogWhat the post covers
This post details the technical implementation of GitHub's Code Scanning Autofix feature.
- It explains how LLMs are prompted with vulnerability details and code snippets to generate suggested fixes.
- The post covers prompt engineering, pre- and post-processing heuristics for selecting code, adding dependencies, specifying code edit formats, and overcoming model errors.
- It also outlines the evaluation framework used to iterate on the feature, including automated testing of fix validity (removing alerts, no new alerts, no syntax errors, no test failures) and manual triage, which led to a tripled success rate and reduced LLM compute costs.
More from the AI-Assisted Code Development and Review trail
How we make AI coding more cost efficient without sacrificing task quality
Better tools made Copilot code review worse. Here's how we actually improved it.
Agent-driven development in Copilot Applied Science
Continuous AI for accessibility: How GitHub transforms feedback into inclusion
Finding leaked passwords with AI: How we built Copilot secret scanning