TL;DR: Private repository content can be exposed when a public issue, privileged access, and a writable outbound channel sit in one MCP-connected session, Repello AI details. Repository scoping and separate trust zones are the controls that keep private data from moving out.
Editorial analysis by NHI Mgmt Group, based on content published by Repello AI: “GitHub MCP Server Security: The Private Repo Exfiltration Problem”.
Key questions
Q: Why do overbroad repository tokens increase the risk of prompt injection?
A: Because prompt injection becomes meaningful only when the agent can use the injected instruction against data it should not reach.
Q: What do security teams get wrong about read-only GitHub tokens?
A: They assume blocking writes closes the problem.
Q: What breaks when an MCP agent can read public issues and private code in the same session?
A: The trust boundary collapses.
Practitioner guidance
- Scope each session to one repository Issue a token that can only reach the repository being worked on, so a public triage session cannot touch private code.
- Separate public and private agent sessions Do not reuse a session that has read attacker-controlled public content for later work in a private repository.
- Gate write operations explicitly Require confirmation before creating pull requests or issue comments, because those are the channels that can publish sensitive context outward.
Bottom line: The main risk is not a code vulnerability in GitHub's MCP server but a trust-boundary failure caused by one token spanning public and private repositories.
Glossary terms: MCP Server, Prompt Injection (Agentic), Token scope, Trust Boundary
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Repository scope is the control, not the patch status: A server can be free of CVEs and still expose private code if one token reaches multiple trust zones. In this pattern, the governance failure is architectural because the same identity can consume public input and act on private data in one session. The practitioner lesson is that patch-centric thinking misses the actual boundary that failed.
A few things that frame the scale:
- 24,008 unique secrets were exposed in MCP configuration files in 2025 alone, the protocol's first year of widespread adoption, according to the State of Secrets Sprawl 2026.
- Internal repositories are 6x more likely to contain secrets than public ones (32.2% vs 5.6%), contradicting the assumption that private repos are safe, according to the State of Secrets Sprawl 2026.
A question worth separating out:
Q: Who is accountable for scoping MCP access across public and private repositories?
A: The platform and identity owners together. The application team controls what the agent reads and writes, while the identity team controls which repositories the credential can reach. If either side treats the token as a generic developer credential, the boundary fails. Accountability has to sit with the team that can actually narrow the session to one trust zone.
👉 Read our full editorial: GitHub MCP token scope, not a patch, defines the real risk