The Butler
Back to briefings
GitHub / Safer coding

Copilot can check for exposed secrets before you merge. Know what it actually scanned

· The Butler · 4 minute read

The metallic robot Butler stands in an elegant manor.
Butler editorial illustration, not a product screenshot.

When an AI assistant helps build an app, a small configuration file can be more dangerous than a large code change. A working example may accidentally contain a real credential. The review question is not just whether the software runs, but whether anything private came along for the ride.

GitHub's November 17 announcement adds secret-scanning detectors to Copilot's security-review specialist in public preview. The feature is available in the CLI, app, SDK integrations and code review. It combines provider patterns with a trained model for less obvious credentials. Crucially, it checks changes rather than searching the repository's history.

Enabled is not the same as checked

The new detection is off by default. In the Copilot app, GitHub places the switch under Settings > Experimental. In an interactive CLI session, the documented setting is /settings aiSecretDetection on; a review can then be requested with /security-review. Existing security review remains LLM-based until this additional detection is enabled. GitHub says eligible security-review users need no additional plan, but scans consume AI credits.

That is a useful improvement, but the important habit is asking what was inspected. A report about the current changes cannot establish that an old commit, a deployment log or a copied archive is clean. A reassuring result without a clear scope can be mistaken for much more protection than it provides.

Add one question to the handoff

Our suggested handoff question is simple: “Which changes did you check, and what was outside the check?” Ask the assistant to name the reviewed files or change set, note unresolved findings, and distinguish an actual scan from a recommendation to run one. This is a review habit, not a claim that the tool will catch every secret.

For a small personal project, that could mean checking a new settings file, an example environment file and the code that reads them before merging the change. Keep real credentials out of demonstration prompts and test data. Do not create a live key just to find out whether a scanner recognizes it.

A human review still has a different job. Look for unexpected files, copied production values and instructions that tell someone to paste a key into public source. The scanner and the reviewer are not interchangeable; they are two chances to spot a mistake before it spreads.

If it was already exposed, deleting the line is not enough

GitHub's guidance on resolving secret-scanning alerts says exposed credentials should be revoked or rotated with the provider. Treat removing the text as cleanup, not as proof that the credential can no longer be used. Review the provider's incident guidance and the places the value may have reached.

That is also why this feature should not be confused with a full historical audit. If you need to assess an existing repository, consult the broader secret-scanning documentation and establish which protection is enabled for that repository.

The practical improvement is moving a concrete check closer to the moment a change is made. Keep the result attached to that change, fix findings before merging, and resist turning “nothing found here” into “nothing is exposed anywhere.” For the wider workflow, our practical AI projects emphasize small, inspectable first steps rather than unattended changes to important systems.

Source-checked November 18, 2026. Settings and scope were checked against GitHub's documentation; this article does not claim an independent detector test.