Security News

Copilot's security review can now run GitHub's secret scanning on your diff. It's off by default, so test it before you trust it

A public preview from 17 November puts 500+ provider patterns and the AI secret model behind /security-review. Fifteen minutes with a planted fake key tells you what it catches.

A glass archway standing in a dark concrete hall while a narrow beam of gold light sweeps across it.

In October, GitHub’s AI secret-detection model arrived with AI push protection, a private preview that checks at push time (earlier post ). What changed on 17 November is that detection now runs earlier and on request: Copilot’s security review can call GitHub’s secret scanning against your changes before anything is committed, pushed or merged. It’s a public preview, according to the GitHub changelog , and it ships switched off.

That makes it the first time a developer, or an agent working for one, can ask “does my diff contain a credential?” in the terminal and get an answer from the same detectors GitHub uses on its own platform. Whether the answer is good enough to rely on is something you can find out in a quarter of an hour.

What actually runs

Two detection layers sit behind the scan. The first is provider patterns for more than 500 secret types, built with 150+ partners through GitHub’s secret scanning partner programme. Those are deterministic: a known token format matches or it doesn’t. The second is the fine-tuned model from October, which reads the surrounding code to flag likely secrets that have no recognisable shape, such as passwords and credentials embedded in connection strings.

The scan covers your changes only. It doesn’t search repository history. That matters if you’re hoping to use it as an audit: a key committed six months ago and untouched since won’t show up, because it isn’t in the diff.

The second thing to know is the billing. GitHub says scans consume AI credits under the Secret Protection AI Credit SKU. No additional plan is required for the Copilot experiences listed in the announcement, but the credits are real spend, and the October announcement says push protection credits are billed even when a check doesn’t block a push. Ask whoever owns the budget before you turn it on across a team.

Where to switch it on

The preview is wired into four places, and each has its own opt-in.

  • Copilot CLI: in an interactive session, run /settings aiSecretDetection on. Then either run /security-review yourself or let an agent delegate to the security-review agent through the task tool (agent_type: "security-review").
  • Copilot app: Settings, then Experimental, then turn on “AI secret detection”. The scan runs the same two ways.
  • Copilot SDK: set the SECURITY_REVIEW_FINE_TUNED_MODEL feature flag to true when creating a session, authenticate to GitHub (a token from GitHub CLI sign-in works), then delegate from the session agent or call session.rpc.tasks.startAgent with agentType: "security-review". A model-provider API key on its own isn’t enough, and tokens from your own OAuth app aren’t supported yet.
  • Copilot code review: in repository Settings, Copilot, Code review, turn on “Secret scanning” under “Security”. Findings then appear as review comments on the changed lines of a pull request, per the companion changelog entry . That one is listed for Pro, Pro+, Max, Business and Enterprise plans.

VS Code isn’t supported in this release. If your team lives in VS Code, the pull request route is the one that works today.

A fifteen-minute test before you rely on it

GitHub publishes no accuracy figures for the model-based layer, and the changelog doesn’t describe false positive rates. So measure it on your own code. Make a throwaway branch and plant a handful of fakes in a file the diff will include, a mix of the shapes that matter:

// Planted test values. Never commit this branch.
public static class Fixtures
{
    // Known provider format: a well-known placeholder key id.
    public const string AwsKeyId = "AKIAIOSFODNN7EXAMPLE";

    // No recognisable format: a password inside a connection string.
    public const string Db =
        "Server=tcp:db.internal,1433;Database=Orders;User Id=svc_orders;Password=Tr0ub4dor&3x!;";

    // Looks secret-shaped but isn't: should not be flagged.
    public const string TraceId = "4bf92f3577b34da6a3ce929d0e0e4736";
}

Run /security-review in the CLI with the setting on, and read the result against what you planted. The first line tests the deterministic layer. The connection string tests the model, which is the part GitHub’s own announcement leans on. The trace identifier is the false-positive probe: a long hex string is exactly the kind of thing that trips naive scanners.

Then run it against something realistic. Take a recent branch of your own, one you know is clean, and see whether it raises noise. A tool that cries wolf on every fixture file gets switched off within a week, and an agent that has to read twenty bogus findings per run will learn to ignore them.

One more check is cheap and worth doing: put the same fake key in a file that was committed two commits ago and isn’t in the current diff. The scan shouldn’t report it. If it doesn’t, you’ve confirmed in your own repository what the changelog states, and you know to cover history some other way.

What it replaces and what it doesn’t

It doesn’t replace push protection. The scan is something you or an agent chooses to run, and a forgotten step means no scan. Push protection runs on the server whether or not anyone remembers, and the October post covers its own preview gate: GitHub Secret Protection or Advanced Security is required, and a Copilot subscription doesn’t substitute for it.

It also overlaps with something already available. The GitHub MCP Server’s secret scanning went generally available in May, per the changelog , and that route scans your current changes from any MCP-capable agent, provided Secret Protection is enabled on the repository. The new preview is the Copilot-native path, and the only one that lists the model-based detection for unformatted secrets in the announcement. If your agent isn’t Copilot, the MCP route is still the one to try first, since it works with whatever agent you already run.

The practical split, as opinion: use the on-demand scan as the fast feedback loop that keeps a secret out of the commit, and keep server-side push protection as the net that catches everything the loop misses. An agent that writes a config file with a real token in it should hit the first check before a human ever opens the pull request.

Gaps to plan around

  • Off by default, per surface. Turning it on in the CLI does nothing for code review, and the other way round.
  • Diff only, no history. Existing leaks need a separate repository scan.
  • No VS Code in this release.
  • Preview status means behaviour and billing can change. The announcement gives no date for general availability.
  • Scans are billed as AI credits, so a loop that calls the scan on every agent turn has a cost you can’t see until the invoice.

If you only do one thing this week, run the planted-fixture test above in the CLI and keep the output. It tells you, for your own code, whether the model layer is worth the credits.