AI agents can write code quickly. Now GitHub Copilot can check their changes for leaked credentials before those changes reach a pull request.
Announced on November 17, 2026, on-demand secret scanning is in public preview for Copilot CLI, the Copilot app, SDK integrations, and Copilot code review. The important detail: you must opt in.
What changed?
Copilot’s security-review specialist already used AI-based analysis. With the new option enabled, it also invokes GitHub’s secret scanning detectors, which cover more than 500 types of secrets, plus a specialized model that can recognize suspicious credentials without a predictable format.
This is useful when an AI coding agent edits configuration files, authentication code, or connection strings. It is another check before a secret gets committed or merged, not a substitute for careful review.
How to try it in Copilot CLI
In an interactive Copilot CLI session, enter the documented setting:
/settings aiSecretDetection on
Then request a review of your changes:
/security-review
These are Copilot CLI session commands, not shell commands to paste into Bash or zsh. You can also ask your agent to delegate to the security-review specialist.
Other ways to enable it
- Copilot app: Settings > Experimental > AI secret detection, then run a security review.
- Copilot code review: Repository Settings > Copilot > Code review > Security > Secret scanning; request a pull request review.
- Copilot SDK: Set the
SECURITY_REVIEW_FINE_TUNED_MODELsession feature flag totrueand invoke the security-review agent.
What to know before enabling
GitHub says no additional plan is required if you already have access to the applicable Copilot security review, but scans consume AI credits under the Secret Protection AI Credit SKU. Check your organization’s billing and permissions first.
Limitation: This checks changes, not your entire repository history. A clean review does not prove your code contains no secrets. If a real credential was exposed, revoke or rotate it; simply deleting the line is insufficient.
Takeaway: Turn it on for your next agent-generated change, review the findings, and keep existing secret-management and CI safeguards in place.
