Copilot's security review specialist now runs GitHub secret scanning, and you have to opt in on each surface separately because it is off by default.[1] It works in Copilot CLI, the Copilot app, Copilot SDK integrations and Copilot code review, as a public preview announced November 17, 2026. It scans the changes in front of it, not your repository history, and scans bill AI credits under the Secret Protection AI Credit SKU.[1] Below: the setup table with the exact setting or command for each surface, what the feature does not cover, who pays, and when to use it instead of classic secret scanning.
What GitHub shipped
Copilot security review already looked for exposed secrets as part of its LLM-based analysis. Once you opt in, it also runs GitHub's secret scanning detectors alongside that analysis.[1] Two detection layers do the work:
Provider patterns. More than 500 secret types from GitHub's catalog, built with 150+ partners through the secret scanning partner program. GitHub's code review changelog says these use deterministic methods like regex.[4]
A fine-tuned model. Not every credential has a recognizable format, so GitHub's model reads the surrounding code to flag likely secrets, including passwords and credentials in connection strings.[1]
The split matters because the layers cover different ground. Provider patterns target known credential formats. The model targets credentials with no recognizable format, which GitHub says it finds by reading the surrounding code. Expect to review the model's findings more carefully, since a likely secret is a judgment call rather than a pattern match.
Setup table: one switch per surface
There is no global toggle. The table below is GitHub's own matrix, condensed.[1]
| Surface | Enable secret scanning | Run a scan |
|---|
| Copilot CLI | In an interactive session, /settings aiSecretDetection on | Delegate to security-review via the task tool, or run /security-review |
| Copilot app | Settings > Experimental, turn on AI secret detection | Delegate to security-review via task, or run /security-review |
| Copilot SDK integrations | Set the SECURITY_REVIEW_FINE_TUNED_MODEL feature flag to true when creating the session, and configure GitHub authentication on the SDK client | Delegate from the session agent, or call session.rpc.tasks.startAgent with agentType: "security-review" |
| Copilot code review | Repository Settings > Copilot > Code review, turn on Secret scanning under Security | Request a review from Copilot on the pull request, or set up automatic reviews |
Copilot CLI
In an interactive session, turn it on with the settings command, then run the review yourself or let the agent delegate it.[1]
/settings aiSecretDetection on
/security-review
For agent-driven runs, the delegation target is the task tool with agent_type: "security-review". GitHub's wording is that you can ask your coding agent to run the specialist, use the findings to fix, and request another review. GitHub says you can also run /security-review on an agent's work, which gives you a checkpoint between "the agent says it is done" and a commit.[1]
Copilot app
The toggle sits under the app's Experimental settings, and the review command is the same slash command. GitHub's app docs describe /security-review as a public-preview command that reviews your current workstream changes for high-confidence vulnerabilities and returns prioritized findings with severity and confidence scores, plus suggested fixes you can apply in the same session.[3]
Settings > Experimental > AI secret detection: on
/security-review
The app docs frame it as an initial check on local changes before you open a pull request, one that complements code scanning, Dependabot and secret scanning instead of replacing them.[3] The docs tell you to open an active session that has in-progress code changes before running it.[3]
Copilot SDK
The SDK path has the most conditions. The SDK entry in GitHub's table shows what has to be true, and a footnote adds three limits: a model-provider API key alone is not sufficient, tokens issued by your integration's own OAuth app are not currently supported, and VS Code support is not included in this release.[1] GitHub updated the post on November 18 specifically to clarify the authentication requirements.[1]
// session creation
SECURITY_REVIEW_FINE_TUNED_MODEL = true // feature flag
// GitHub authentication on the SDK client, for example a token
// obtained through GitHub CLI sign-in
// start the review
session.rpc.tasks.startAgent // agentType: "security-review"
This block restates the changelog's three requirements in order. It is a map of what the page says, not a complete program: the changelog gives no full SDK sample, so check the SDK's own documentation for the client constructor before you wire it up. The benefit GitHub names is that an agent can request a security review before returning its changes, without you maintaining separate secret detectors.[1]
Copilot code review
This is the pull request surface, where automatic review means nobody has to remember to run a scan. GitHub says it can flag secrets on added lines, including changes that were not checked during development.[1] The companion changelog says Copilot code review points out exposed credentials in review comments, using both deterministic and non-deterministic approaches, and that you turn it on from repository or organization settings under Copilot, then Code review.[4]
Plan coverage for this surface is explicit: secret detection in code review is available to Copilot Pro, Pro+, Max, Business and Enterprise plans.[4] To get it on every pull request without a manual request, set up automatic review through a branch ruleset with Automatically request Copilot code review. Optional boxes in the same ruleset add Review new pushes and Review draft pull requests.[5] Review new pushes matters here: GitHub's docs say that without it, Copilot reviews the pull request only once, so a later push is not reviewed automatically.[5]
What it does not cover
The limits are as important as the features, and the changelog states most of them directly.
| Gap | Source detail | What to do instead |
|---|
| Repository history | The review checks your changes and does not search repository history[1] | Classic secret scanning scans the entire Git history on all branches[2] |
| VS Code | Not included in this release[1] | Use the CLI, app or pull request review |
| SDK with only a model-provider API key | Not sufficient[1] | Configure GitHub authentication on the SDK client |
| SDK with your own OAuth app tokens | Not currently supported[1] | Use a token from GitHub CLI sign-in, the example GitHub gives |
| Default state | Off until you opt in; security review falls back to its existing LLM-based detection[1] | Enable per surface, and verify with a known test credential in a throwaway branch |
| Cross-repository secret hunting | Not described for this feature in either changelog | Classic scanning offers public monitoring, which detects secrets leaked by your enterprise members in public repositories[2] |
The first row is the one teams will trip on. A clean on-demand review says nothing about commits already in the repository. A key committed months ago and deleted since is outside what this feature checks, because it reads only your changes.
Billing: AI credits, no extra plan
No additional plan is required for the Copilot experiences listed, and SDK integrations must meet the authentication requirements above. Scans consume AI credits under the Secret Protection AI Credit SKU.[1] The changelog gives no per-scan price or credit count, so you cannot forecast the bill from these pages. Treat the first week as a measurement period and read the usage page for that SKU.
For code review, who pays is a setting. At the organization level, Member uses the member's Copilot entitlement and fails the review if their quota is exhausted, while Organization bills the organization and requires AI credits paid usage to be enabled.[5] Whether that billing setting applies to the secret detection SKU specifically is not stated on the pages, so confirm it before you rely on it. One adjacent cost fact: Balanced and Max review effort use more AI credits than Lite.[5]
A related knob in the same release: Adaptive review effort picks Lite, Balanced or Max per pull request based on complexity and risk, and never picks above the maximum set for the enterprise, organization or repository. Balanced remains the default.[4] It is a separate preview from secret detection, so turning one on does not turn on the other.
This versus classic secret scanning
Classic secret scanning and the on-demand review do different jobs. The comparison below uses only what the opened pages state.
| Question | Copilot on-demand secret scanning | Classic secret scanning |
|---|
| What does it read? | The changes under review[1] | Entire Git history on all branches, plus issues, pull requests, Discussions, wikis and secret gists[2] |
| When does it run? | When you or an agent request a review, or on a pull request review[1] | Automatically, with periodic rescans when new secret types are added[2] |
| Where do findings land? | In the session or in pull request review comments[1][4] | Alerts on the repository's Security and quality tab[2] |
| Who gets it? | Copilot users on the listed surfaces and plans[1][4] | Free on public repositories; private organization repositories need GitHub Secret Protection[2] |
| Does it have AI detection? | Yes, a fine-tuned model alongside the 500+ provider patterns[1] | AI-detected secrets are listed as an optional extension, alongside generic patterns, custom patterns and validity checks[2] |
The practical split: classic scanning is your standing alarm over everything you own, and the on-demand scan is a pre-merge gate over the diff. If you only have budget for one habit, run it in code review, because that is the surface that works without anyone remembering to ask. If you build agents, the SDK path lets your agent request a security review before it returns its changes.[1]
GitHub's own guidance on a hit is blunt. Rotate the affected credential immediately. Scrubbing it out of Git history is time-intensive and often unnecessary once the credential is revoked.[2] That applies here too: a finding means the secret is already in the changes you wrote, so treat the credential as exposed once it has left your machine.
What breaks: gotchas
| Symptom | Cause from the sources | Fix |
|---|
| /security-review misses a key that is in the file | Secret scanning is off by default; until you opt in, security review uses its existing LLM-based detection only[1] | Run the enable step for that surface first |
| SDK session cannot run the secret scan | A model-provider API key alone is not sufficient; own-OAuth-app tokens are unsupported[1] | Add GitHub authentication to the SDK client |
| Secret added in a follow-up push is not reviewed | Without Review new pushes, Copilot reviews the pull request only once[5] | Enable Review new pushes in the ruleset |
| Code review fails outright | With Member billing, an exhausted member quota fails the review[5] | Switch the organization to Organization billing, which needs paid AI credits usage enabled |
| Old leaked key never appears | The review does not search repository history[1] | Use classic secret scanning for history |
| Draft pull request gets no review | Review draft pull requests is an optional ruleset setting[5] | Enable it to catch secrets before human review |
One more habit worth keeping regardless of tooling: strip real values before you share a config file for help. The env file converter reshapes .env files in your browser, and if you need a stable fingerprint for a token to log instead of the token itself, the hash generator produces one without sending anything to a server.
Rollout order
Turn on Secret scanning under Security in code review settings for your most active repository, and confirm Review new pushes is on in the ruleset.
Run
/settings aiSecretDetection onin the CLI and enable AI secret detection in the app for developers who use them.For SDK-based agents, add the feature flag and GitHub authentication, and add a security review step before the agent returns its changes.
Check the Secret Protection AI Credit SKU usage after a week, and decide the billing mode for code review.
Keep classic secret scanning running for history. The changelog says the review does not search it.
If you already run a layered review setup, this slots into it as another gate; see the seven-layer code review setup for small teams. And because the SDK path exists for agents that write code unattended, sandboxing coding agents with Docker, gVisor or microVMs covers the containment side that secret scanning does not touch.
Sources
5. Configuring code review by GitHub Copilot, GitHub Docs (accessed 2026-11-21)
Originally published at wowhow.cloud
Top comments (0)