- Invariant Labs showed that a malicious issue in a public repository could steer an agent into leaking private repository data through a public pull request.
- The researchers say this is not a flaw in the server's code but an architectural issue for any agent with that access.
- Their main mitigations: limit an agent to one repository per session and monitor tool calls.
What happened
On May 26, 2025, the security firm Invariant Labs published a demonstration against the official GitHub MCP server 1. A user had a public repository and several private ones, and an agent connected to their GitHub account. An attacker opened an issue in the public repository containing hidden instructions. When the user asked the agent to look at open issues, the agent read the planted issue, pulled data from the private repositories into its context, and published it in a new pull request on the public repository 1.
The demonstration used a recent, highly aligned frontier model in a desktop client. The researchers note the client asks for confirmation of tool calls by default, but that many users choose an "always allow" setting 1.
Why it happened
The researchers stress that the tools were not compromised and that this is "not a flaw in the GitHub MCP server code itself," but an architectural issue that the server alone cannot patch 1. The agent combined three things in one session: access to private data, exposure to content anyone could write, and a way to publish. That combination is what turns a prompt injection into a leak.
What it cost or risked
This was a controlled demonstration with test repositories, not a reported breach 1. The risk it shows applies to any organization whose developers connect agents to code hosts with broad tokens: proprietary code and internal information in private repositories, published by the organization's own account.
What a verification-first team does differently
- Breaks the combination. An agent that reads public, untrusted content in a session does not also hold access to private repositories in that session.
- Scopes tokens to the repository in front of it. The researchers propose a policy of one repository per session 1.
- Keeps a human in front of the outbound step. Creating a pull request or posting anywhere public needs approval, and "always allow" is not the default.
- Records tool calls so an unexpected cross-repository read is visible.
How our services map
- AI agents. Agent designs that separate untrusted input, private data and outbound actions.
- Governance and security. Rules for MCP servers, token scope and approval settings.
- Secure AI Training for teams. Training developers to recognize prompt injection risk in their own tools.
Swallowtail Systems™ did not work on this incident or study. This case is our reading of the public record, and every figure belongs to the organization cited. The service mapping shows where our work applies to the same risk, not work we performed here. Read how we choose and source cases.