Back Home

AI 軟體安全

GitHub Opens AI Scan Management API, but AI-Detected Vulnerabilities Still Cannot Block Merges

GitHub has added organization- and repository-level REST APIs that let security teams programmatically deploy AI vulnerability scanning for pull requests at scale. The scans can cover languages and frameworks not supported by CodeQL, but findings are currently advisory only, consume AI credits, and cannot be added to rulesets as merge requirements.

Rrustema · CC0 · Image source
zh-Hant

On September 10, GitHub added REST API support for enabling and disabling AI Scan for pull requests. Security administrators can now read and update organization settings through `/orgs/{org}/code-scanning/ai-scan`, and query or change individual repositories through `/repos/{owner}/{repo}/code-scanning/ai-scan`. If AI Scan is disabled at the organization level, repositories cannot override that setting. This allows enterprises to create deployment lists in batches based on risk, language, or pilot program, without configuring each repository individually through the web interface.

AI Scan supplements CodeQL rather than replacing it. It runs when a PR is opened and after each new commit, directly analyzing the diff and using code search to obtain repository context without needing to build the project. It uses specialized prompts and does not read custom agent instructions such as `copilot-instructions.md` or `CLAUDE.md`. Even if CodeQL is pending or fails, the AI scan can still complete independently. Results appear alongside CodeQL alerts on the Conversation and Files changed pages, and some findings can be passed to Copilot Autofix to generate suggested patches.

Technical coverage focuses on PHP, Shell, Terraform HCL, and Dockerfile, which CodeQL does not yet fully support, as well as framework gaps such as JSP and Blazor. Current vulnerability categories include string injection, weak cryptography, broken access control, sensitive data exposure, SSRF, deserialization, and supply-chain risks. This makes AI Scan suitable as an additional PR review signal in polyglot monorepositories.

The limitations are equally clear: the feature remains in public preview, supports only github.com, requires GitHub Advanced Security and a Copilot license, and consumes AI credits. It does not perform full-repository scans, and AI findings are not added to the security backlog. At present, they also cannot be used in a ruleset to block merges. The model may produce false positives, and supported languages and vulnerability categories may change. Teams adopting the feature should first use the API to enable it in phases, track false-positive rates, remediation time, and credit consumption for each repository, and then decide whether to expand deployment. It should not be treated as a deterministic compliance control.

Sources

  1. AI Scan for pull request APIs in public preview
  2. REST API endpoints for AI Scan
  3. AI-powered security detections in pull requests