Skip to content Skip to footer

How to Govern AI-Generated Code with Security Scans and Usage Data

What Happened

GitHub added several controls relevant to teams using AI coding assistants. Developers can run /security-review on local changes in the Copilot app, CLI, or VS Code before opening a pull request; it suggests fixes without editing code. On pull requests, GitHub Code Security combines CodeQL with AI Scanning for languages outside CodeQL’s coverage. Standard AI Scan can assess older code on the default branch, while Deep Scan is in private preview for critical releases and audits. Findings feed a shared alert backlog with fix suggestions. GitHub reported detecting more than 200 million vulnerabilities from January through October 2026, up 100% year over year. [2]

GitHub’s AI usage REST API now reports per-model input, output, image, and cache-read and cache-write token counts. Capture generally starts December 1, 2026, so older periods may show zero. Detailed usage exports also add a user_id column, making renamed, deleted, and bot accounts easier to reconcile with audit logs. [3][5]

GitHub Actions also began blocking pull_request_target workflows by default in affected public repositories unless an applicable policy allows them. Private and internal repositories are unaffected. [6]

The available information does not establish specific new features for Cursor, Windsurf, Replit, Sourcegraph, JetBrains, Continue.dev, or the cited VS Code releases. The VS Code entries contain no release details, so they should not be treated as changelog evidence. [1][4]

Why It Matters to Businesses

AI-assisted development can increase code volume without increasing review capacity. Passing tests is not proof that generated code is secure. Teams need checks before a pull request, enforceable checks on the pull request, and an accountable process for resolving findings. Per-model token data adds a way to investigate consumption, but token counts alone do not establish value or total cost. [2][3]

Kimbodo Engineering Perspective

Use the assistant for feedback, not as the security authority. Local review is useful because it is fast; release decisions should depend on repository policy, scan results, human ownership, and documented exceptions. A shared alert backlog reduces tool fragmentation, but teams still need to prioritize exploitable findings rather than treating every suggestion as a release blocker. [2]

How We Would Implement It

  • Map repositories, supported languages, existing CodeQL coverage, and public-repository Actions policies. Review any pull_request_target workflow that can handle fork contributions or access secrets. [2][6]
  • Offer /security-review as a pre-PR developer step; run CodeQL and AI Scanning on pull requests, with required review and a defined exception path for high-risk findings. [2]
  • Run Standard AI Scan on eligible default branches to establish a baseline. Evaluate private-preview Deep Scan only for releases whose risk warrants the additional review. [2]
  • Ingest usage data by model and account into cost reporting. Key report joins on user_id rather than username, and parse export columns by header rather than position. [3][5]

Risks, Costs and Security

Scanning adds triage work and can produce findings that require human validation; agentic autofix still needs review and testing before merge. Older per-model token data may be absent, and deleted-account rows can change summed report totals slightly because of per-row rounding. Token telemetry should be access-controlled as operational and billing data. For Actions, explicitly allow a blocked pull_request_target workflow only after checking whether it could execute untrusted fork code with base-repository secrets; use pull_request where appropriate. [2][3][5][6]

Where Kimbodo Comes In

Kimbodo builds and operates this in production for businesses — see our AI Application Development practice, or Estimate My AI Application.

Sources

  1. [1] Visual Studio Code 1.150 (Insiders)
  2. [2] How do you build securely when AI is writing more of the code?
  3. [3] Per-model token breakdown in the AI usage REST API
  4. [4] Visual Studio Code 1.149
  5. [5] Usage reports now include a user ID column
  6. [6] pull_request_target enforcement begins December 2

Leave a comment

0.0/5

Engineering Founded & Customer Focused

KIMBODO LLC. © 2026. All Rights Reserved.