A public GitHub issue made an AI agent leak a private repo. We recreated it and held the public post.
Run agents? ACP lets you see, control, and price every tool call they make — allow/ask/deny policy, per-session cost, and a full audit log for Claude Code, Cursor, Codex, and OpenClaw, in one command:
curl -sf https://agenticcontrolplane.com/install.sh | bash
irm https://agenticcontrolplane.com/install.ps1 | iex
Getting started → · see your first governed call → · free up to 5 agents
In May 2025, Invariant Labs showed that a malicious issue in a public repository could hijack a developer’s AI assistant. The assistant was connected through the GitHub MCP server. It read the issue, followed the instructions hidden inside, pulled contents from the developer’s private repositories, and posted them where the attacker could read them. The developer only let the agent triage an issue.
The problem is scope. The agent held one token that could read public and private repos. A single session moved data from the private side to the public side. The MCP server did what it was asked. Nothing checked that a session started by untrusted public content shouldn’t read private files and publish them.
Both damaging steps are tool calls, so both can be checked: the private read and the public post. We rebuilt the mechanism in a sandbox and ran a governed copy. The step we captured live is the public post.
Two tool calls do the damage
- The cross-scope read. The agent reads a private repo it has no reason to touch while triaging a public issue.
- The public post. The agent writes private content into a public thread. That is the exfiltration channel.
The untrusted issue starts it. The read and the post are the actions you can stop.
What we recreated
An isolated sandbox with three parts:
- A mock public repo with a poisoned issue. The instruction is defanged: it shows intent, not a working payload.
- A mock private repo with clearly fake sensitive data.
- An agent whose token reads both and can post publicly.
Ungoverned, the sandbox agent reproduces the leak. It reads the issue, pulls the fake private data, and posts it into the public thread. Every step is an allowed GitHub operation. The sequence is the problem.
The governed run: the public post waits for a human
Same agent, same broad token, same poisoned issue. This time the outbound call goes through ACP before it can publish. The agent’s call is the incident’s exact move:
gh issue comment acme/public-site --body "$(cat private_salaries.csv)"
In our workspace, any gh call from an unattended (background) agent is held for approval. That is a rule we already had, not one written for the demo. In the console it lives under Policies → Agents → background → Bash.gh. An unattended session can’t answer a prompt, so the call is blocked and the request goes to the Approvals page and the approval email. Nothing posted. The private data stayed private.
recreated-githubmcp) issued the public post. ACP classified it Bash.gh from an autonomous, unsupervised agent and held it for approval. The header says it: nothing here has executed. A person sees what was attempted and picks Approve or Deny. Captured from acp-ops; the repo and data are synthetic.The check sits in the hook on the call path, so the agent can’t talk its way past it. If you approve, the identical command can be re-run. A changed command is a new request. And if the agent had used a GitHub MCP tool to post instead of gh, it would be a different tool name, so you’d want a rule on that tool too.
The other fix: take the private read away
Holding the post is the step we can show firing today. The stronger setup also removes the first link, so the private data never loads.
- Scope the token. A triage agent doesn’t need a token that spans private repos. A fine-grained GitHub token limited to the one public repo makes the cross-scope read fail. That fix is on GitHub’s side, not ours.
- Gate the read the same way. ACP applies per-tool rules to any tool call it sees, including an MCP tool call or
gh. Set the read tool to ask or never for unattended agents, and the private read is behind a check too.
Either link breaks the chain. Labeling every private repo perfectly is hard, so it helps to have the outbound post covered as well.
What ACP does and doesn’t do here
- It doesn’t detect the malicious issue. The injection hides in free text. ACP checks the agent’s actions, not its input.
- It doesn’t narrow your GitHub token. That is your job, and it is the right structural fix.
- It holds the outbound action for a person. At the unattended tier the public post doesn’t publish on its own. A human sees exactly what was attempted. Deny it, and the data can’t leave through that call.
- It is a hook on the machine. It only sees calls from agents you’ve connected it to.
The assistant in the original demo wasn’t compromised. It read a public issue and used a real MCP server with a real token. The leak happened in the gap between “can read private repos” and “is posting to a public thread.”
Try it on your setup
If your coding agent uses a token that spans public and private repos, and it triages public issues or PRs, that path is open unless something closes it. Point an agent at a mock private repo and a public post channel and see whether either call gets stopped. Getting started has the install.
Source: UpGuard, Six MCP Security Incidents (Invariant Labs research).
- 1. An AI Agent Deleted a Production Database in 9 Seconds. We Rebuilt It in a Sandbox and Stopped It.
- 2. Replit AI agent deleted production database (July 2025)
- 3. Amazon Q extension wipe incident: we recreated the poisoned pull request, and the cloud delete that was denied
- 4. Supabase, Cursor and the lethal trifecta: a support ticket leaked the tokens table, and the outbound call we held
- 5. A public GitHub issue made an AI agent leak a private repo. We recreated it and held the public post. · you are here