A security review can fail for a surprisingly simple reason: the vulnerable code is not part of the change the tool can see. A developer may run a scan, receive no findings, and assume the Pull Request is safe even though the risk sits in another branch, an ignored file, or a dependency configuration outside the active workstream.
That is why learning how to use GitHub Copilot App /security-review is less about memorizing one slash command and more about preparing the right review context. The command is now available in public preview, and it is designed for a fast check of active local code changes before they reach a Pull Request.
This guide shows you how to prepare the session, run the review, interpret severity and confidence, handle fixes, reverify the result, and combine the command with CodeQL, Dependabot, and secret scanning.
What does GitHub Copilot App /security-review actually review?
GitHub Copilot App /security-review is an on-demand security review for current workstream changes inside an active Agent session. GitHub says the command returns prioritized findings with severity and confidence scores, along with suggested fixes that you can apply and verify in the same session. (docs.github.com)
The intended workflow is narrow and useful:
- You make a code change.
- The Agent session tracks the active work.
- You run
/security-review. - Copilot examines the relevant changes.
- You inspect the findings.
- You fix, test, and run the review again.
The command is especially useful for changes involving:
- User-controlled input
- Authentication and authorization
- File paths and uploads
- Database queries
- HTML or JavaScript output
- Serialization and deserialization
- Cryptographic operations
- Error handling and sensitive data exposure
GitHub’s announcement lists common vulnerability classes such as injection flaws, cross-site scripting, insecure data handling, path traversal, and weak cryptography. These categories are practical starting points, but they should not be treated as a complete security taxonomy. (github.blog)
The right mental model is “focused change review,” not “complete security certification.”
Why can a local review produce no useful result?
Before discussing the command itself, you need to understand the limits of Copilot local code vulnerability scanning.
The change scope may be incomplete
The App works with an active Agent session and its current workstream changes. If you edited files outside that workspace, switched branches, reset the working tree, or started a separate session, those changes may not be included in the review.
This is one reason a clean result is not automatically proof that the repository is secure.
The code may require wider application context
A controller may look safe in isolation but become dangerous because of:
- A permissive route configuration
- A missing authorization middleware
- A database helper that constructs queries dynamically
- An unsafe template configuration
- A deployment environment variable
- A reverse proxy rule
- A background job that processes the same data later
AI review can identify likely risks from visible code and context. It cannot guarantee that every runtime relationship has been understood.
AI findings can be incomplete or incorrect
A high-confidence result deserves priority, but it still requires human review. A low-confidence result may be a useful lead rather than a confirmed vulnerability. The reverse is also true: no result does not prove that no vulnerability exists.
Public preview behavior can change
As of July 14, 2026, /security-review is available in the GitHub Copilot App as a public preview feature. Preview commands may change in wording, availability, output format, or supported workflows. (github.blog)
Sensitive source code needs an approved workflow
Security review often involves authentication logic, internal endpoints, payment flows, or proprietary algorithms. Before using an AI-assisted review, confirm that your organization permits the relevant repository and model configuration. For a team, this should be part of your Copilot governance policy, not an individual developer assumption.
What do you need before running the command?
You need four practical conditions.
1. An active Agent session
A Quick chat is not the same as an Agent session. GitHub’s documentation specifically places /security-review inside an active session with in-progress code changes. (docs.github.com)
The GitHub Copilot App supports three documented session modes:
- Interactive
- Plan
- Autopilot
For a security review, Interactive mode is usually the safest choice because you can inspect each suggested change before allowing the agent to modify code. The three session modes are documented in the official App overview. (docs.github.com)
2. A connected project
The project can be a local folder, an existing repository, or a repository cloned through the App. GitHub’s setup guide states that Git must be installed and that you need a connected project before making code changes. (docs.github.com)
3. A meaningful change set
A review is easier to interpret when the branch contains a focused change. Avoid scanning a branch that combines:
- A database migration
- A framework upgrade
- A UI redesign
- Authentication changes
- Formatting changes across hundreds of files
Large mixed diffs increase review noise and make it harder to connect a finding to a specific risk.
4. An account or model configuration that can use the App
The GitHub Copilot App is documented as available across Copilot plans. Business and Enterprise users may require administrator enablement for Copilot CLI-related policies. (docs.github.com)
If the command does not appear, check the App version, account access, organization policy, session type, and whether the current project is connected correctly.
How do you run /security-review step by step?
Use this sequence when you want to know how to use GitHub Copilot App /security-review before opening a Pull Request.
Step 1: Open the project
Launch the GitHub Copilot App and connect the local repository or folder. Confirm that you opened the intended project rather than a parent directory or a second clone.
Check the repository state outside the App if necessary:
git status
git branch --show-current
git diff --stat
You are looking for a clear branch name and a diff that matches the work you expect to review.
Step 2: Start or reopen an Agent session
Create a session for the project. Choose Interactive mode if you want approval before changes are applied.
The success signal is simple: the session should show the project context and the current workstream, not just a blank conversation.
Step 3: Inspect the diff before scanning
Do not run the command immediately. First ask the session to summarize the changed files and security-sensitive paths.
For example:
Summarize the current changes. Identify files involving authentication, authorization, user input, database access, file handling, secrets, and external requests.
This step exposes scope mistakes before the security review starts.
Step 4: Run the command
In the active session, enter:
/security-review
GitHub documents this as the standard command for reviewing current workstream changes for high-confidence vulnerabilities. (docs.github.com)
You can also provide a focused instruction:
/security-review Prioritize authentication, authorization, injection, path traversal, and sensitive data exposure in the current changes.
A focused prompt can make the output easier to triage, but it can also narrow the review. Do not omit broad review passes when the code handles multiple risk areas.
Step 5: Read the findings before accepting fixes
For each finding, record:
- Affected file and line
- Vulnerability category
- Severity
- Confidence
- Triggering input or data flow
- Suggested remediation
- Tests needed after the change
Do not ask the agent to “fix everything” without reading the findings. That can produce a patch that suppresses a symptom while changing business behavior.
Step 6: Validate the proposed fix
Ask the agent to explain why the fix blocks the suspected path. Then inspect the diff manually.
Run the narrowest relevant tests first:
npm test -- path/to/security.test.ts
or:
pytest tests/test_auth.py
Use the project’s actual test runner. The examples above are patterns, not universal commands.
Step 7: Run the review again
After the fix and tests, execute /security-review again. Compare the second result with the first one.
A useful revalidation outcome should tell you:
- Whether the original finding disappeared
- Whether the risky path still exists
- Whether a new issue appeared after the change
- Whether the fix introduced a regression risk
- Whether further manual review is required
Step 8: Open the Pull Request only after the local loop
The GitHub Copilot App supports Pull Request workflows, including viewing changed files, CI results, and review activity. (docs.github.com)
Treat /security-review as an early gate. Your normal Pull Request review, CI checks, CodeQL analysis, dependency checks, and secret scanning should still run afterward.
How should you interpret severity and confidence?
Severity and confidence answer different questions.
Severity asks: “How serious could this issue be if the report is correct?”
Confidence asks: “How certain is the reviewer that this code represents a real issue?”
A high-severity, high-confidence finding is normally the first item to investigate. A high-severity, low-confidence finding still deserves attention because the possible impact is large, but you should verify the data flow before making a disruptive change.
A low-severity, high-confidence finding may be easy to fix and worth addressing if the code is widely reused. A low-severity, low-confidence item may be recorded for manual review rather than immediately changed.
Use this review order:
- Confirm the source of user-controlled or attacker-controlled data.
- Trace where that data travels.
- Identify the sensitive operation.
- Check whether validation, encoding, authorization, or safe APIs already exist.
- Reproduce the behavior with a safe test.
- Decide whether the suggested fix matches the application’s design.
For example, a report about path traversal is stronger when the path comes from an HTTP parameter and reaches a file read without canonicalization. It is weaker when the path is selected from a fixed internal map and the report cannot show attacker control.
Review reminder: Never place real production tokens or customer data into a test case merely to make a security finding easier to reproduce. Use synthetic values and a disposable branch.
How do you handle /security-review false positives?
If you are searching for /security-review false positive handling, use a repeatable triage process instead of dismissing the result immediately.
Confirm the data flow
Find the exact input and follow it to the reported sink. If the value is constant, allowlisted, encoded, or constrained by a trusted boundary, document that fact.
Check framework protections
Some frameworks escape output, validate schemas, or parameterize queries by default. Confirm that the relevant protection is active in this code path rather than assuming the framework handles every case.
Compare runtime behavior
Static reasoning may miss configuration loaded at runtime. Run a targeted test or inspect the relevant configuration file.
Ask for a narrower explanation
You can ask:
Explain the exact attacker-controlled input, the vulnerable sink, and the missing protection. If the path is safe, state which constraint prevents exploitation.
This does not prove the finding is wrong, but it forces a more useful explanation.
Record the decision
For a team, store the reason for accepting, fixing, or dismissing the finding in the Pull Request. A future reviewer should not need to repeat the same investigation.
What is the difference between Copilot security review and CodeQL?
The question “Copilot security review and CodeQL difference” matters because the tools operate at different points in the workflow.
CodeQL is a code scanning technology that analyzes code and produces code scanning alerts. GitHub documents support for built-in query suites, custom queries, local CodeQL CLI workflows, and analysis of compiled languages with build options. (docs.github.com)
/security-review is an interactive, change-focused review inside an Agent session. It is faster for a developer who wants feedback before creating a Pull Request, while CodeQL is better suited to repeatable repository scanning, policy enforcement, and centralized security visibility.
They are complementary:
- Use
/security-reviewduring implementation. - Use CodeQL in CI and repository code scanning.
- Use human review for business logic and threat modeling.
- Use runtime testing for behavior that static analysis cannot prove.
How do Dependabot and secret scanning fit in?
Dependabot focuses on vulnerable dependencies. GitHub says Dependabot alerts are generated when a repository’s dependency graph includes a package with a known vulnerability, and alerts include severity and fixed-version information when available. (docs.github.com)
Secret scanning focuses on exposed credentials and supported secret patterns. It should remain enabled even if your local code review checks for hardcoded values.
A practical boundary looks like this:
| Tool | Primary target | Best timing | Can it replace /security-review? |
|---|---|---|---|
/security-review |
Active local code changes | Before a Pull Request | No |
| CodeQL | Code patterns and data flows | CI and scheduled scanning | No |
| Dependabot | Vulnerable package versions | Dependency updates and alerts | No |
| Secret scanning | Tokens and credential patterns | Pushes, repository monitoring, and alerts | No |
What should your team run before merging?
The following sequence is more reliable than treating one command as a complete gate:
| Stage | Check | Owner | Expected result |
|---|---|---|---|
| Local development | /security-review |
Developer | High-confidence issues in active changes are triaged |
| Local testing | Unit and integration tests | Developer | Intended behavior remains intact |
| Pull Request | Human review | Reviewer | Business logic, access control, and context are checked |
| CI | CodeQL or configured code scanning | Security or platform team | Repository policies and automated analysis pass |
| Dependency review | Dependabot alerts | Repository owner | Known vulnerable packages are updated or documented |
| Credential review | Secret scanning | Security team | Exposed secrets are blocked, revoked, or investigated |
This layered approach answers the practical question: how to check security vulnerabilities before submitting code without pretending that an AI review can cover every risk.
What does a practical configuration look like?
For an individual developer, the simplest configuration is a small, isolated branch with tests and a local review loop.
| Scenario | Recommended setup | Main risk |
|---|---|---|
| Small feature | Interactive session, focused diff, targeted tests | Missing a dependency or configuration issue |
| Authentication change | Plan first, then Interactive review, manual authorization tests | Incorrect access-control assumptions |
| File upload or path handling | Synthetic test files, path traversal cases, revalidation | Unsafe test data or incomplete path coverage |
| Team Pull Request | Local review plus CodeQL, Dependabot, secret scanning, human approval | Assuming one tool covers the whole repository |
| Sensitive production code | Approved model policy, sanitized data, controlled branch | Exposing confidential context or secrets |
If your Mac is the limiting factor for local agents, tests, or parallel development sessions, review the available Mac rental environments before changing your workflow. The useful question is not only whether the command runs, but whether your machine can keep the repository, test suite, logs, and supporting services available without constant context switching.
A Kvmzen test-repository workflow you can reproduce
A safe demonstration should not begin with a real production vulnerability. Use a disposable repository or test branch and introduce one controlled issue, such as:
- An unsafely constructed query in a test endpoint
- A path built directly from a request parameter
- An output value rendered without the expected escaping
- An authorization check removed from a deliberately isolated route
The Kvmzen test process should capture these checkpoints:
| Checkpoint | What to record | Why it matters |
|---|---|---|
| Baseline | Branch name, commit, test status | Proves the starting state |
| Vulnerability introduction | File, line, controlled input | Defines the intended test condition |
| First review | Finding text, severity, confidence | Shows what the App identified |
| Human validation | Reproduction steps and reasoning | Separates real risk from noise |
| Remediation | Changed files and tests | Shows whether the fix is targeted |
| Revalidation | Second review and test result | Confirms whether the issue was addressed |
Do not predefine the expected result. The value of the test is to observe what the current public preview detects, what it misses, and how much manual reasoning is required.
For a stable testing setup, keep the repository isolated, use synthetic credentials, and make every change reversible. If you need a persistent macOS workspace for repeated App sessions and test branches, you can compare the available Mac Mini rental options or contact Kvmzen support about the environment that matches your workflow.
Is this better than your current security workflow?
If your current process is only “push code, wait for CI, then read the Pull Request comments,” it has three practical weaknesses: feedback arrives late, local context is fragmented, and small security issues compete with unrelated review noise.
Adding /security-review gives you an earlier checkpoint while the original author still remembers the design. It does not eliminate CodeQL, Dependabot, secret scanning, or human review. It places a focused review where it can prevent avoidable back-and-forth before the Pull Request becomes a team dependency.
The better comparison is not AI review versus traditional security. It is an unstructured local workflow versus a layered workflow with an early, repeatable review step. If you also need an always-available macOS machine for GitHub Copilot App sessions, automated tests, and repeatable security branches, renting a Mac through Kvmzen can be more practical than maintaining an underpowered local setup or repeatedly rebuilding temporary environments.
Create a disposable test branch, add one controlled security issue, run /security-review, verify the finding manually, apply the fix, and run the review again. That short loop will tell you more about the command’s real value in your codebase than a feature checklist will.
