What the new setting controls
The existing endpoint exposes pr_scan for pull request AI Scan. The preview adds repository_scan for granting access to scan code already in a repository. Use GET to read settings and PATCH to update them at /orgs/{org}/code-scanning/ai-scan or /repos/{owner}/{repo}/code-scanning/ai-scan. Each setting takes enabled or disabled.
GitHub says users with write access still start repository scans on demand, and each scan consumes Code Security AI credits. A successful PATCH verifies a setting change. Check an actual scan run separately for findings and consumption.

