GitHub's November 17 update adds secret detection to Copilot code review in public preview. A review warning can help catch exposure, but it is not the same as push protection, a required check or revoking a credential that was already exposed. Treat those as separate controls and test without planting a real secret.
Know which feature is making the claim
Copilot code review can comment on a suspected secret. Secret scanning, push protection and repository merge requirements are distinct features with their own availability and settings. Do not use a screenshot of one to prove another is enforced.
The announcement describes both recognisable-format and AI-assisted detection. That broadens the kinds of findings a review may produce, but it does not create an exhaustive guarantee. A secret with no obvious format, a generated artefact or an unreviewed path can still require other controls.
Define a safe test before opening a PR
Use an invented repository and a fixture explicitly documented as nonfunctional. If a vendor provides a recognised test token, follow its testing guidance. Otherwise use an inert marker and be honest that it may not exercise a production detector's recognised formats.
Do not paste a live key into a PR and plan to rotate it later. Public exposure can be immediate, and copies can outlive the test. Also avoid sending a real key to an AI reviewer as an experiment in whether it will quote it back.
Detection is the beginning of response
The response to a real exposure differs from handling an inert test fixture.
Review
- Possible secret finding
Verify the finding without copying the value into another public place.
- Exposure classification
Determine whether a real credential was disclosed and where.
Response
- Revoke or rotate if real
Use the provider's controls and investigate affected access.
- Repair and prevent
Remove exposure and retain required repository checks.
Deleting a visible string does not invalidate a real credential that someone may already have copied.
Inspect the actual enforcement path
Create a harmless change that is safe even if no finding appears. Observe whether the review runs, whether it comments and whether any separate required check affects mergeability. Record those outcomes separately. A review that finishes without comments does not prove the repository is free of credentials.
Scroll the table horizontally to see all columns.
| Control | Main role | Separate question |
|---|---|---|
| Review finding | Calls attention to a suspected exposure | Does a maintainer act on it? |
| Secret scanning | Detects supported exposures under its configuration | What paths and formats are covered? |
| Push protection | Can prevent supported exposure at push time | Is it enabled and enforced here? |
| Branch requirements | Govern normal merging | Which checks and approvals are required? |
| Provider revocation | Invalidates a real credential | Was affected access investigated? |
Handle a real finding without spreading it
If the finding is a real credential, use the provider's revocation or rotation process promptly and investigate its scope. Avoid reproducing the value in an issue, chat summary, screenshot or commit message. State the credential type and affected system without copying the secret itself.
Removing the line is necessary cleanup but not revocation. Repository history, build logs, browser bundles and caches may contain copies. Review where the value travelled and follow the relevant incident and history-cleanup guidance. Do not rewrite shared history casually without coordinating the repository impact.
Check build outputs as well as source
A server-side environment value can still leak if build tooling embeds it into frontend JavaScript. Inspect the final bundle and generated HTML for sensitive values using a check that does not print them. Keep secret names and frontend-public configuration conceptually separate.
For payment integrations, only intentionally public identifiers should reach the browser. Signing secrets and webhook secrets belong on the backend. This principle does not depend on whether an AI reviewer happens to flag the code; it is an architecture requirement enforced by implementation and review.
Make prevention a maintained process
Keep credentials in supported secret stores, use narrow permissions and rotate when exposure is suspected. Review staged changes before committing, including configuration examples and generated files. Exclude local environment files from version control while retaining safe example files with placeholders.
Test the repository controls after meaningful configuration changes using safe fixtures. Preserve the distinction between a detector running and a detector catching every possible exposure. The strongest result is a layered system that remains safe when a single review misses something.
Frequently asked questions
Does a Copilot secret warning automatically block merging? Do not assume so. Review findings, push protection, required checks and branch rules are separate controls. Verify the repository's actual enforcement configuration.
Should I commit a real key to test detection? No. Use a documented safe fixture or an obviously nonfunctional synthetic example in a disposable repository. A detection test should not create a genuine incident.
Is deleting an exposed real key enough? No. Revoke or rotate it through its provider, assess affected access and remove the exposure. Copies and repository history can persist after the visible line is deleted.
Sources
- GitHub, November 17: adaptive review and secret detection
- GitHub, November 18: Team security risk assessments
- Related practical guide
Technical references checked .



