01 · Spec Kit
Install it and start a project #
Spec Kit changes the order of work. Instead of "write me an app," you agree on a written spec, a plan and a task list first. The agent then builds from those files, and you review each one.
What you need
- Python 3.11 or later and uv (pipx also works). Linux, macOS and Windows are supported; Windows PowerShell scripts work without WSL.
- A supported coding agent. For this guide, that's GitHub Copilot. Spec Kit lists 43 integrations; the keys for four others are
claude (Claude Code), cursor-agent (Cursor), gemini (Gemini CLI) and codex (Codex CLI).
- Git is optional, and only needed if you turn on the optional git extension.
Install and start
- Install the CLI. This is the form in the GitHub README and docs:
uv tool install specify-cli
- Check the version.
specify version shows what you have; specify self check looks for a newer release. The latest at publication is v1.4.0 (November 10, 2026).
- Start a project for Copilot.
specify init my-project --integration copilot
cd my-project
- Open the folder in the tool where you use Copilot (VS Code, or a terminal for the Copilot CLI) and open the agent chat.
Skip the install line on speckit.org. That site still shows the older --ai flag, --from git+https://… installs and dotted command names. An old CLI fails with "No matching release asset found" or "No such option: --integration." The GitHub README and docs are current.
What init creates
Files and folders created by specify init for Copilot
| Path | What it is |
.specify/memory/constitution.md | Your project's rules. Every later command reads it. |
.specify/feature.json | Which feature folder is active. Commands read this, not your git branch. Override with the SPECIFY_FEATURE_DIRECTORY environment variable. |
.specify/templates/overrides/ | Where your own template changes go. |
.specify/extensions/<id>/ and .specify/extensions.yml | Installed extensions and their hooks. |
.github/skills/speckit-<command>/SKILL.md | How Copilot learns each command. This is Copilot's default "skills" mode. |
.github/agents/, .github/prompts/ | Only if you start with the opt-in --commands layout instead of skills. The two modes are mutually exclusive. |
The current docs don't say how the spec folders are named. An older GitHub page shows specs/003-chat-system/ and a matching branch, and the quickstart says the optional git extension makes numbered branches like 001-feature-name. Look at what your own run creates instead of relying on either.
02 · Spec Kit
Run the commands in Copilot #
The commands are agent skills, not terminal commands. You type them into the agent's chat, one at a time, and read the result before the next one. In Copilot's default mode the form is a slash and a hyphen: /speckit-specify.
The order
Spec Kit commands, order, and what each produces
| Step | Command | What it produces | Needed? |
| 1 | /speckit-constitution | The rules in constitution.md | Once per project |
| 2 | /speckit-specify | spec.md and a built-in checklists/requirements.md | Yes |
| 3 | /speckit-clarify | Up to five questions; answers go into spec.md | Optional |
| 4 | /speckit-plan | plan.md and design files | Yes |
| 5 | /speckit-checklist | Requirements-quality checklists (a ticked box does not mean the work is done) | Optional |
| 6 | /speckit-tasks | tasks.md | Yes |
| 7 | /speckit-analyze | A read-only consistency check across the files | Optional |
| 8 | /speckit-implement | Runs tasks.md; asks first if checklist items are unchecked | Yes |
| 9 | /speckit-converge | Leaves tasks.md alone or appends tasks under a "Convergence" heading | Yes. Repeat 8 and 9 until it says "Converged" |
The short path is specify, plan, tasks, implement, converge. Add the optional steps when the feature is risky.
A first run, from the README
These are GitHub's own example prompts. Paste them into Copilot's chat one at a time:
/speckit-constitution Create principles focused on code quality, testing, and maintainability.
/speckit-specify Build a photo organizer with albums grouped by date and a tile preview of each album.
/speckit-plan Use Vite with vanilla JavaScript. Keep images local and store metadata in SQLite.
/speckit-tasks
/speckit-implement
/speckit-converge
Rule of thumbRead spec.md before you run plan, and tasks.md before you run implement. A wrong spec costs a minute to fix; wrong code built from it costs an afternoon.
If a command doesn't appear
- Fully restart your editor after
init or an upgrade. IDE agents can show duplicate or missing slash commands until you do.
- Check you're on the hyphen form. The dotted form (
/speckit.specify) is from older pages.
- The docs name the agent chat and Copilot CLI for Copilot. They don't say more about VS Code agent mode or the Copilot app, so if one of those doesn't show the commands, try the chat panel or the CLI.
- Other agents use other forms: Codex uses
$speckit-specify and Kimi uses /skill:speckit-specify.
03 · Spec Kit
Existing repos, extensions and upgrades #
Most real work happens in a repository that already exists. Spec Kit handles that, as long as you start small.
Adding Spec Kit to an existing project
- Commit or stash, then make an adoption branch.
- Run
specify init --here --force --integration copilot and read the diff. --force merges into a non-empty folder.
- Optional:
specify extension add git for branch handling. It is not installed by default.
- Run
/speckit-constitution with rules that are actually true today, not hopes.
- Run
/speckit-specify for one bounded change, and state what must not break.
- Continue with clarify, plan, tasks, analyze, implement and converge.
init doesn't rewrite your app or work out your specs. Don't make "document the whole system" your first feature.
Extensions
- Bug fixing.
specify extension add bug, then /speckit-bug-assess "Submitting an empty password crashes the login form." slug=login-crash, /speckit-bug-fix slug=login-crash and /speckit-bug-test slug=login-crash. Files land in .specify/bugs/<slug>/. Only verified means the fix is confirmed, and only the fix step edits source code.
- Idea assessment.
specify extension add assess, then /speckit-assess-intake, -research, -define, -shape and -decide. The decision is go, needs-clarification or kill.
- Community security extensions. Spec Kit's community pages list a "Security Review" extension (github.com/DyanGalih/security-review), Red Team, OWASP LLM Threat Model, ThreatSpec and AttackTree, and two security presets. We didn't verify their install IDs or contents, and the community catalog is discovery-only, so read an extension's source before you add it.
Upgrading
specify self upgrade finds uv or pipx and upgrades with no confirmation prompt. Preview with --dry-run; pin with --tag v1.4.0.
- For the files inside a project:
specify integration upgrade copilot (blocked if you edited tracked files, unless you add --force) and specify extension update.
- It leaves
constitution.md alone. If you need yours back: git restore .specify/memory/constitution.md.
- A
uvx run is a temporary copy and never updates a permanent install.
Spec Kit is a prompt framework, not a sandbox. /speckit-implement edits your code. Run it on a branch, read every diff, and never put a real key, token or password in a spec, constitution or prompt. Those files are meant to be committed.
04 · Keys
Scan for leaked keys #
Finding leaked keys works in three layers: GitHub's own scanners on the repository, a check on your changes before they leave your machine, and a search of your history. Copilot's chat can help with a fourth, but it isn't a scanner.
First ruleIf a real key has been in a repository, treat it as burned. Rotate or revoke it first, then clean the code and the history. Deleting the line doesn't un-leak it.
Layer 1 · Turn on GitHub's scanners
- Open the repository, then Settings › Advanced Security (under "Security and quality").
- Next to Secret Protection, click Enable, then Enable Secret Protection.
- On the same page, switch on Scan for AI-detected secrets. This is the documented name of the feature that finds passwords, which pattern matching misses. It needs Secret Protection but no Copilot license, and its alerts are included at no extra charge.
- Switch on push protection so a push containing a secret is blocked. It is off by default.
- See the results at Security and quality › Secret scanning. AI-detected passwords appear in their own list.
Public repositories get secret scanning free. Private and internal repositories in an organization need Secret Protection. We didn't confirm from GitHub's pages whether push protection is also free on public repositories, so check the settings page for your repository.
From the command line, list open alerts with the GitHub CLI (you must be a repository or organization admin):
gh api "repos/OWNER/REPO/secret-scanning/alerts?state=open"
# optional filters: &secret_type=… &validity=active,inactive,unknown
# after you rotate a key, record it:
gh api -X PATCH repos/OWNER/REPO/secret-scanning/alerts/ALERT_NUMBER -f state=resolved -f resolution=revoked
Two limits. AI push protection (blocking a password at push time) is in preview and uses AI credits. And scanning of secrets printed in Actions workflow logs (public preview since November 9) is limited to GitHub Enterprise Cloud, is off until an enterprise owner turns on a policy, and doesn't look at runs that finished before it was enabled.
Layer 2 · Check your changes before you commit
GitHub's MCP server secret scanning is generally available (since May 5, 2026). It needs Secret Protection on the repository. You ask an agent to scan your current changes before committing:
- In VS Code: type
/secret-scanning in Copilot Chat.
- In the Copilot CLI: install the optional plugin with
/plugin install advanced-security@copilot-plugins, then ask in plain words.
# Prompt (our wording)
Scan my current changes for secrets. Tell me which files and lines to fix.
Don't print any secret value in full.
Layer 3 · Search your history, and use a second scanner
A key removed from the latest commit is still in older ones. Search the history for the patterns that scanners miss most often, then run a dedicated tool as a second opinion. These commands and tools are our suggestion, not GitHub documentation.
# Inline passwords that slip past pattern scanners
git log --all -p | grep -nE 'PGPASSWORD=|sshpass -p|mysql .*-p|password *= *["'"'"'][^"'"'"']+'
# Local scanners (install first): they read the full history
gitleaks detect --source . --log-opts="--all"
trufflehog git file://. --only-verified
Layer 4 · Let Copilot triage, but don't trust a clean answer
Copilot chat can read your files, explain what a hit is and write the fix. GitHub's pages don't document a "hunt for secrets" feature in chat, so treat this as a helper for the findings the scanners give you. Prompt: our suggestion.
Search this repository, including .github/workflows, config files and tests, for hardcoded credentials: API keys, tokens, passwords and private keys. For each one give: the file and line, what kind of secret it looks like (show only the first 4 characters, never the whole value), and a corrected code block that reads it from an environment variable or the secret store. Then list what I must rotate. Don't say the repository is clean; say what you could not check.
A good answer looks like this. (Illustrative example with a made-up placeholder, not real output.)
# src/client.js, line 12: looks like an OpenAI-style key (sk-Q…). ROTATE IT.
- const client = new OpenAI({ apiKey: "sk-REDACTED-EXAMPLE" });
+ const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
After a hit
- Revoke or rotate the key at the provider. For an AI key, also check the provider's usage page for calls you didn't make.
- Record it: close the GitHub alert as
revoked (command above).
- Fix the code so it reads the value from an environment variable or a secret store, and add the file to
.gitignore if it holds local settings.
- Decide about the history. Rotation makes old commits harmless; rewriting history is optional and disruptive.
05 · Scan
A security scan that returns fixes you can apply #
GitHub has four ways to get from "there's a problem" to "here's the change." They differ in what they scan, what they cost and how much they do for you, so here they are side by side.
Ways to get a security scan with recommended fixes in GitHub and Copilot
| Tool | Scans | What you get back | Status |
| CodeQL + Copilot Autofix | The default branch, on a schedule and on pull requests | An alert; Generate fix opens a draft pull request with the change | Free on public repos; Code Security for private org repos |
| Agentic autofix | Alerts you assign | One draft PR for up to 25 alerts, with a summary and validation steps | GA October 15. Enterprise Cloud, admin policy, AI Credits |
| AI Scan | Pull requests (GA Oct 15) or the whole default branch (public preview Oct 28) | Findings labelled "AI" with a risk explanation and often a suggested fix | Public repos; Code Security for private org repos; AI Credits |
Copilot CLI /security-review | Your current local changes | Findings scored for severity and confidence, with fixes to apply before you open a PR | Public preview; any Copilot plan, including Free |
| Copilot code review | A pull request | Comments with suggested changes you apply in a click or two | Copilot access, or an admin-enabled org |
Step 1 · Turn on CodeQL (the base layer)
- Repository Settings › Advanced Security. Under Code Security, next to CodeQL analysis, click Set up › Default.
- Check the languages and the query suite, then click Enable CodeQL. Actions must be enabled, and the repository must be public or have GitHub Code Security.
- CodeQL covers C/C++, C#, Go, Java/Kotlin, JavaScript/TypeScript, Python, Ruby, Rust, Swift and GitHub Actions workflows. We couldn't confirm that default setup turns on the Actions analysis by itself, so check the languages list.
Step 2 · Turn an alert into a pull request
- Open Security and quality › Code scanning and pick an alert.
- Click Generate fix where it's offered, read the explanation and the proposed change, then click Create PR with fix. You get a draft pull request to review. Nothing merges by itself. Autofix works on alerts on the default branch.
- If your enterprise has agentic autofix, the button is Assign to Copilot instead, and you can batch up to 25 alerts into one pull request.
Step 3 · Ask for a scan of your own changes, before you push
In the Copilot CLI, /security-review reviews your current local changes, not the whole repository. It checks 11 categories, scores each finding for severity and confidence, and is meant to be run before you open a pull request. This is GitHub's own documented prompt:
/security-review Review my current local changes for security issues. Prioritize high-severity findings and suggest remediations I can apply before opening a pull request.
It isn't a secret scanner. It lists hardcoded credentials among its checks, but it doesn't use secret scanning; AI secret checks inside it are described as "available soon in private preview." Use layer 2 in section 04 for keys.
To scan a folder, not just your changes, ask in Copilot Chat or the CLI. Prompt: our suggestion.
Act as a security reviewer for the code in src/api/. Look for injection, unsafe deserialization, missing authorization checks, path traversal, SSRF and unsafe use of secrets. Report a table: severity, file:line, and why it is a problem. Then, for every High or Medium finding, give a minimal corrected code block as a diff I can apply. Don't edit any file until I say "apply". If you could not check something, say so.
What a fix block looks like. (Illustrative example, not real output.)
# src/api/files.js, line 31: user input reaches the file path (path traversal). Severity: High.
- const data = fs.readFileSync(path.join(UPLOAD_DIR, req.query.name));
+ const target = path.resolve(UPLOAD_DIR, path.basename(req.query.name));
+ if (!target.startsWith(path.resolve(UPLOAD_DIR) + path.sep)) {
+ return res.status(400).send("Bad file name");
+ }
+ const data = fs.readFileSync(target);
Step 4 · Have Copilot review the pull request, with your security rules
- On the pull request, click Request next to Copilot under Reviewers. From the CLI:
gh pr edit PR_NUMBER --add-reviewer @copilot.
- Apply a suggested change in a click or two, or group several into one commit. Fix with Copilot hands a problem to the cloud agent.
- Reviews are "Comment" reviews. They don't count toward required approvals, and they don't re-run on new pushes unless you configure that.
Give it your rules. Copilot code review reads the instruction files from the pull request's branch. The repository-wide file is .github/copilot-instructions.md; a path-specific one is .github/instructions/NAME.instructions.md with an applyTo pattern at the top. The setting is Settings › Copilot › Code review › "Use custom instructions when reviewing pull requests" (on by default). File content: our suggestion.
# .github/instructions/workflows.instructions.md
---
applyTo: ".github/workflows/**"
---
Flag every workflow change that:
- uses `permissions: write-all` or grants more than the job needs;
- prints a secret or a token to the log;
- runs `pull_request_target` on code from a fork or an untrusted branch;
- uses a third-party action that isn't pinned to a full commit SHA.
For each one, suggest a corrected block. Never suggest disabling a check
to make a build pass.
And in the repository-wide file, a short security section:
# .github/copilot-instructions.md (add)
## Security
- Never put credentials in code, tests, docs or prompts; read them from environment variables.
- In reviews, report hardcoded secrets as High and name what must be rotated.
- Prefer a minimal fix over a refactor, and show it as a code block.
06 · Harden
Settings that blunt a wfx-style attack #
The wfx campaign (AI Weekly No. 32, story 05) used stolen tokens that could write to a repository, pushed a script into a workflow, and stole every secret the job could see. Scanners find leaks afterwards. These settings make the first push harder, and make a stolen token worth less. Nothing here is Copilot-specific.
GitHub settings that limit a stolen-token workflow attack, with setting paths
| Control | Where | Why it helps |
| Read-only default token | Repository Settings › Actions › General › Workflow permissions: choose read-only, then Save. On the same page, review "Allow GitHub Actions to create and approve pull requests." | An injected job can't write if the token can't. |
| Reviews on workflow changes | Settings › Rules › Rulesets › New ruleset › New branch ruleset: "Require a pull request before merging" and "Require review from Code Owners." Add /.github/workflows/ @your-team to CODEOWNERS. | A push can't change a workflow without a person approving it. (Org rulesets need Team or Enterprise.) |
| Deploy secrets behind approval | Settings › Environments › New environment: turn on Required reviewers and Prevent self-review; limit deployment branches. | A secret that needs a human click can't be dumped by a job that sneaks in. (Private repos need a paid plan.) |
| Tight cloud trust | In your cloud's trust policy, restrict the OIDC sub claim to a repository and environment, for example repo:org/repo:environment:prod, plus ref and job_workflow_ref. | Stops a stolen-token job logging in to your cloud from any branch. |
| Token review | Organization Settings › Personal access tokens › Active tokens: filter and revoke. | Removes the stolen-token supply. |
| Audit trail | Organization Settings › Archive › Logs › Audit log (owners; 180 days). Filters: action:workflows, action:personal_access_token, repo:org/repo. | Shows deleted workflow runs and token use. |
Also on the way: GitHub blocks pull_request_target by default in public repositories from December 2, and workflow execution protections have been generally available since September 17. Neither stops a valid token that is allowed to push, which is why the controls above matter. We found no source saying CodeQL would have caught wfx.
07 · Together
A Spec Kit plan for a security clean-up #
Here's the payoff of doing the spec first. A clean-up touches settings, secrets and code, and it's easy to skip a step. Write the steps down, let the agent do the code parts, and keep the settings and the rotating for yourself. Everything in this section is our suggestion for how to combine the tools; the commands and settings are the documented ones above.
- Prepare. Make a branch. Run
specify init --here --force --integration copilot and read the diff.
- Constitution (the rules the agent must follow):
/speckit-constitution Security rules for this repository: no secrets in code, specs, prompts or logs; secrets come from environment variables or the secret store; any change that touches authentication, input handling or workflows needs a short written threat note; tokens get the least access they need; third-party actions are pinned to a commit SHA; never disable a scanner or a check to get a build to pass; never print a secret value in full.
- Specification (what "done" means):
/speckit-specify Security hardening pass for this repository. (1) Find hardcoded credentials, remove them from the code, and produce a list of every credential that must be rotated. (2) Confirm that secret scanning, AI-detected secrets, push protection and CodeQL default setup are enabled, and list the settings I must change by hand. (3) Make workflow tokens read-only by default and add review rules for .github/workflows. (4) Fix High and Medium findings from code scanning, as small reviewed changes. Done means: no open secret-scanning alerts, CodeQL passes on the default branch, workflows default to read-only, and a rotation list that a person has signed off.
- Clarify, then plan (keep it on built-in tools):
/speckit-clarify
/speckit-plan Use only GitHub's built-in scanners and the Copilot CLI /security-review. No new paid tools. Changes to repository or organization settings can't be made by the agent; list them as manual steps with the exact Settings path.
- Tasks and a consistency check:
/speckit-tasks, then /speckit-analyze. Read tasks.md. Make sure the manual settings steps and the rotation steps are in it.
- You do the manual steps: turn on the scanners (section 04), set read-only tokens and rulesets (section 06), and rotate any key the scan found before the agent edits the code that used it.
- Implement and converge:
/speckit-implement, then /speckit-converge, repeating until it says "Converged." Review every diff.
- Verify with the scanners, not the agent: open the pull request, let CodeQL and AI Scan run, request Copilot code review, and check that the secret-scanning list is empty.
A realistic time budget (our estimate for a small repository)
Estimated time for a Spec Kit security clean-up on a small repository
| Step | Time |
| Install, init, constitution, specify, clarify, plan, tasks | 20–30 minutes, mostly reading |
| Turn on scanners, set tokens and rulesets by hand | 15 minutes |
| Rotate keys the scan finds | 5–30 minutes each, depending on the provider |
| Implement, converge, review diffs | 30–90 minutes |
| Scanner and review pass on the pull request | 10–20 minutes |
08 · Limits
Plans, costs and what can go wrong #
Who needs what
Plan requirements for GitHub security features, November 2026
| Feature | Requirement |
| Spec Kit | Free and open source (MIT). It runs in your agent, so Copilot usage rules apply. |
| Secret scanning, public repos | Free |
| Secret scanning, private org repos | Secret Protection (Team or Enterprise Cloud) |
| AI-detected secrets | Secret Protection; no Copilot license |
| Secret scanning in Actions logs | Enterprise Cloud with Secret Protection or Advanced Security (public preview) |
| CodeQL and Generate fix | Free on public repos; Code Security for private org repos |
| Agentic autofix | Enterprise Cloud with Code Security or Advanced Security, an admin policy, and AI Credits plus Actions minutes |
| AI Scan (pull requests and repositories) | Public repos; Code Security or Advanced Security for private org repos; an enterprise policy that defaults to "Not allowed"; AI Credits; no Copilot license |
/security-review | Any Copilot plan, including Free |
| Copilot code review | Copilot access, or an organization where an admin enabled it; higher effort levels use more AI credits |
Prices for Secret Protection and Code Security change; check GitHub's plans page before you budget.
What can go wrong
- A clean result isn't proof. Scanners miss secrets that don't look like secrets (215 of the 1,379 secrets in Apiiro's study, about 16%, slipped past two popular scanners; see AI Weekly No. 32, story 07), and AI findings are advisory.
- A suggested fix can be wrong. Read it, run your tests, and never merge a fix you don't understand. Fixes arrive as draft pull requests for that reason.
- The agent can leak what it reads. Don't paste real keys into prompts, specs or chats. If you do, rotate the key.
- Autofix works on the default branch. An alert that exists only on a feature branch gets no Generate fix button.
- AI Scan results don't auto-close. After you merge a fix, run a new scan.
- Preview features change. AI Scan for repositories, Actions log scanning, AI push protection and
/security-review are previews. Recheck the changelog before you rely on them in a process.
Rule of thumbPlan in writing, scan with GitHub's tools, fix in small reviewed pull requests, and rotate every key first.
Sources
- github/spec-kit README and releases (v1.4.0, November 10, 2026) — GitHub
- Installation · Quickstart · Copilot integration · Running commands · Existing projects · Upgrade · Bug-fix guide · Community extensions — Spec Kit docs, checked November 13, 2026
- speckit.org (older install steps; not used)
- Enabling secret scanning for your repository · Enabling AI-detected secrets · About push protection · Secret scanning REST API — GitHub Docs
- Purpose-built model for leaked secret detection — GitHub Changelog, October 7, 2026
- Secret scanning with the GitHub MCP server is generally available — GitHub Changelog, May 5, 2026
- Secret scanning detects secrets in Actions workflow logs — GitHub Changelog, November 9, 2026
- Configuring default setup for code scanning · Resolving code scanning alerts — GitHub Docs
- Agentic autofix for code scanning alerts, generally available — October 15, 2026 · AI Scan for pull requests, generally available — October 15, 2026 · AI Scan for repositories, public preview — October 28, 2026 — GitHub Changelog
- Dedicated security review command in the Copilot CLI — GitHub Changelog, June 10, 2026 · Copilot CLI best practices — GitHub Docs
- Using Copilot code review · Adding repository custom instructions — GitHub Docs
- Managing GitHub Actions settings for a repository · Available rules for rulesets · Managing environments · OpenID Connect · Reviewing the audit log — GitHub Docs
- pull_request_target blocked by default December 2 — GitHub Changelog, November 2, 2026
FAQ #
How do I install and start GitHub Spec Kit with Copilot?
Install Python 3.11 or later and uv, then run uv tool install specify-cli. Start a project with specify init my-project --integration copilot, open the folder in VS Code or the Copilot CLI, and type the commands into the agent chat: /speckit-constitution once, then /speckit-specify, /speckit-plan, /speckit-tasks, /speckit-implement and /speckit-converge. In Copilot's default skills mode the commands live in .github/skills/. The latest release at publication is v1.4.0, from November 10, 2026.
Why do the Spec Kit commands on speckit.org not work?
speckit.org still shows an older version of the tool: the --ai flag, installs from a GitHub URL and dotted command names such as /specify. The current GitHub README and docs use --integration, uv tool install specify-cli and hyphenated commands such as /speckit-specify. An old CLI fails with "No such option: --integration."
How do I scan a GitHub repository for leaked API keys?
Open Settings, then Advanced Security, and enable Secret Protection, "Scan for AI-detected secrets" and push protection, then read the results under Security and quality, Secret scanning. Public repositories get secret scanning free; private organization repositories need Secret Protection. Before each commit, ask Copilot, with the GitHub MCP server's secret scanning (generally available since May 5, 2026), to scan your changes. Search your git history and run a second scanner such as gitleaks or trufflehog. If you find a real key, rotate or revoke it first, then clean up the code.
Can GitHub Copilot run a security scan and suggest code fixes?
Yes, in several ways. CodeQL code scanning with Copilot Autofix turns an alert into a draft pull request with the fix. The Copilot CLI's /security-review command reviews your current local changes and suggests fixes before you open a pull request. AI Scan reports findings on pull requests (generally available October 15, 2026) or on a whole repository (public preview since October 28). Copilot code review posts suggested changes on a pull request that you can apply in a click. Each needs different plans, and none proves the code is secure.
Does Copilot's /security-review find hardcoded secrets?
It lists hardcoded credentials among its checks, but it doesn't use GitHub's secret scanning, and it only reviews your current local changes. GitHub describes AI secret checks inside the command as "available soon in private preview." For keys, use Secret Protection, the MCP server's secret scanning and a local scanner.
Which GitHub settings help against a stolen-token attack like wfx?
Set the default workflow token to read-only (Settings, Actions, General), require pull requests and code-owner review for the .github/workflows folder with a ruleset, keep deploy secrets in environments with required reviewers, restrict the cloud OIDC trust policy to a repository and environment, and review active personal access tokens in the organization settings. These make the first malicious push harder and a stolen token less useful; none is a guarantee.