Skip to content
worth noting Security

GitHub adds secret detection in code before merge to Copilot security review

clearly official source

GitHub has launched, in public preview, secret scanning within Copilot security review – checking changes for secrets before merge, available in Copilot CLI, app, SDK, and code review. The feature is opt-in and consumes AI credits.

GitHub has extended the Copilot security review specialist with the ability to run GitHub secret scanning, so that developers and AI agents can detect leaked secrets in code before merge. The feature is available as a public preview in Copilot CLI, Copilot app sessions, via Copilot SDK integrations, and in Copilot code review.

According to GitHub, Copilot security review already searched for exposed secrets as part of its LLM-based analysis. After enabling this new feature, GitHub secret scanning detectors now also run alongside it. The check only applies to the changes made, not to the entire repository history.

Secret scanning is off by default and requires opt-in – in Copilot CLI via the command /settings aiSecretDetection on, in the Copilot app under Settings > Experimental, in SDK integrations by setting the feature flag SECURITY_REVIEW_FINE_TUNED_MODEL, and in Copilot code review under the repository's Settings > Security.

The feature can be used without an additional plan in any tool where Copilot security review or Copilot code review is available. Scanning consumes AI credits within the Secret Protection AI Credit SKU.

What changed

Why it matters

Leaks of API keys and other secrets into code are among the common security incidents, and detecting them only after merge or deployment is more costly than catching them before changes are integrated. Integrating secret scanning detectors directly into the code review workflow and agentic tools makes it possible to catch secrets earlier, but so far only within changes, not within the repository history, and it requires manual enabling and additional AI credits.

Two audiences, two different impacts

What this means

01

For individuals

Developers and agents working with Copilot CLI, Copilot app, SDK integrations, or Copilot code review can now enable additional checks for secrets in code beyond the existing LLM-based analysis, before a pull request is merged.

What to do If a developer uses Copilot CLI, app, or code review, enable secret scanning in settings and run /security-review before merging changes.
More practical updates →
02

For a business

Companies using GitHub Copilot can now detect leaked secrets (API keys, tokens) in code before merge directly within the code review process, which reduces the risk of sensitive data leaking into production or public repositories. The feature is opt-in and consumes additional AI credits, so enabling it brings an extra cost compared to the existing LLM-based review.

Risks and compliance
What to decide Consider enabling secret scanning in Copilot CLI, Copilot app, or Copilot code review tools and verify the impact on AI credit consumption within the Secret Protection AI Credit SKU.
More business impacts →
AI agents code review DevSecOps GitHub Copilot secret scanning security review

Check the original

Event sources

clearly official source · 1 publisher, 0 independent. We count feeds from the same owner only once.

1
GitHub Copilot Changelog primary source · first detected Secret scanning on demand for developers and agents