Live
Agentic Retrieval Needs an Agent‑Ready Schema: Reducing Latency and Token WasteDeepSeek Harness’s automatic job shutdown hurts benchmark performance – what engineers need to knowGoogle open‑sources AQuA to bring concrete observability to production AI agentsAutomating AI Scan Repository Control with GitHub’s REST APIAgentCore runtime upgrades slash cold‑start latency and boost isolated compute for AI agentsNative Reverse ETL: Simplifying Data Sync from BigQuery to AlloyDBControlling Cloudflare Workers and Durable Objects Spend with New LimitsUnified telemetry for AI agents in BigQuery and Looker: practical implications for engineersAgentic Retrieval Needs an Agent‑Ready Schema: Reducing Latency and Token WasteDeepSeek Harness’s automatic job shutdown hurts benchmark performance – what engineers need to knowGoogle open‑sources AQuA to bring concrete observability to production AI agentsAutomating AI Scan Repository Control with GitHub’s REST APIAgentCore runtime upgrades slash cold‑start latency and boost isolated compute for AI agentsNative Reverse ETL: Simplifying Data Sync from BigQuery to AlloyDBControlling Cloudflare Workers and Durable Objects Spend with New LimitsUnified telemetry for AI agents in BigQuery and Looker: practical implications for engineers
GitHub

Automating AI Scan Repository Control with GitHub’s REST API

AI SummaryPowered by AI

GitHub now lets you enable or disable AI Scan for individual repositories through the REST API by setting the repositoryscan property at both organization and repository endpoints. This lets engineers script bulk roll‑outs, integrate the setting into IaC pipelines, and enforce policy without manual UI changes.

GitHub has added a public preview that exposes a repository_scan toggle via its code‑scanning REST API, allowing organizations and individual repositories to turn AI Scan on or off programmatically. For teams that manage dozens or hundreds of repos, the ability to script this change removes a manual bottleneck and aligns the feature with existing infrastructure‑as‑code workflows.

API Changes

The new capability is accessed through the same endpoints that already control pull‑request scanning (pr_scan). Both GET and PATCH operations now accept a repository_scan field:

  • GET /orgs/{org}/code-scanning/ai-scan
  • PATCH /orgs/{org}/code-scanning/ai-scan
  • GET /repos/{owner}/{repo}/code-scanning/ai-scan
  • PATCH /repos/{owner}/{repo}/code-scanning/ai-scan

Setting repository_scan to enabled or disabled mirrors the behavior of pr_scan: an organization‑level disable blocks all repos, an organization‑level enable allows inheritance, and individual repos can opt out.

{
  "repository_scan": "enabled",
  "pr_scan": "enabled"
}

Operational Impact

Because the toggle is now API‑driven, teams can embed it in CI/CD pipelines, Terraform modules, or custom scripts. This makes bulk roll‑outs and roll‑backs repeatable and auditable. The change does not automatically start a scan; scans must still be triggered manually or via existing automation, and each run consumes GitHub Code Security AI credits. When an organization attempts to enable a setting that conflicts with an enterprise policy, the API returns a 422 error, and no partial updates occur if either pr_scan or repository_scan is blocked.

Security and Governance Considerations

Only organization owners and security managers can modify the organization‑level setting, while repository administrators can opt a single repo out. The feature is limited to public repos owned by organizations and to private or internal repos that already have GitHub Code Security or GitHub Advanced Security. Enterprise owners must first allow AI Scan in the enterprise policy; otherwise, any enable request fails with 422. GitHub Enterprise Server does not support this preview.

Related CloudNinjas coverage: security.

What This Means For Practitioners

  • Integrate the PATCH call into your IaC pipeline to enforce a baseline AI Scan posture across all new repositories.
  • Implement error handling for 422 responses to surface policy mismatches early in the deployment process.
  • Track credit consumption separately, as enabling the toggle does not start scans but does not prevent on‑demand runs.
  • Review organization and enterprise policies to ensure AI Scan is permitted before automating enablement.
  • Document the ownership model: organization owners/security managers for global settings, repo admins for opt‑outs.
Originally published atGitHub Changelog