AI Scan for pull requests generally available
By Steven Van ·
Advisory AI findings cover PHP, Bash, Terraform and Dockerfiles on pull requests, with no Copilot license needed, but usage draws on AI credits.
Code scanning on GitHub now includes AI Scan for pull requests, which is generally available. It uses an AI-based engine to find vulnerabilities in pull request changes for languages and frameworks that CodeQL does not cover, including PHP, Shell/Bash, Terraform configuration (HCL), Dockerfiles, JSP for Java and Blazor for C#.
How it works
AI Scan runs when code scanning and the repository's AI Scan on pull requests setting are both enabled, and a pull request contains changes in a supported language or framework that CodeQL does not cover. It runs when the pull request is created and after each new commit. It does not need CodeQL default setup, a build system, or a successful CodeQL run, so it still runs if CodeQL fails or is waiting. It does not run on pull requests from forks or ones created by Dependabot.
Findings appear next to CodeQL alerts on the Conversation and Files changed tabs, marked with an "AI" indicator. Each one describes the security issue and the risk. Most include a suggested fix, and Copilot Autofix proposes a code change when one is available. A thumbs up or down control lets reviewers send feedback.
Findings are advisory. They do not fail the code scanning check and cannot block merges through ruleset requirements. They exist only on pull requests and do not show up as backlog alerts in the repository's security view. The docs note that findings may include false positives.
Detection categories
- String injection
- Weak cryptography
- Broken access control
- Sensitive data exposure
- Security misconfiguration
- Authentication failures
- Data integrity failures
- Server-side request forgery (SSRF)
- Supply chain risks, such as unpinned third-party actions, packages or images
Availability and billing
AI Scan is available for public repositories owned by organizations or personal accounts. Private and internal organization-owned repositories need GitHub Code Security or GitHub Advanced Security. Private repositories on personal accounts are not supported. A Copilot license is not required.
Usage consumes Code Security AI Credits, separate from active-committer licensing, and is billed only when a qualifying pull request is scanned. Included AI credits from a Copilot entitlement are used first, then usage is metered under the applicable budgets. If a hard budget leaves no credits, AI Scan stops producing findings until the budget is raised or a new billing cycle starts.
Enabling it
Enterprise owners can allow AI Scan for organizations, and the policy is set to "Not allowed" by default. Organization owners and security managers can then enable it, and repositories inherit that setting. Enabling it at organization level turns it on immediately for all eligible repositories with code scanning enabled, and repository admins can opt out afterwards. For public repositories owned by a personal account, admins use the AI Scan for pull requests toggle under "Code scanning". The setting can also be managed through the REST API.
