AI Scan for pull requests

AI Scan uses an AI-based scanning engine to find security vulnerabilities in pull requests for languages and frameworks not covered by CodeQL.

AI Scan for pull requests produces additional security findings with an AI-based scanning engine that runs on pull requests and complements CodeQL. Unlike CodeQL alerts, AI Scan findings are only available on pull requests and do not appear as backlog alerts in the repository's security view.

AI Scan expands code scanning coverage without requiring a separate scanning tool or build configuration.

Availability

Availability depends on who owns the repository and its visibility.

Repository owner Visibility Availability and requirement
Organization Public Available without an active-committer license
Organization Private or internal Available with GitHub Code Security or GitHub Advanced Security
Personal account Public Available
Personal account Private Not available

AI Scan for pull requests is not available for repositories in a managed user account's personal namespace, even if code scanning is enabled for the repository.

You do not need a GitHub Copilot license to use AI Scan.

Billing

AI Scan usage is separate from active-committer licensing and is reported under the Code Security AI Credits SKU. Usage begins only when a qualifying pull request is scanned.

For organization-owned repositories, usage is billed to the account responsible for the organization's billing.

For public repositories owned by a personal account, usage is billed to that personal account unless the repository owner has a GitHub Copilot license provided by an organization or enterprise. In that case, usage is billed to the organization or enterprise that provides the license.

If the billing account receives included AI credits through a GitHub Copilot entitlement, AI Scan uses those credits first. After the included credits are exhausted, or if the account has no included credits, usage is metered and governed by the applicable budgets. If a hard budget leaves no Code Security AI Credits available, AI Scan cannot produce findings. Scanning resumes when an administrator increases the limiting budget or a new billing cycle begins.

For details about the billing model, see GitHub Advanced Security license billing.

How AI Scan works

AI Scan runs automatically when all the following conditions are met:

Scans run when a pull request is created and after each new commit, as they do for CodeQL.

AI Scan does not require CodeQL default setup and does not depend on the state of CodeQL analysis. If CodeQL analysis fails or is in a waiting state, AI Scan will still run.

Results are posted to the pull request as they are found. If the CodeQL scan takes longer to complete, you may see AI Scan findings before CodeQL results appear, or vice versa.

Findings are advisory. They do not fail the Code scanning check and cannot block pull request merges through ruleset requirements. They provide signals about where code security can be improved without interrupting your workflow.

The scanning engine analyzes pull request code without requiring a build system and may use code search to gather more context from the repository before flagging an issue. It uses specialized prompts, not custom instruction files such as /.github/copilot-instructions.md or /CLAUDE.md.

How AI Scan findings appear on pull requests

AI Scan findings appear alongside CodeQL alerts on the Conversation and Files changed tabs of a pull request. Each finding is labeled with an "AI" indicator so you can distinguish it from CodeQL alerts.

Each finding describes the security issue and explains the risk. Most findings also include a suggested remediation. When available, Copilot Autofix recommends a code change, as it does for CodeQL alerts.

You can use the thumbs up or thumbs down control to provide feedback and help improve detection quality.

Limitations

Supported languages

AI Scan supports selected languages and frameworks that CodeQL does not currently cover. Examples include PHP, Shell/Bash, Terraform configuration (HCL), Dockerfiles, JSP for Java, and Blazor for C#.

To check whether CodeQL supports a language, see Code scanning with CodeQL.

Detection categories

AI Scan currently classifies findings into the following categories. Coverage may change as the feature evolves.

Enabling AI Scan

Before enabling AI Scan on pull requests for an organization, confirm repository eligibility, review the billing account's included AI credits, and configure budgets for metered usage.

Enabling the organization setting enables AI Scan immediately for all eligible repositories where code scanning is enabled. Repository administrators can then opt out, but qualifying pull requests can consume Code Security AI Credits before they do.

You do not need to select a model to enable AI Scan.

Organization owners and security managers can review the effective enablement status of AI Scan for pull requests in the "Coverage" view of security overview. See Assessing adoption of security features.

People with access to security overview can also monitor AI Scan findings across an organization or enterprise:

For more information, see Code scanning on pull requests.

You can use the REST API to manage the organization or repository ai-scan setting. See REST API endpoints for code scanning.