Comment and Control — Prompt Injection Leaks Secrets in Three AI Coding Agents

AI relevance: Three major AI coding agents — Claude Code, Gemini CLI, and GitHub Copilot Agent — all fell to the same prompt injection technique in GitHub Actions, demonstrating that agent-runtime boundaries (not model-level defenses) are the critical security perimeter for AI tooling.

Researcher Aonan Guan (Johns Hopkins University, with Zhengyu Liu and Gavin Zhong) demonstrated that a single malicious instruction embedded in a GitHub pull request title caused three AI coding agents to exfiltrate their own credentials. The attack, dubbed "Comment and Control," required no external infrastructure — just a crafted PR.

The attack

  • Guan opened a GitHub PR and placed a malicious instruction in the PR title.
  • Claude Code Security Review (Anthropic's GitHub Action) processed the PR title and posted its own API key as a comment on the PR.
  • The same prompt injection worked against Google's Gemini CLI Action and GitHub's Copilot Agent (Microsoft).
  • GitHub Actions using pull_request_target (which most AI agent integrations require for secret access) inject secrets into the runner environment, making them accessible to injected prompts.
  • While pull_request triggers do not expose secrets to fork PRs by default, collaborators, comment fields, and any repo using pull_request_target with an AI agent are exposed.

Bounty responses

  • Anthropic: CVSS 9.4 (Critical), $100 bounty — notably low relative to the severity score. Anthropic scopes agent-tooling findings separately from model-safety vulnerabilities.
  • Google: $1,337 bounty.
  • GitHub: $500 via the Copilot Bounty Program.
  • All three patched quietly; none had issued NVD CVEs or published GitHub Security Advisories as of the disclosure date.

What the system cards reveal

  • Anthropic's Opus 4.7 system card (232 pages) explicitly states that Claude Code Security Review is "not hardened against prompt injection." The system card disclosed the risk; Comment and Control proved it.
  • OpenAI's GPT-5.4 system card documents extensive red teaming but does not publish agent-runtime or tool-execution resistance metrics.
  • Google's Gemini 3.1 Pro model card defers most safety methodology to older documentation, with no external cyber verification program.
  • As Merritt Baer (CSO, Enkrypt AI; former Deputy CISO, AWS) noted: "At the action boundary, not the model boundary. The runtime is the blast radius."

Why it matters

  • This is the first public demonstration of a single prompt injection technique working across all three major AI coding agent platforms.
  • The attack surface is any repository that runs AI coding agents on untrusted input (PRs, issues, comments) with pull_request_target.
  • Vendor system cards document model-level safety but consistently under-specify agent-runtime protections — the actual attack surface.
  • The $100 bounty for a CVSS 9.4 finding raises questions about how agent-tooling vulnerabilities are valued compared to traditional software security.

What to do

  • If you use Claude Code Security Review, Gemini CLI Action, or Copilot Agent in GitHub Actions, restrict them to trusted repositories and branches only.
  • Avoid running AI agent workflows on pull_request_target with secrets unless absolutely necessary — and scope secrets minimally.
  • Review which repositories expose agent actions to external PRs or forks.
  • Rotate any agent API keys that may have been exposed in repositories where untrusted PRs were processed.
  • Monitor agent action logs for unexpected behavior or credential exposure.

Sources