Skip to content

Commit 1211c2e

Browse files
Secret scanning push protection integration with MCP Remote Server #19052 (#57020)
Co-authored-by: Sophie <[email protected]>
1 parent bb4dc57 commit 1211c2e

File tree

7 files changed

+53
-6
lines changed

7 files changed

+53
-6
lines changed

content/code-security/secret-scanning/introduction/about-push-protection.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ Push protection has some limitations. For more information, see [AUTOTITLE](/cod
4747

4848
## How push protection works
4949

50-
Push protection works:
50+
Push protection blocks secrets detected in:
5151

52-
* From the command line. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-command-line).
53-
* In the {% data variables.product.prodname_dotcom %} UI. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-in-the-github-ui).{% ifversion push-protection-delegated-bypass-file-upload-support %}
54-
* On files uploaded onto the repository on {% data variables.product.prodname_dotcom %}.{% endif %}{% ifversion secret-scanning-push-protection-content-endpoints %}
55-
* From the REST API. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-rest-api).{% endif %}
52+
* Pushes from the command line. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-command-line).
53+
* Commits made in the {% data variables.product.prodname_dotcom %} UI. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-in-the-github-ui).{% ifversion push-protection-delegated-bypass-file-upload-support %}
54+
* File uploads to a repository on {% data variables.product.prodname_dotcom %}.{% endif %}{% ifversion secret-scanning-push-protection-content-endpoints %}
55+
* Requests to the REST API. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-rest-api).{% endif %}
56+
* Interactions with the {% data variables.product.github %} MCP server (public repositories only). See [AUTOTITLE](/enterprise-cloud@latest/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-and-the-github-mcp-server).
5657

5758
Once enabled, if push protection detects a potential secret during a push attempt, it will block the push and provide a detailed message explaining the reason for the block. You will need to review the code in question, remove any sensitive information, and reattempt the push.
5859

