GitHub · GitHub Copilot

Copilot Autofix

An expansion of GitHub code scanning that automatically generates a suggested code fix, with explanatory text, for eligible CodeQL code scanning alerts on pull requests and the default branch. Suggestions are published automatically as comments on relevant alerts; applying a fix, or creating a branch, commit and draft pull request from a suggestion, is a user action. GitHub documents Copilot Autofix as distinct from agentic autofix, which explores the repository, validates a fix and opens a pull request through Copilot cloud agent.

Recorded characteristics

Function
GitHub documents Copilot Autofix as an expansion of code scanning that provides targeted recommendations to help fix code scanning alerts, including CodeQL alerts, in pull requests and on the default branch. Potential fixes are generated automatically by large language models using data from the codebase, the pull request and code scanning analysis. When Copilot Autofix is enabled for a repository, information from alerts found by code scanning is automatically sent to the model for processing, and results are published as comments on relevant alerts when analysis completes. Each suggestion contains a proposed code change plus explanatory text, and may span more than one file (for example adding a new dependency to package.json). GitHub describes a pipeline of input processing, language model analysis, response generation and output formatting, in which the suggestion is stored within the code scanning backend and displayed as an inline suggestion on the pull request or alert detail page, with no user interaction needed beyond enabling code scanning and creating a pull request. Detection remains the responsibility of code scanning and CodeQL; Copilot Autofix begins from an existing alert and is not documented as discovering vulnerabilities itself.
Data access
GitHub states that the prompt assembled for the model includes CodeQL alert data in SARIF format, code from the current version of the branch (short snippets around each source location, sink location and any location referenced in the alert message or flow path), the first approximately ten lines from each file involved in those locations, and help text for the CodeQL query that identified the problem. The pull request documentation adds that fixes are generated using data from the codebase, the pull request and code scanning analysis. GitHub states that data handled by Copilot Autofix is not employed for LLM training purposes.
Actions
Can take actions
External actions
No
Human confirmation
Conditional
Permission basis
Not established
Administrative control
Documented controls: Copilot Autofix is allowed by default and enabled for every repository using CodeQL, with no separate enablement step, and administrators can disable it at the enterprise, organization and repository levels. Enterprise administrators can disallow Copilot Autofix for security results, which prevents any organization or repository in the enterprise from enabling it; allowing it at enterprise level does not force enablement but leaves the choice to organization and repository administrators. Disabling Copilot Autofix at any level closes all open Copilot Autofix suggestions that were added as comments on code scanning alerts in pull requests, and after re-enabling, suggestions are generated only for pull requests opened afterwards or after re-running code scanning analysis. Disabling Copilot Autofix also blocks agentic autofix, which relies on the same underlying setting; agentic autofix can alternatively be blocked by opting repositories out of Copilot cloud agent. GitHub notes that Copilot Autofix is an integral part of GitHub Code Quality and continues to run on code quality results even when disabled for code security results. Users may dismiss an individual suggestion with Dismiss suggestion, and dismissing an alert requires write permission for the repository.
Default state
Enabled
Availability
GitHub states that Copilot Autofix is available to all public repositories on GitHub.com, as well as internal or private repositories owned by organizations and enterprises that have a license for GitHub Code Security, and that it is enabled for every repository using CodeQL, whether configured through default or advanced setup. It supports a subset of CodeQL queries; availability per query is recorded in the query tables linked from the CodeQL query documentation.
Licensing
GitHub states that no GitHub Copilot subscription is required to use Copilot Autofix and that it does not consume Copilot AI credits, while internal or private repository availability depends on a GitHub Code Security license. GitHub states that use of the feature is governed by the existing terms and conditions associated with GitHub Advanced Security.
External model or provider
GitHub's current concept page states that Copilot Autofix interfaces with GPT-5.3-Codex from OpenAI. GitHub's application card states more generally that Copilot Autofix uses internal GitHub Copilot APIs interfacing with large language models, which produce both the suggested code fixes and the explanatory text.
Limitations and uncertainty
Recorded boundaries and open questions: (1) Copilot Autofix generates a suggestion; it is not documented as applying code changes on its own. Persistent repository writes occur only after a user action — selecting Create PR with fix causes GitHub to create a branch from the default branch, commit the generated fix and create a draft pull request; alternatively the user edits, tests and commits the change themselves. The action classification here rests on the automatic publication of suggestion comments on alerts and on these user-initiated, GitHub-performed branch, commit and draft pull request writes, not on autonomous code modification. (2) Agentic autofix, which explores the repository, validates the fix and opens a pull request through Copilot cloud agent, is a separate behaviour documented on the same pages and is deliberately not attributed to this capability; where Copilot cloud agent is available, assigning an alert uses agentic autofix instead. (3) Copilot Autofix does not detect vulnerabilities; code scanning and CodeQL produce the alerts it starts from. (4) Applying a fix triggers a further code scanning run, and the alert closes if the vulnerability is fixed; Autofix itself is not documented as changing alert state, and dismissal is a separate user action requiring write permission. (5) Permission basis is recorded as not established: GitHub documents write permission for the repository in the user-facing alert workflow and exposes REST endpoints to generate, retrieve the status of and commit an autofix, but does not establish a runtime identity or permission model for the generation service itself. (6) Human confirmation is recorded as conditional because suggestion generation and publication require no user interaction, while GitHub states that all suggestions are presented as proposed code changes requiring explicit developer review and acceptance before being applied. (7) External action is recorded as no: no action on systems outside GitHub is documented for this capability; alert data is sent to the model through internal GitHub Copilot APIs. (8) GitHub documents extensive limitations: non-determinism, difficulty with complex or multi-file data flow and subtle logic flaws, context truncation in very large files (where no fix is attempted), incomplete language and CodeQL query coverage, dependence on LLM operational capacity, English-centric data, and the possibility of syntactically incorrect fixes, fixes at incorrect locations, semantically changed program behaviour, fixes that fail to remediate or that introduce new vulnerabilities, partial fixes, and fabricated or unsafe dependency suggestions. Unsupported queries display a note, and a failed generation prompts the user to push another commit or contact support. GitHub states the feature operates on a best-effort basis and is not guaranteed to succeed. (9) Mitigations documented by GitHub: human-in-the-loop review, content filtering stress-tested by red teaming, and internal quality testing that withholds suggestions failing that testing.

Evidence