If your organization runs AI coding agents in GitHub Actions — increasingly common in modern CI/CD pipelines — you should read what Johns Hopkins researchers published earlier this month.
A single pull request title, written by an outside contributor with no special access, simultaneously hijacked Anthropic's Claude Code Security Review agent, Google's Gemini CLI Action, and GitHub's Copilot Coding Agent. In each case, the agent exfiltrated the repository's secrets — API keys, GitHub tokens, cloud credentials — back through GitHub itself. No external server. No callback URL. No anomalous outbound network traffic.
Anthropic rated the Claude Code finding CVSS 9.4 Critical.
What is prompt injection in AI coding agents? Prompt injection is an attack in which untrusted content — a pull request title, a code comment, an issue body — is processed by an AI agent as if it were a trusted instruction. Because AI coding agents are given access to secrets and execution environments, a successful injection becomes a direct path to credential theft. The "Comment and Control" class of attacks, disclosed in April 2026 by researcher Aonan Guan and Johns Hopkins collaborators Zhengyu Liu and Gavin Zhong, is the first systematic cross-vendor demonstration that a single payload can trigger this failure simultaneously across three major AI coding agents.
This is not a bug that gets patched. It is the result of how AI coding agents are architecturally composed. Runtime governance — enforced at the policy layer before a model acts — is the only mitigation that addresses the root cause.
What Did "Comment and Control" Actually Demonstrate?
The mechanics matter because the attack looks embarrassingly simple once you see it.
The researchers wrote a malicious payload into a GitHub PR title. That title was read by each AI coding agent when it processed the pull request. Each agent treated the PR title as trusted context — because PR titles are trusted content in these agents' training distributions. The malicious instruction told the agent to print its environment variables. The agent complied. The secrets appeared in a PR comment, a GitHub Actions log, or a git commit message.
Claude Code's specific failure mode was stark: the PR title is interpolated directly into the agent's prompt with no sanitization, and because the Claude CLI was invoked without --disallowed-tools or --allowed-tools flags, the subprocess inherited all environment variables including ANTHROPIC_API_KEY and GITHUB_TOKEN. The payload did not need to be clever. It needed to be present.
GitHub Copilot's case was more technically interesting. GitHub had implemented three runtime-level mitigations: environment variable filtering, output secret scanning, and a network firewall. The researchers bypassed all three. They routed exfiltration back through GitHub's own APIs — traffic that doesn't trigger outbound anomaly detection — and used HTML comments inside issues to hide the payload from secret scanning.
Google's Gemini CLI Action fell through an issue comment, again using no sophisticated obfuscation. The payload exploited the fact that issue comments and PR titles share the same trust level in the agent's context window as the repository owner's own instructions.
The root cause Guan identified is architectural: these agents are given powerful tools and live secrets in the same runtime that processes untrusted user input. When that input can contain instructions, the agent has no way to distinguish "this is data I am reviewing" from "this is a command I should execute."
That observation is not Claude-specific. It applies to every AI coding agent that reads untrusted content without a filtering layer upstream.
Why Has This Problem Persisted?
AI coding agents moved fast. Claude Code reached widespread enterprise adoption within a year of its May 2025 general availability. Gemini CLI followed. GitHub Copilot's agentic features are available to GitHub Team and Enterprise plan subscribers, enabled by administrator policy. The security review of these tools has not kept pace with deployment velocity.
The observability vendors — LangSmith, Arize, Helicone, Braintrust — can tell you what the agent did after the fact. None of them intercept an input before the model processes it. They log, trace, and visualize. If an agent read a malicious PR title and exfiltrated your API keys at 2:14 AM, your LangSmith dashboard will have a very detailed trace of exactly what happened. The secrets will still be gone.
This is the gap between observability and governance that makes post-incident forensics useful but insufficient. For AI coding agents with write access to secrets and CI/CD pipelines, logging is not a security control. It is a forensics tool.
The scale of the exposure is not theoretical. GitGuardian's 2026 State of Secrets Sprawl report found over 24,000 unique secrets exposed in MCP configuration files on public GitHub repositories, including more than 2,100 confirmed valid credentials. AI coding agents do not just create new attack surfaces. They create new attack surfaces while holding the credentials that unlock your infrastructure.
What a Policy-Layer Defense Actually Looks Like
The researchers' conclusion was direct: the mitigations vendors deployed — environment variable filtering, output secret scanning, network firewalls — are bypassed because they operate on symptoms. The structural problem is that untrusted input reaches the model's instruction context before any enforcement happens. Fixing symptoms downstream of that architectural failure does not close the vulnerability class.
A governance layer operating at the input boundary enforces policy before the model sees the content. For a CI/CD deployment, this means four specific controls:
Input validation at ingestion. PR titles, issue bodies, and review comments are evaluated against injection pattern signatures before being interpolated into agent prompts. Inputs matching known injection patterns are blocked pre-execution. The model never sees the payload.
Tool restriction enforcement. The agent's available tool surface is defined by policy, not by whatever flags the CI/CD YAML passes at invocation. An agent authorized for code review cannot invoke shell commands that enumerate environment variables, regardless of what its prompt contains. Policy-enforced tool boundaries applied before model execution are the specific control that would have prevented the credential exfiltration in all three Comment and Control cases.
Secrets isolation. Runtime environment variables are not available to the model's context window unless explicitly permitted by policy. The model can invoke tools that use credentials as internal parameters; it cannot print or transmit them as text. This is a runtime enforcement decision, not a flag passed at startup.
Audit trail for blocked attempts. When a PR title attempts injection, that attempt is logged with full context — the input, the policy rule triggered, the agent that was targeted. This is not useful for the attack that succeeds. It is essential for detecting reconnaissance patterns and adversarial contributors who are probing agent behavior before a more targeted attack.
None of these controls require trusting the underlying model to recognize adversarial inputs. Claude 3.7, Gemini 2.5, and GPT-4o all have limitations in detecting sophisticated injection payloads. Pre-execution policy enforcement does not ask the model to detect the attack. It evaluates the input independently, at the layer where it enters the system.
The System Card Problem
One detail from the VentureBeat coverage deserves attention: one of the three affected vendors had already documented this failure class in their published system card. The safety documentation acknowledged that the agent could be manipulated by adversarial inputs in the context window, that access to secrets created exfiltration risk, and that prompt injection from untrusted sources was a known concern.
The system card acknowledged the problem. The deployment shipped without enforcement that prevented it.
There is a category of AI risk that gets documented, accepted, and shipped around. Knowing that your coding agent is vulnerable to prompt injection from PR titles is not the same as mitigating it. The mitigation requires enforcement at the layer where the input is processed — not acknowledgment in a safety document, and not a downstream trace that explains what happened after the fact.
The researchers filed coordinated disclosures with all three vendors. Anthropic classified it CVSS 9.4 Critical (awarding a $100 bug bounty); Google paid $1,337; GitHub paid $500 through the Copilot Bounty Program. Patches and mitigations have been issued. The underlying architectural condition — untrusted content processed in the same context as trusted instructions — remains a deployment-level concern for every team running these agents without a governance layer in front of them.
FAQ: AI Coding Agent Prompt Injection and CI/CD Security
What is a "Comment and Control" prompt injection attack?
Comment and Control is a class of prompt injection attacks in which a malicious payload is written into a GitHub pull request title, issue body, or comment. When an AI coding agent processes that content, it treats the attacker's instructions as trusted and executes them — typically exfiltrating API keys and access tokens back through GitHub itself, using GitHub's own APIs as the exfiltration channel.
Which AI coding agents were confirmed vulnerable?
The April 2026 disclosure confirmed vulnerabilities in Anthropic's Claude Code Security Review agent (CVSS 9.4 Critical), Google's Gemini CLI Action, and GitHub's Copilot Coding Agent. All three shared the root cause: untrusted GitHub content was processed as trusted instruction context without pre-execution filtering.
Can these vulnerabilities be patched?
Each vendor issued mitigations and paid bug bounties. However, the researchers note that the root cause is architectural: any agent that processes untrusted content in the same context as its operating instructions remains susceptible to prompt injection regardless of output filtering or network-level controls. Preventing this class of attack requires input-level enforcement before the model processes the content.
What's the difference between observability and governance for this risk?
Observability tools — LangSmith, Arize, Helicone, and similar platforms — log what the agent did after the fact. They do not intercept or evaluate inputs before model execution. Governance enforcement operates pre-execution, evaluating each input against configured policies and blocking or sanitizing it before the model processes it. For prompt injection targeting secrets, only pre-execution enforcement prevents credential theft. Post-execution logging explains what was stolen.
How does Waxell's Content Policy address this?
Waxell's Content Policy evaluates inputs at the point they enter the agent's context window, before model execution. PR titles, issue bodies, and other untrusted inputs are evaluated against configured injection signatures and blocked if they match. Control Policy enforces the agent's permitted tool surface independently of invocation flags, so a code review agent cannot execute shell commands regardless of what its prompt instructs. These controls operate independently of the underlying model — they apply equally to Claude, Gemini, and Copilot-backed agents.
What should engineers do immediately?
Audit your GitHub Actions workflows for AI coding agent configurations that run without explicit --allowed-tools or --disallowed-tools restrictions. Confirm that CI/CD secrets are not exposed as environment variables in the runner context where the agent operates. If your team is using Claude Code, Gemini CLI Actions, or Copilot agents on repositories with external contributors, treat untrusted inputs from those contributors as adversarial until a pre-execution filtering layer is in place.
Sources
- Comment and Control: Prompt Injection to Credential Theft in Claude Code, Gemini CLI, and GitHub Copilot Agent — Aonan Guan / Johns Hopkins
- Claude Code, Gemini CLI, GitHub Copilot Agents Vulnerable to Prompt Injection via Comments — SecurityWeek
- Three AI coding agents leaked secrets through a single prompt injection — VentureBeat
- Claude Code, Gemini CLI, and GitHub Copilot Vulnerable to Prompt Injection via GitHub Comments — CybersecurityNews
- GitHub comments can hijack Claude Code, Gemini CLI, and Copilot to steal CI secrets — VPNCentral
- Even the Best AI Agents Leak Secrets. Prompt Injection Is Why. — Security Boulevard
- GitGuardian 2026 State of Secrets Sprawl — 24,000+ unique secrets in MCP config files on public GitHub, 2,100+ confirmed valid credentials
Top comments (0)