Chat about this article with your favourite AI tool
GitHub has set out a layered approach to securing code written with AI agents. It combines a local security review, pull request scanning, repository-wide AI scans and a new Deep Scan that is in private preview.
The company said the push reflects the growing volume of vulnerabilities. From January to October 2026, GitHub detected more than 200 million vulnerabilities, based on its internal data. It said that is a 100% increase year over year.

GitHub warned that AI agents can unintentionally introduce vulnerable code, expose secrets or suggest dependencies that don’t exist. Passing tests, it said, does not mean a change is safe.
Local review before a pull request
The first checkpoint is a /security-review command. Developers can run it in the Copilot app, Copilot CLI or Copilot Chat in VS Code on their active changes before opening a pull request.
The review returns prioritised findings and suggested remediations. GitHub said it focuses on local changes rather than auditing a full repository, and it does not edit code itself. Developers can ask Copilot to explain a finding or try a fix in their working copy.
GitHub’s example is a PHP search endpoint where an agent inserts search text directly into a SQL query. The review could flag SQL injection and suggest a parameterised query, which keeps SQL instructions separate from user input.
Pull request checks
At the pull request stage, GitHub said CodeQL is the foundation of GitHub Code Security checks. AI-powered scanning builds on it, covering more languages and vulnerability patterns.
- CodeQL builds a database representing the code and runs queries over it. GitHub said its default query suite is designed for high precision and few false positives.
- AI Scanning uses agents to explore the repository and reason about how the code works. GitHub said it can look into unfamiliar attack patterns and business-logic flaws, including in languages CodeQL does not cover, such as PHP.
Findings from AI Scanning come with suggested fixes for authors or reviewers to evaluate.
Scanning code nobody is changing
Pull request checks only examine new or changed code. For older code, users with write access can run a Standard AI Scan on a repository’s default branch.
GitHub said the scan uses a proprietary harness with multiple models where available. Its agent searches the project and picks files and functions to examine within a time budget, rather than reading every file in full.
Results appear alongside CodeQL alerts in the code scanning backlog. GitHub said AI Scan suppresses duplicates where CodeQL already covers the same issue. Teams can assign alerts, link issues, add them to security campaigns and use supported autofix workflows.
In the Copilot app, a GitHub security extension brings all code scanning alerts into a security canvas. Developers can review alerts, ask Copilot to explain them and work on fixes there. The same canvas supports the local security review.
Deep Scan for critical releases
For high-stakes moments such as a major release or an audit, GitHub is offering Deep Scan. It is powered by Microsoft’s Codename MDASH and is currently in private preview. Like Standard AI Scan, it runs on a repository with one click.
Alerts from CodeQL, Standard AI Scan and Deep Scan share one backlog and come with fix suggestions. GitHub said agentic autofix works across all three, as well as partner tools.
GitHub stressed that no single check certifies a whole codebase. It said the combined approach gives developers more chances to find issues and a clearer path from a finding to a reviewed fix.
Source: GitHub Blog

