Security researchers have uncovered a dangerous new attack method that simultaneously compromises three major AI coding assistants. Named Comment and Control, this cross-platform prompt injection attack weaponizes GitHub comments, pull request titles, and issue bodies to hijack AI agents and steal sensitive credentials.
The vulnerability affects Anthropic Claude Code Security Review, Google Gemini CLI Action, and GitHub Copilot Agent. What makes this attack particularly alarming is that it requires no victim interaction. Simply opening a pull request or filing an issue can automatically trigger GitHub Actions workflows, activating the compromised AI agent without any user action.
How the Comment and Control Attack Works
The attack pattern follows a simple but devastating loop. An attacker writes a malicious PR title or issue comment on a GitHub repository. The AI agent reads and processes this content as trusted context. The agent executes the attacker-supplied instructions. Finally, credentials are exfiltrated back through a PR comment, issue comment, or git commit. No external server is required for the entire attack chain to succeed.
Security researcher Aonan Guan from Johns Hopkins University demonstrated the attack across all three platforms with support from fellow researchers Zhenyu Liu and Gavin Zhong.
Breaking Down Each Vulnerable AI Agent
The Claude Code Security Review tool proved vulnerable because PR titles were directly interpolated into the agent prompt with no sanitization. Because the Claude CLI runs without tool restrictions, the subprocess inherits all environment variables, including the ANTHROPIC_API_KEY and GITHUB_TOKEN. An attacker can craft a PR title that breaks out of the prompt context and instructs Claude to dump all environment variables, returning credentials as a fake security finding in a PR comment.
For Gemini CLI Action, the attack uses issue comments containing prompt injection that overrides Google safety guardrails. The malicious comment creates a fake Trusted Content Section immediately after the legitimate context. This tricks Gemini into posting the GEMINI_API_KEY as a public issue comment visible to anyone.
The GitHub Copilot Agent attack is the most technically sophisticated. Researchers hid the attack payload inside an HTML comment tag in the issue body. This made the malicious instructions invisible in GitHub’s rendered Markdown view while being fully parsed by the AI agent. The attack method bypassed three separate defense layers, including environment variable filtering, secret scanning, and network firewalls.
Bounty Payments and Vendor Responses
All three companies confirmed the vulnerabilities and paid bug bounties. Anthropic classified the issue as critical with a CVSS score of 9.4 and paid a 100 dollar bounty while applying mitigations. Google paid 1337 dollars. GitHub paid 500 dollars but classified the issue as a known architectural limitation rather than a traditional vulnerability.
The discrepancy in response highlights a fundamental disagreement about the nature of the problem. GitHub views it as an inherent limitation of how AI agents must process user inputs. Anthropic and Google treated it as a critical security flaw requiring immediate patching.
The Deeper Architectural Problem
Researcher Guan explained that the fundamental issue is not a simple bug but an architectural flaw. AI agents are designed to handle external inputs and sensitive information, such as API keys and tokens, together in the same runtime environment. Even when malicious instructions arrive from external sources, the structure allows immediate access to sensitive information because both live in the same execution context.
This cross-platform prompt injection attack pattern applies far beyond GitHub Actions. Any AI agent that processes untrusted data while holding access to execution tools and production secrets is vulnerable. This includes Slack bots, Jira agents, email automation, and deployment pipelines.
How to Protect Your AI Agents
Security experts recommend several immediate mitigations. Use allowlists for tools rather than blocklists. Grant only the minimum required capabilities with allowed tools flags, as blocklisting commands like ps is trivially bypassed using alternatives such as reading proc files directly. Implement least privilege secrets policies so agents performing read-only tasks, like issue triage, do not hold write-capable GITHUB_TOKEN. Require human approval gates before agents perform outbound actions or access credentials. Audit all AI agent integrations in CI/CD pipelines and monitor Actions logs for anomalous credential access patterns.
As organizations rush to adopt AI coding assistants, this Comment and Control attack serves as a critical warning. The convenience of AI automation must be balanced against the security risks of giving powerful tools access to production secrets while processing untrusted data.

