Updated 11 hours ago
GitHub’s agentic autofix can repair 25 code-scanning alerts in one draft pull request

AI Code Security

GitHub’s agentic autofix can repair 25 code-scanning alerts in one draft pull request

GitHub’s generally available agentic autofix explores related files, proposes changes and reruns CodeQL before opening a draft PR. It works on default‑branch alerts and uses AI Credits plus Actions minutes.

Agentic autofix now works across the codebase before opening a draft PR

GitHub made [agentic autofix for code‑scanning alerts generally available](https://github.blog/changelog/2026‑10‑15‑agentic‑autofix‑for‑code‑scanning‑alerts‑general‑availability/) on October 15. When an eligible alert is assigned to Copilot, the agent explores related files, proposes a fix, reruns CodeQL and iterates before opening a draft pull request for review. The draft PR includes GitHub’s summary of the change, why it should close the alert and the validation steps performed. Reviewers can request further changes through pull‑request comments or the repository’s Agents tab. That workflow is materially broader than a one‑shot suggested patch. It can follow dependencies across files and check the resulting code with CodeQL. It still produces a reviewable proposal: the opened pull request is a draft, and the organization remains responsible for testing, approval and deployment.

The batch path groups up to 25 alerts into one pull request

Teams can assign a single default‑branch code‑scanning alert or select as many as 25 alerts from a repository alert list or security campaign for one autofix pull request. The batch option can reduce repeated setup and review overhead when findings share code or a remediation pattern. It can also create a larger failure surface. Before batching, group alerts by component, owner and deployment risk. Avoid combining unrelated fixes merely because the interface permits 25. A review should be able to explain each changed file, map it to an alert and test the affected behavior without disentangling an oversized patch. GitHub’s [autofix documentation](https://docs.github.com/enterprise‑cloud@latest/code‑security/concepts/code‑scanning/autofix‑for‑code‑scanning) is the configuration reference. A reasonable first batch uses a small set of related, well‑understood findings and compares review time, change size and reopen rate with individually repaired alerts.

Only default‑branch alerts are eligible

Agentic autofix supports code‑scanning alerts on the repository’s default branch. GitHub says alerts detected only on a pull request or another branch cannot be assigned to Copilot. The distinction matters because GitHub separately launched AI Scan for pull‑request changes. A finding visible during a pull request is not automatically eligible for this default‑branch remediation workflow. Teams should route pull‑request findings through the review path that produced them and use agentic autofix on the supported default‑branch backlog. Automation can assign an eligible alert by updating it with `copilot‑swe‑agent[bot]` through GitHub’s [code‑scanning alert API](https://docs.github.com/enterprise‑cloud@latest/rest/code‑scanning/code‑scanning?apiVersion=2026‑03‑10#update‑a‑code‑scanning‑alert). Treat that call as a controlled write: preserve alert identity, repository, expected state and an audit trail, and reconcile the resulting draft PR before retrying.

Access requires enterprise policy, repository enablement and billing

The feature is available to GitHub Code Security and GitHub Advanced Security customers on GitHub Enterprise Cloud, including data‑residency deployments. An enterprise administrator must first enable the Agentic autofix policy. An organization or repository administrator can then enable it in Code Security settings. GitHub also requires a Copilot billing method. The release says remediation consumes AI Credits from the Code Security budget and GitHub Actions minutes; AI usage is reported under the Advanced Security product and can be constrained with SKU‑level budgets. GitHub’s [usage‑based billing documentation](https://docs.github.com/enterprise‑cloud@latest/copilot/concepts/billing/usage‑based‑billing‑for‑organizations‑and‑enterprises) is the current source for account‑level charging behavior. Enablement should therefore name three owners: security policy, repository rollout and budget. A repository toggle without budget guardrails can turn a useful experiment into uncontrolled consumption; a budget without triage ownership can produce draft pull requests nobody safely lands.

CodeQL reruns validate alert closure, not complete program correctness

A successful CodeQL rerun is meaningful evidence that the proposed change addresses the targeted query under the scanned configuration. It does not prove the application is correct, that behavior is unchanged or that another vulnerability was not introduced. Review the draft like any security‑sensitive code change. Inspect the actual diff, confirm the alert‑to‑change mapping, run unit and integration tests, examine authorization and data‑flow consequences, and require the normal code owners. If the agent changed dependencies, configuration or public interfaces, apply the project’s broader release checks. Measure the feature by accepted fixes, review effort, regressions, reopened alerts and cost—not generated pull‑request count. GitHub’s agent can compress remediation work, but the repository’s evidence and approval gates still decide whether a fix ships. Follow further code‑security releases on the [GitHub organization page](https://opentools.ai/organizations/github). *Image: GitHub’s official screenshot for the October 15 agentic‑autofix release, reproduced from the source page without generative alteration or artificial upscaling.*

Share this article

PostShare

Related News