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
- About autofix for code scanning
Supports: Function · Actions · External model · Availability · Default state · Admin controls · Limitations · Primary source
Describes Copilot Autofix as automatically generating a single suggested fix, with explanatory text, for eligible code scanning alerts using codebase and code scanning analysis data.
States that Copilot Autofix generates a suggestion for the user to review and apply, in contrast to agentic autofix, which explores the repository, validates the fix and opens a pull request.
States that Copilot Autofix interfaces with GPT-5.3-Codex from OpenAI.
Records availability for public repositories on GitHub.com and for internal or private repositories covered by GitHub Code Security, and enablement for every repository using CodeQL in default or advanced setup.
States that Copilot Autofix is allowed by default and enabled for every repository using CodeQL, with no separate enablement step.
States that enterprise, organization and repository administrators can disable Copilot Autofix.
Distinguishes Copilot Autofix from agentic autofix and notes that where Copilot cloud agent is available, assigning an alert uses agentic autofix instead.
- Working with Copilot Autofix suggestions for alerts on a pull request
Supports: Function · Data access · Actions · Human confirmation · Permission basis · Licensing · Limitations · Primary source
Describes Copilot Autofix as an expansion of code scanning providing targeted recommendations for code scanning alerts, including CodeQL alerts, in pull requests, generated by large language models.
States that fixes are generated using data from the codebase, the pull request and code scanning analysis.
States that when Copilot Autofix is enabled, alert information is automatically sent to the model and results are published as comments on relevant alerts; suggestions may also propose changes to files the pull request does not touch, such as adding a dependency to package.json.
States that the user must assess suggested changes, may edit and test them, and must commit and push them; a suggestion can be rejected with Dismiss suggestion.
States that dismissing an alert requires write permission for the repository.
States that no GitHub Copilot subscription is needed and records the public repository and GitHub Code Security licensing conditions.
States that Copilot Autofix supports a subset of CodeQL queries, that unsupported queries display a note, that a failed generation prompts the user to push another commit or contact support, and that the feature is best-effort and not guaranteed to succeed.
- Resolving code scanning alerts
Supports: Actions · Human confirmation · Limitations · Primary source
States that 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, and that the Autofix API can generate, retrieve and commit suggested fixes.
States that the user clicks Generate fix where Copilot cloud agent is unavailable, then reviews the generated suggestion before it is used.
Documents the alert resolution workflow in which a committed correction triggers another scan and the alert closes if the vulnerability is fixed.
- Disabling autofix for code scanning security alerts
Supports: Admin controls · Default state · Limitations · Primary source
States that Copilot Autofix can be disabled at the enterprise, organization and repository levels, that disallowing it at enterprise level prevents enablement anywhere in the enterprise, and that allowing it does not enforce enablement.
Confirms that disabling is an administrator action against a feature that is otherwise on, and that after re-enabling, suggestions are generated only for pull requests opened afterwards or after re-running analysis.
States that disabling closes all open Copilot Autofix suggestions on pull request alerts, that disabling also blocks agentic autofix because it relies on the same setting, and that Copilot Autofix continues to run on GitHub Code Quality results even when disabled for security results.
- Application card: GitHub security and quality AI features
Supports: Data access · Function · Actions · External model · Human confirmation · Admin controls · Licensing · Limitations · Primary source
Lists the assembled prompt contents: CodeQL alert data in SARIF format, code snippets around source, sink and referenced locations, the first approximately ten lines of each involved file, and CodeQL query help text; states data is not used for LLM training.
Describes the input processing, language model analysis, response generation and output formatting pipeline, and states the suggestion is stored in the code scanning backend and displayed inline on the pull request or alert detail page.
States that no user interaction is needed beyond enabling code scanning and creating a pull request for a suggestion to be produced and displayed.
States that Copilot Autofix uses internal GitHub Copilot APIs interfacing with large language models that produce both the suggested code fixes and the explanatory text.
States that all suggestions are presented as proposed code changes requiring explicit developer review and acceptance before being applied.
Records opt-in/opt-out controls: allowed by default and enabled for every repository using CodeQL, with administrator disabling available at enterprise, organization and repository levels.
States that use of the feature is governed by the terms and conditions associated with GitHub Advanced Security and that no Copilot subscription is required.
Lists non-determinism, problem complexity, context truncation in large files, language and query coverage gaps, LLM capacity dependence, English-centric data, and syntax, location, semantic, partial-fix, ineffective-fix and fabricated-dependency risks; records content filtering and internal quality testing as mitigations.
- REST API endpoints for code scanning
Supports: Actions · Permission basis · Primary source
Documents REST endpoints to create an autofix for a code scanning alert, get the status of an autofix, and commit an autofix, confirming programmatic generation and commit of a suggested fix.
Exposes autofix operations through the code scanning REST API without establishing a distinct runtime identity for the generation service itself.