You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pull_request_read's get_commits method previously returned commit
messages without any lockdown check, unlike get_diff and get_files
which restrict the whole result when the PR author lacks push access.
Commit content is part of the same untrusted head branch as the diff
and file list, so GetPullRequestCommits now reuses
enforcePullRequestLockdown for consistent, fail-closed behavior
without adding a per-commit permission lookup.
Also updates the lockdown documentation in README.md and
docs/server-configuration.md to:
- list pull_request_read:get_diff, get_files, and get_commits among
the tools that error when the PR author lacks push access (get_diff
and get_files were already implemented this way but undocumented)
- clarify that lockdown mode is a best-effort content filter to
reduce prompt-injection risk, not an authorization boundary
- document the existing intentional trusted-bot exception
(github-actions[bot], copilot) accurately
Fixes#3105
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1602,6 +1602,10 @@ docker run -i --rm \
1602
1602
1603
1603
Lockdown mode limits the content that the server will surface from public repositories. When enabled, the server checks whether the author of each item has push access to the repository. Private repositories are unaffected, and collaborators keep full access to their own content.
1604
1604
1605
+
Lockdown mode is a best-effort content filter intended to reduce the risk of prompt injection from untrusted repository content (issues, pull requests, comments, commits, etc.). It is **not** an authorization boundary: it does not change what the underlying GitHub credential can read or write, and content withheld from a filtered tool response may still be reachable through other tools or direct GitHub API access with the same credential.
1606
+
1607
+
As an intentional exception, content authored by a small set of trusted bot accounts (currently `github-actions[bot]` and `copilot`) is always treated as safe, regardless of push access. This avoids filtering routine automation output (e.g. CI-generated commits or comments) that would otherwise be withheld under lockdown mode.
1608
+
1605
1609
```bash
1606
1610
./github-mcp-server --lockdown-mode
1607
1611
```
@@ -1621,6 +1625,9 @@ Following tools will return an error when the author lacks the push access:
1621
1625
1622
1626
-`issue_read:get`
1623
1627
-`pull_request_read:get`
1628
+
-`pull_request_read:get_diff`
1629
+
-`pull_request_read:get_files`
1630
+
-`pull_request_read:get_commits`
1624
1631
1625
1632
Following tools will filter out content from users lacking the push access:
Copy file name to clipboardExpand all lines: docs/server-configuration.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -292,6 +292,10 @@ When active, this mode will disable all tools that are not read-only even if the
292
292
293
293
Lockdown mode ensures the server only surfaces content in public repositories from users with push access to that repository. Private repositories are unaffected, and collaborators retain full access to their own content.
294
294
295
+
Lockdown mode is a best-effort content filter meant to reduce prompt-injection risk from untrusted repository content; it is not an authorization boundary. It does not restrict what the underlying credential can otherwise read or write, and content withheld from a filtered tool response may still be reachable through other tools or direct GitHub API access with the same credential.
296
+
297
+
As an intentional exception, content authored by trusted bot accounts (currently `github-actions[bot]` and `copilot`) is always treated as safe, regardless of push access, so routine automation output isn't filtered.
0 commit comments