GitHub code security and AI scanning

GitHub AI Scan for Repositories: Setup, Costs and Limits

•Make Better Editorial

GitHub AI Scan now checks repository backlogs in public preview. See eligibility, Code Security AI credits, setup and manual rescan limits.

GitHub introduced AI Scan for repositories in public preview on October 28, 2026. It gives maintainers an on-demand way to look for security vulnerabilities across the default branch, including languages outside CodeQL's supported set. The useful change is not an automatic security guarantee: AI-generated findings now join the repository's existing code scanning backlog, where teams can review, assign and remediate them. Eligibility, credits and manual rescan requirements determine whether it fits a real engineering workflow.

What repository AI Scan actually checks

The scanner uses an agentic process to explore the repository and select files and functions that appear worth deeper inspection. It does not read every line exhaustively. GitHub says the scanner can use multiple models when available and will avoid reporting issues already flagged by CodeQL where it can identify a match. Results appear alongside ordinary code scanning alerts, rather than in a separate AI-only dashboard. Teams can filter for the AI Scan tool, link findings to issues and use existing remediation workflows.

Three different GitHub AI security checks

CapabilityScope and trigger
AI Scan for repositoriesDefault branch; on-demand scan across languages
AI Scan for pull requestsEligible PR changes; separate configuration and selected language/framework coverage
Scan for AI applicationsAI application and agent risks such as indirect prompt injection in eligible PRs

Who can enable it and what it costs

Public repositories owned by organizations or personal accounts are eligible. Organization-owned private and internal repositories require GitHub Code Security or GitHub Advanced Security; personal-account private repositories are not supported. A GitHub Copilot subscription is not required. Enterprise administrators must first allow the shared AI Scan policy, which defaults to Not allowed; organization owners or security managers then enable repository scanning. A repository administrator cannot opt in when the organization setting is disabled.

Each manual scan consumes Code Security AI credits, separate from active-committer licensing. Depending on account entitlements, included AI credits may be consumed first, followed by metered usage controlled by budgets. A hard spending limit can prevent findings from being generated. GitHub documents a detection-step cap of 30 minutes and 150,000 AI credits; that is a ceiling, not a published fixed scan price. Check which account pays before inviting a team to scan large projects.

How to run a first scan

  1. Confirm the repository's ownership, visibility and required Code Security entitlement.
  2. Ask the enterprise or organization administrator to allow and enable repository AI Scan, if applicable.
  3. Check the billing account's available Code Security AI credits and hard budgets.
  4. With repository write access, open Security and quality > Code scanning, then the AI Scan dropdown.
  5. Start a Standard scan of the default branch; wait for findings and filter alerts by AI Scan.
  6. Triage each finding, review suggested fixes and repeat a manual scan after changes reach the default branch.
Do not mistake a scan for a clean bill of health

Repository AI Scan is manual, time-bounded and non-exhaustive. AI-generated findings can be wrong; matching CodeQL alerts is best effort, so duplicates are possible. During preview there are no automatic scans on push or schedule. Keep CodeQL, tests, dependency checks and human security review in the process.

What happens after a fix?

A merged fix does not automatically trigger a new repository AI Scan. GitHub's current preview workflow requires someone to scan the updated default branch again. Even then, automatic alert closure is limited to fixes that change the exact triggering line; otherwise maintainers may need to close the alert manually. This is especially important for teams measuring backlog reduction: a still-open alert does not necessarily mean a fix failed, and a dismissed alert is not proof the underlying risk disappeared.

Make Better analysis

For a small development team, the strongest pilot is one representative repository with an existing code scanning backlog. Set a spending cap, run AI Scan once, and classify findings as confirmed, duplicate, false positive or requiring investigation. Track developer time and verified remediation, not raw alert counts. The feature may be most useful where CodeQL lacks language coverage or where teams want a second detection approach, but independent accuracy and return-on-cost evidence are not established by the launch.

The distinction between scanning and fixing matters. AI Scan proposes additional leads; it does not replace access controls, code review or a secure release process. Its public-preview status means availability, policy details and limits may change. Before automating any downstream triage, confirm that a reported issue is reproducible and that the proposed fix preserves application behavior.

FAQ

Questions people ask

Can I run GitHub AI Scan on a private repository without GitHub Advanced Security?

For an organization-owned private or internal repository, GitHub currently requires GitHub Code Security or GitHub Advanced Security. Public repositories owned by organizations or personal accounts are eligible, but private repositories owned by personal accounts are not. The feature is in public preview, and an enterprise or organization policy may still prevent enablement. Check the repository's owner, visibility and security settings first.

Does GitHub AI Scan require a Copilot subscription, and is it free?

No Copilot license is required, but AI Scan is not necessarily free. On-demand scans consume Code Security AI credits, with charges assigned to the relevant billing account. Eligible included credits may be used first; otherwise metered usage is subject to budgets. GitHub documents a 30-minute and 150,000-credit limit for detection steps, not a fixed per-scan price. Review your budget before starting.

Is AI Scan a replacement for CodeQL or automatic pull-request scanning?

No. Repository AI Scan is a separate, manually triggered analysis of the default branch, intended to complement CodeQL rather than replace it. GitHub also offers distinct AI Scan features for pull-request changes and AI-application risks, each with different coverage and settings. Repository AI Scan can examine languages beyond CodeQL, but it samples promising code within a time budget and cannot guarantee complete vulnerability detection.

Will GitHub AI Scan automatically rerun and close an alert after I merge a fix?

No. During the public preview, repository scans do not automatically run on pushes or schedules. After merging a fix into the default branch, someone with write access must start another scan. GitHub says automatic closure after rescanning requires the fix to change the exact line that triggered the alert; otherwise the alert may need manual closure. Always verify the actual fix rather than treating closure as proof.

Bottom line

GitHub's October 28 repository AI Scan adds an on-demand, cross-language security check to the existing alert backlog. It is useful to test alongside CodeQL, not instead of it. Confirm repository eligibility, set a Code Security AI-credit budget, review every finding and rescan manually after fixes.

Explore related Make Better resources

Sources & useful resources