Fix suggestions for code scanning alerts
When a scanner flags a vulnerability, an agent drafts a code fix and explanation that a developer reviews before committing.
The use case
Security backlogs grow because each scanner alert needs someone to understand the issue and write a fix. GitHub's Copilot Autofix and Snyk's DeepCode AI Fix take a static analysis alert, such as SQL injection or path traversal, and propose a patch with a short explanation. The fix shows up on the alert or in the pull request where it was found. Developers still read the patch, check it does not change behavior, run tests, and decide whether to accept it. Vendor docs are explicit that suggestions can be wrong or incomplete, so they are a starting point.
Example workflow
- Run code scanning on pull requests and the default branch
- Open an alert and request or view the suggested fix
- Read the explanation and the proposed patch
- Apply it to a branch and run the test suite
- Merge after normal review
Tools
- GitHub Copilot Autofix
- GitHub code scanning
- Snyk Code
Risks and guardrails
- Patches can fix the symptom but leave the vulnerability reachable another way
- Fixes can change behavior; tests must cover the touched path
- Do not bulk-accept fixes without review
Sources
Written by Agents Lookup. Credits and official pages for the tools this use case names:
- GitHub Docs: security and quality AI features: docs.github.com/en/code-security/responsible-use/security-and-quality-ai-features
- Snyk docs: fix code vulnerabilities automatically: docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-code/manage-code-vulnerabilities/fix-code-vulnerabilities-automatically