Skip to content
Agentic autofix turns a code scanning alert into a validated draft pull request A code scanning alert is assigned to Copilot, which loops through exploring the codebase, writing a fix, and rerunning CodeQL to validate it, then opens a draft pull request for human review. A gate below the loop notes the feature requires GitHub Enterprise Cloud, Advanced Security, and a Copilot billing method. Agentic autofix, end to end The draft PR only opens after Copilot reruns CodeQL and the alert closes. CODE SCANNING ALERT Uncontrolled command line assigned to Copilot COPILOT AGENT LOOP 1. Explore relevant files 2. Generate a proposed fix 3. Rerun CodeQL to validate iterates until the alert closes DRAFT PULL REQUEST Fix summary + validation steps Human review required before merge (no auto-merge, default branch only) Requires: GitHub Enterprise Cloud . Advanced Security . Copilot billing method . Code Security AI Credits GA October 15, 2026. Business, Team, and Pro plans are not included in this release. Source: GitHub changelog, retrieved 2026-10-16.
Guideintermediate

GitHub Copilot's agentic autofix for code scanning: how it works and who gets it

Published October 16, 2026 · by Pondero Labs

The short version

GitHub's agentic autofix for code scanning alerts reached general availability on October 15, 2026. Here's the actual mechanism, the enterprise-only access rule, the AI Credit cost, and whether it's worth turning on now.

Table of Contents

GitHub Copilot's agentic autofix for code scanning: how it works and who gets it

Click "Assign to Copilot" on a CodeQL alert and something closer to a junior security engineer than an autocomplete starts working the ticket. It reads the surrounding files, writes a fix, reruns the scanner against its own patch, and only opens a pull request once the alert actually closes. GitHub shipped this as generally available on October 15, 2026, replacing the old one-click "Generate Fix" button on every repo where an admin turns it on (per GitHub's changelog).

That's a bigger jump than it sounds. The free "Generate Fix" button GitHub shipped years ago produced a single-file suggestion and left you to verify it yourself. Agentic autofix checks its own work before it ever reaches your review queue, and it's gated behind a specific enterprise policy, not a feature flag everyone gets by default.

What actually happens when you assign an alert

When you assign a code scanning alert to Copilot, four things happen in sequence, per GitHub's writeup:

  1. It explores relevant files across the codebase, not just the file the alert points to.
  2. It generates a proposed fix.
  3. It validates the fix by rerunning CodeQL against the patched code, confirming the specific alert closes.
  4. It iterates if the first attempt doesn't close the alert, then opens a draft pull request.

The draft PR ships with a summary of the fix, the reasoning for why it closes the alert, and the validation steps Copilot ran to confirm it works. Once the PR is open, you're not done talking to it: comment on the PR or open the session in the repository's Agents tab to ask for changes, and Copilot keeps iterating on the same branch instead of starting over.

The scope has a hard edge worth knowing before you plan around it. Agentic autofix only works on alerts detected on the repository's default branch. An alert that only shows up on a pull-request branch or a feature branch can't be assigned to Copilot at all (per GitHub). If your security team's workflow leans on PR-time scanning to catch issues before merge, that's exactly the surface this feature doesn't touch yet.

Turning it on: three steps, three different admins

This is not a setting you flip from your own repo. Three separate admin layers have to agree, and the first one is the bottleneck.

  1. An enterprise administrator enables the "Agentic autofix" policy inside Advanced Security policies, at the enterprise level. Nobody below that tier can turn it on, even if their org has GitHub Advanced Security licensed.
  2. An organization or repository administrator turns it on in the Code Security settings for the org or the specific repo, once the enterprise policy allows it.
  3. Someone with write access assigns an alert to Copilot, either one at a time from the alert page, in bulk (select up to 25 alerts from a security campaign for Copilot to fix in a single pull request), or via the Update a Code Scanning Alert REST API by setting assignees to ["copilot-swe-agent[bot]"].

Once the policy is live, GitHub swaps the UI under you: the free "Generate Fix" button on individual alerts is replaced by an "Assign to Copilot" button on every repo where the feature is enabled. You don't get to keep both options side by side on the same alert.

Who gets it and what it costs

This is the detail that will disqualify most teams reading this before they get to the setup section.

RequirementWhat GitHub actually requires
PlanGitHub Code Security or GitHub Advanced Security customer
PlatformGitHub Enterprise Cloud, including the data-residency variant
BillingA Copilot billing method on the account (per GitHub)
ConsumptionAI Credits from the Code Security budget, plus GitHub Actions minutes
EnablementEnterprise admin policy, then org/repo admin toggle

The billing mechanics matter more than they look at first glance. AI Credit usage shows up in the "AI usage" section of enterprise billing and licensing, filed under the "Advanced Security" product line, separate from your regular Copilot seat spend. You can set SKU-level budgets specifically for Code Security AI Credits, which is the lever to stop one aggressive security campaign from burning through a month of allotment in an afternoon (per GitHub's billing docs). If your team has already felt the sting of usage-based Copilot bills creeping up this year, treat this the same way: set the SKU budget before you turn on bulk fixing across 25 alerts at once, not after the invoice lands.

The access line is the real gate, though. GA scope is Enterprise Cloud only. Business, Team, and Pro plans don't get agentic autofix in this release, scaled-down or otherwise, no matter what Code Security add-on they're paying for. If you're on one of those tiers, the free "Generate Fix" button is still what you have, and nothing in this GA announcement changes that today.

The limits that stop this from being autopilot

Agentic autofix opens a draft pull request. It does not merge one. Every fix still goes through your normal review and merge process, which is the right call given what a bad auto-merged security patch could do to a default branch, but it means the time savings here are in triage and first-draft quality, not in headcount. Someone still reviews every PR Copilot opens.

The "default branch only" restriction from the mechanism section above is also a real limit, not a footnote. Security campaigns that scan on PR branches to catch issues pre-merge still get nothing from this feature until GitHub extends it.

Worth flagging separately: GitHub also shipped a second GA release the same day, AI Scan for pull requests, which does broader static-analysis scanning across more languages and carries no Copilot billing tie-in at all. It's a different rollout with a different mechanism and a different cost model. Don't conflate the two just because they landed on the same changelog day.

GitHub hasn't published a fix-acceptance-rate number for this feature the way it has for some other Copilot-generated-code work, and there's no public signal yet on whether Business, Team, or Pro plans get a lighter version later. Both are worth checking back on before you build a long-term security workflow around this.

Where this is worth turning on now

If you're already running GitHub Advanced Security on Enterprise Cloud and your alert backlog is the kind of pile where "someone will eventually get to it" has become the actual triage policy, this is worth enabling. The batch mode (up to 25 alerts into one PR) is the real win: a security campaign that used to generate 25 separate manual fix tickets now generates one reviewable PR with validated patches.

If you're on Business, Team, or Pro, there's nothing to turn on yet; put a reminder on the calendar for whenever GitHub announces a scaled-down tier rather than checking the settings page every week. And if your security scanning depends on catching issues on PR branches before merge, this feature doesn't reach you regardless of plan, so don't restructure a workflow around a capability that only covers the default branch.

Either way, the billing method requirement is non-negotiable before any of this works: you need GitHub Copilot tied to the account with a budget set on the Code Security AI Credit line, not just a Copilot seat sitting unused.