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:
- It explores relevant files across the codebase, not just the file the alert points to.
- It generates a proposed fix.
- It validates the fix by rerunning CodeQL against the patched code, confirming the specific alert closes.
- 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.
- 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.
- 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.
- 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
assigneesto["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.
| Requirement | What GitHub actually requires |
|---|---|
| Plan | GitHub Code Security or GitHub Advanced Security customer |
| Platform | GitHub Enterprise Cloud, including the data-residency variant |
| Billing | A Copilot billing method on the account (per GitHub) |
| Consumption | AI Credits from the Code Security budget, plus GitHub Actions minutes |
| Enablement | Enterprise 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.