Skip to content

Accident reports · April 2026

Claude Code, Gemini CLI and Copilot: a booby-trapped GitHub comment made them publish their keys

According to researcher Aonan Guan, a booby-trapped pull request title or issue got API keys and tokens out of three coding agents. Bounties paid, no public advisory.

  • Company Anthropic / Google / GitHub
  • Agent Claude Code Security Review / Gemini CLI Action / Copilot
  • Model not published
Outside content
Blank sticky notes lined up on a wall, a hand adding one more
Photo: Kelly Sikkema on Unsplash
WhenReported from October 2025, published on 15 April 2026
WhoThree coding agents running in GitHub: Claude Code Security Review (Anthropic), Gemini CLI Action (Google) and the Copilot agent (GitHub), tested by researcher Aonan Guan
What the agent didIn the demonstration, a booby-trapped pull request title, issue or comment made them run commands and publish their own keys and tokens
ConsequenceNo real-world attack known; three bounties paid ($100, $1,337 and $500), no public advisory and no CVE

What happened

This is a researchers' demonstration, not an observed attack. Aonan Guan, a security researcher, with Zhengyu Liu and Gavin Zhong of Johns Hopkins University, called the method "Comment and Control". The idea: on GitHub, anyone can write a pull request title, an issue or a comment. And AI agents read those texts to do their job, with powerful tools and secrets within reach.

At Anthropic, a booby-trapped pull request title made Claude Code Security Review run commands. The credentials came out in the agent's report or in the GitHub Actions log. According to The Next Web, they included the Anthropic API key and GitHub tokens. At Google, a fake "trusted" section added to an issue made Gemini CLI Action post its own API key as a comment. At GitHub, the instruction was hidden in an HTML comment, invisible on screen but read by the agent: when a developer assigned the issue to Copilot, the agent looked for secrets and got them out despite the network firewall.

For Claude and Gemini, everything ran on its own, through GitHub's automations. For Copilot, the victim had to assign the issue to the agent. All three vendors confirmed. According to SecurityWeek and the Cloud Security Alliance, Anthropic paid $100 (reported in October 2025, bounty in November), Google $1,337 and GitHub $500. Anthropic updated a section of its documentation and blocked one tool; Google added caution instructions; GitHub calls it a known limitation of its architecture. None published an advisory or got a CVE.

Why it happened

All three agents mixed three things on the same machine: texts written by anyone, tools able to run commands and publish, and secrets. For Aonan Guan, the injection is not a bug: it is context the agent is designed to process. As long as the tools and secrets stay there, a new wording can get through again.

The fixes point the same way: according to the researcher, blocking one tool or adding an instruction does not change what the agent can do.

The failure family

In our catalogue, this is the "Outside content" family: a text written by a stranger takes over what the agent does. With the "The leak" family at the end: the keys go public.

The safeguard in code

  • An agent that reads public texts (issues, comments, pull requests) runs with no production secret and no right to publish.
  • The secrets it needs are given for a single task, with as few rights as possible, then taken back.
  • Everything the agent publishes goes through a filter that blocks keys, tokens and passwords.

What we test

The "planted instruction", "hidden instruction" and "camouflaged planted instruction" tests slip an order into content the agent reads for its work, and the "data leak" test looks at where the information goes. The exact case of an issue-triage agent reading a hidden comment that asks for its token is already on our list of tests to add. What a company can lock down today: do not run these agents on texts from people outside the project, and take the secrets out of their environment.

And your agent, what would it do?

The crash test puts your agent in these situations, dozens of times, on several models. You get the figures, the conversations where it gave in, and the fix plan.

Crash-test my agent See the live demo

Further reading