What the November 13 update changes
GitHub has added repository_scan to the existing organization and repository AI Scan settings endpoints in public preview. GET and PATCH use /orgs/{org}/code-scanning/ai-scan or /repos/{owner}/{repo}/code-scanning/ai-scan. The new property accepts enabled or disabled, alongside the existing pr_scan control for pull requests.
This makes a configuration change available to rollout scripts and infrastructure definitions. It does not turn that script into a scanning scheduler. For organization-owned repositories, the announcement covers public repositories and private or internal repositories with GitHub Code Security or GitHub Advanced Security. GitHub Enterprise Server is not supported by this update. Check the current eligibility documentation for the repository owner and visibility you actually use.
Read the policy hierarchy before writing a setting
An organization that disables repository scanning prevents its repositories from opting in. When the organization enables it, eligible repositories inherit the setting and repository administrators can opt out. An enterprise restriction still takes precedence: an attempt to enable AI Scan against that restriction returns 422. A desired repository value cannot override a parent policy.
The API also distinguishes reading from administering. Its fine-grained token requirements differ by endpoint: organization reads require Administration read, while repository reads require Code scanning alerts read; updates require Administration write at the corresponding level. Verify both the caller’s role and the specific endpoint permissions. A read-only inventory should not be given write access simply because a later rollout stage needs it.
A blocked combined update changes neither field
GitHub allows pr_scan and repository_scan in the same request. If either requested change cannot be applied, the request fails and neither setting changes. For example, a proposed request that changes pull-request scanning while enabling repository scanning must not be recorded as a partly successful rollout when one field is blocked.
Treat this as a reconciliation step. Capture the starting values, submit only the intended authorized change, then compare the response and a fresh readback with the desired values. A 422 is not evidence that one field succeeded, nor does every 422 identify the same cause: the REST reference also lists validation failure. Keep the returned error in the rollout record and resolve its actual cause before retrying.
Enabled, scanned and reviewed are different states
Enabling repository_scan does not launch a scan. Users with write access trigger scans on demand; each run consumes Code Security AI credits. Current documentation limits repository scans to the default branch and says scheduled scans and automatic scans on push are unsupported. Budget and scan execution therefore need their own owner and evidence.
A completed scan is also a bounded search, not proof that the entire repository is free of vulnerabilities. GitHub describes an agent selecting code to inspect within a time budget. Its documentation warns about missed vulnerabilities, duplicate CodeQL alerts and inaccurate AI findings. Review each alert and its evidence; do not turn either an enabled flag or an empty result into a clean-security certificate.
A rollout record another developer can review
For a small pilot, Codorc suggests recording the following checkpoints separately. These are proposed operational checks, not results of a live API test or an assessment of GitHub’s detection quality.
- Name the organization, repository visibility and applicable enterprise policy. Confirm eligibility, the accountable administrator and the approved credit budget before changing anything.
- Save the current organization and repository settings with a timestamp. Keep credentials out of logs and use only the permissions each stage needs.
- Record the intended field changes and the returned status. For a combined update, verify both fields together; after an uncertain response, read the state before sending another write.
- Track a deliberately triggered scan separately from enablement: which default-branch revision was examined, when the run finished and what usage was reported.
- Assign someone to review findings and verify fixes. Record why an alert was accepted, dismissed or duplicated, and retain the documented rescan limitations when checking a fix.
Event dates refer to the original announcement. Publication dates show when this article first appeared on Codorc.