content/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ children:
1818
- /working-with-push-protection-from-the-command-line
1919
- /working-with-push-protection-from-the-rest-api
2020
- /working-with-push-protection-in-the-github-ui
21+
- /working-with-push-protection-and-the-github-mcp-server
2122
redirect_from:
2223
- /code-security/secret-scanning/working-with-push-protection
2324
- /code-security/secret-scanning/pushing-a-branch-blocked-by-push-protection
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Working with push protection and the GitHub MCP server
3+
shortTitle: Push protection and the GitHub MCP server
4+
intro: 'Learn how you are protected from leaking secrets during interactions with the {% data variables.product.github %} MCP server, and how to bypass a push protection block if you need to.'
5+
product: 'Public repositories on {% data variables.product.prodname_dotcom_the_website %}'
6+
permissions: '{% data reusables.permissions.push-protection-resolve-block %}'
7+
versions:
8+
feature: copilot
9+
type: how_to
10+
topics:
11+
- Secret scanning
12+
- Secret Protection
13+
- Alerts
14+
- Repositories
15+
- Copilot
16+
---
17+
18+
## About push protection and the {% data variables.product.github %} MCP server
19+
20+
Push protection prevents you from inadvertently exposing secrets, such as tokens, keys and credentials, in your repository.
21+
22+
When you're interacting with the {% data variables.product.github %} MCP server, push protection blocks secrets in AI-generated responses as well as preventing secrets from being included in any actions you perform, such as creating an issue.
23+
24+
This protection is on by default for all interactions between the {% data variables.product.github %} MCP server and **public repositories** only, regardless of whether push protection is enabled on the repository's security settings page.
25+
26+
## Resolving a block
27+
28+
To resolve the block, you can either:
29+
30+
* **Remove** the secret from the content of your request before trying again.
31+
* **Bypass the block.** If push protection is enabled for the repository, or you have push protection enabled for your personal account, you'll see an option to bypass the push protection block. You should carefully evaluate if it's safe to include the secret in your request before continuing.
32+
33+
## Further reading
34+
35+
* [AUTOTITLE](/code-security/secret-scanning/introduction/about-push-protection)
36+
* [About the {% data variables.product.github %} MCP server](/copilot/concepts/about-mcp#about-the-github-mcp-server)

content/copilot/concepts/about-mcp.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ The {% data variables.product.github %} MCP server is a Model Context Protocol (
3737
* Connect third-party tools (like Cursor, Windsurf, or future integrations) to leverage {% data variables.product.github %}’s context and AI capabilities.
3838
* Enable cloud-based workflows that work from any device, without local setup.
3939

40+
For public repositories, interactions with the {% data variables.product.github %} MCP server are secured by push protection, which blocks secrets from being included in AI-generated responses and prevents you from exposing secrets through any actions you perform using the server, such as creating an issue. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-and-the-github-mcp-server).
41+
4042
You can access the {% data variables.product.github %} MCP server remotely through {% data variables.product.prodname_vscode %}, or other editors that support remote MCP; or you can run it locally in any MCP-compatible editor, allowing you to choose between the convenience of a hosted solution or the customizability of a self-hosted setup.
4143

4244
If you want to utilize the remote {% data variables.product.github %} MCP server, you can do so in a few steps, without any local setup. This is particularly useful for users who want to quickly leverage {% data variables.product.github %}’s AI capabilities without the overhead of managing a local MCP server.

content/copilot/tutorials/enhance-agent-mode-with-mcp.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Follow these best practices to get the most out of combining MCP servers with ag
5555
* **Limit permissions**: Only grant MCP servers the minimum permissions necessary for your tasks.
5656
* **Review connections**: Regularly audit which MCP servers have access to your development environment.
5757
* **Monitor activity**: Keep track of what actions {% data variables.product.prodname_copilot_short %} performs through MCP servers.
58+
* **Prevent secret leaks**: Push protection blocks secrets from being included in AI-generated responses and prevents you from exposing secrets through any actions you perform using the {% data variables.product.github %} MCP server. This is currently available for public repositories only. See [AUTOTITLE](/code-security/secret-scanning/introduction/about-push-protection).
5859

5960
## Example scenario: Implementing accessibility compliance
6061

content/copilot/tutorials/roll-out-at-scale/enable-developers/integrate-ai-agents.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ To hit a tight deadline, you're aiming to speed up each stage of the process, fo
9191

9292
1. When they're satisfied with the tests, the developer asks agent mode to open a pull request for the work on {% data variables.product.github %}.
9393

94-
>[!TIP] With the **{% data variables.product.github %} MCP server** enabled, {% data variables.product.prodname_copilot_short %} can run the command to open a pull request directly from {% data variables.product.prodname_vscode_shortname %}, with the title and description already filled in.
94+
>[!TIP]
95+
> * With the **{% data variables.product.github %} MCP server** enabled, {% data variables.product.prodname_copilot_short %} can run the command to open a pull request directly from {% data variables.product.prodname_vscode_shortname %}, with the title and description already filled in.
96+
> * Interactions with the {% data variables.product.github %} MCP server are secured by **push protection**, which blocks secrets from being included in AI-generated responses and prevents you from exposing secrets through any actions you perform using the server (public repositories only). See [AUTOTITLE](/code-security/secret-scanning/introduction/about-push-protection).
9597
9698
## 4. Review with {% data variables.copilot.copilot_code-review_short %}
9799

data/reusables/copilot/mcp/troubleshooting-mcp-server.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ If you are having trouble with the {% data variables.copilot.copilot_chat_short
1919
* You have configured the MCP server correctly in your IDE.
2020
* You have the necessary permissions to perform the actions you are trying to execute.
2121

22+
### Push protection block
23+
24+
If you are using the {% data variables.product.github %} MCP server and push protection blocks a secret that you believe is safe to expose, you may be able to bypass the block by specifying a reason for allowing the secret. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-and-the-github-mcp-server#resolving-a-block).
25+
2226
### General tips
2327

2428
If you are experiencing other issues with the {% data variables.product.github %} MCP server, here are some general tips to help you troubleshoot:

0 commit comments

Comments
 (0)