Add opt-in filtering for content from users without push access#428
Add opt-in filtering for content from users without push access#428
Conversation
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
|
@copilot there are some linter errors and also endpoints like search issues and possibly others also need this (remember all pull request body text, comments, issues etc. should be filtered this way. Also do not filter out content from the logged in user either. |
…user Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
I've fixed the content filtering to extend to more tools and also ensured content from the logged-in user won't be filtered. The changes include:
All code now builds successfully. See commit b34ec6f. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Overview
This PR adds an opt-in way to limit issue, comment and PR input from users without push access to a specified repository. This helps mitigate prompt injection attacks when using this repo in headless contexts, especially for coding agents.
Implementation Details
--trusted-repoto the CLI which takes a repository in the formatowner/repoGetIssueandGetIssueComments) to filter content based on user permissionsUsage
To enable content filtering, start the server with the trusted repo flag:
github-mcp-server stdio --trusted-repo="owner/repo"When filtering is enabled, any content from users without push access to the specified repository will be excluded from the results.
Technical Notes
Fixes #427.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.