Skip to content
العربية Book a call

· 4 min read

Prompt injection in the wild: how AI coding agents leaked their own secrets in 2026

In 2026 a single pull request title tricked AI coding agents from Anthropic, Google and GitHub into leaking credentials. What happened, and how to secure agents in your pipeline.

AI security
Explainer · 25 secondsOne PR title, three AI agents, leaked keys: the attack and the defence
Video transcript

AI security · 2026
One PR title. Three AI agents. Leaked keys.

The Comment and Control attack
Malicious PR title (Anyone can write it) → AI agent in CI (Claude Code, Gemini CLI, Copilot) → Reads it as instructions (Data and commands blur) → Posts its API key (As a public comment) [CVSS 9.4]
Source: VentureBeat, Cloud Security Alliance. All three vendors patched.

The same agent, defended
Untrusted input (Marked as data) → Least-privilege token (Read-only by default) → Human approval (Before post, publish or send) → Attack contained (Nothing to leak) [Blocked]

Prompt injection went operational in 2026
+32%: web pages carrying malicious prompt injection (Nov 2025 – Feb 2026).
3: vendors’ coding agents hit by one technique.
0: CVEs issued for those fixes.
Source: Google Security Blog via CSA; VentureBeat

We build AI agents, secure them, and keep them running.
aaminai.ae/insights

For two years, prompt injection was mostly a conference-talk risk: clever demos, few real victims. In 2026 that changed. Agents went into production with real credentials, and attackers and researchers found that the easiest way to steal those credentials was to ask nicely, in text the agent would read.

The clearest examples come from AI coding agents. They’re worth understanding even if you never write code, because the same pattern applies to any agent that reads outside content and can act on it.

3

vendors' coding agents leaked secrets

9.4

CVSS for Anthropic's issue

+32%

web pages carrying prompt injection

Comment and Control: one PR title, three vendors

In April 2026, researcher Aonan Guan, with Zhengyu Liu and Gavin Zhong, disclosed an attack they called Comment and Control (VentureBeat). They targeted three AI agents that run inside GitHub Actions to review or work on code:

  • Anthropic’s Claude Code Security Review action
  • Google’s Gemini CLI action
  • GitHub Copilot’s coding agent

The attack needed no hacking in the usual sense. Text placed in a pull request title, issue or comment told the agent to reveal secrets from its environment. In Anthropic’s case, the agent posted its own API key as a comment on the pull request, where the attacker could read it through GitHub’s API. No external server was needed.

All three vendors patched. Anthropic rated its issue CVSS 9.4 critical and updated its documentation to say the action is designed for trusted inputs; Google and GitHub also paid bounties (VentureBeat). None of the fixes got a CVE, so teams relying on CVE feeds to track risk would never have seen them.

It wasn’t a one-off

Other incidents this year followed the same pattern:

  • Clinejection (February 2026): a prompt injection in a GitHub issue title, aimed at a Claude-powered triage bot and combined with cache poisoning, led to a malicious release of the Cline package on npm, according to Snyk’s analysis summarised by the Cloud Security Alliance and others.
  • GrafanaGhost (April 2026): researchers at Noma Security showed that crafted entries in Grafana logs were read as instructions by Grafana’s AI assistant when it summarised them. Data was then exfiltrated through a rendered Markdown image whose URL slipped past validation (CSA).
  • Payloads on the open web: Google’s security team reported that the share of crawled pages carrying malicious prompt injection rose 32% between November 2025 and February 2026, and Forcepoint documented live payloads attempting payment transfers, API key theft and file deletion (CSA).

The pattern behind every incident

Each case combines three things:

  1. Untrusted input. A PR title, a log line, a web page, an email. Anyone can write it.
  2. An agent that treats text as instructions. Current models cannot reliably separate the data they are reading from the commands they should follow.
  3. Real privileges. API keys, repository tokens, the ability to post, publish or send.

Remove any one of the three and the attack fails. That is where defence should focus, because the second one, the model’s gullibility, is the one you can’t fully fix.

What to do

For engineering teams running agents in CI/CD:

  • Don’t run agents that hold secrets on input from untrusted contributors. Be especially careful with GitHub workflows triggered by pull_request_target, which expose secrets to fork pull requests.
  • Give each agent the narrowest token possible: read-only where it only reviews, no publish rights unless a human approves.
  • Pin and review agent actions and versions like any other dependency.
  • Log every tool call an agent makes, and alert on agents posting secrets or calling unexpected endpoints.

For any company deploying agents:

  • Inventory where each agent reads text from, and treat all of it as hostile. That includes customer emails, uploaded PDFs, supplier portals and other agents’ output.
  • Put human approval in front of high-impact actions: payments, external emails, data exports, publishing.
  • Block the quiet exfiltration channels: rendered images and links to arbitrary domains, outbound webhooks, open email recipients.
  • Test in Arabic as well as English. Filters tuned on English often miss instructions written in Gulf dialect or mixed scripts.

Our guide to security-testing AI agents with OWASP and MITRE ATLAS sets out a full test method.

A prompt injection blocked in production · Example data

The Gulf angle

Gulf organisations are adopting agents quickly, with the UAE targeting half of federal government services on agentic AI within about two years. In July 2026 the UAE Cyber Security Council published a National Cyber Security Policy for AI, and regulators from the CBUAE to the QCB expect AI risks to be governed and tested. An agent that can be talked into leaking its credentials is precisely the risk those frameworks are meant to catch, and it’s far cheaper to find in a test than in an incident report.

How Aamin AI helps

Our founders build AI agents and break them. Our AI security assessment tests agents and LLM applications for direct and indirect prompt injection, tool misuse and data exfiltration, alongside conventional penetration testing of the systems around them. If you’re building agents, we can design these controls in from day one through our AI agents work. Get in touch to scope a test.

This article is general information, not legal or tax advice. Gulf rules change quickly; check the current text or ask a local adviser before acting.

FAQ

Questions this article answers

Comment and Control was research published in April 2026 by Aonan Guan and colleagues. It showed that text placed in a pull request or issue could instruct AI agents running in GitHub Actions, including Anthropic's Claude Code Security Review action, Google's Gemini CLI action and GitHub Copilot's agent, to expose secrets. In Anthropic's case the agent posted its own API key as a comment. All three vendors patched the issues and paid bug bounties.

Indirect prompt injection is when instructions reach an AI agent through content it reads, such as a web page, email, document, log entry or code comment, instead of from the user. The agent cannot reliably tell data from instructions, so it may follow them using its own permissions.

They can be, if they are treated as untrusted code with access to secrets. Do not run agents with secrets on input from untrusted contributors, restrict the tokens they hold to the minimum, separate read and write permissions, and require human approval before an agent publishes, merges or deploys anything.

The same pattern applies to any agent that reads outside content and can act: an email assistant, a claims agent reading PDFs, a customer service bot browsing the web or a log-summarising assistant. The coding agent incidents are simply the best-documented examples.

Map every source of text the agent reads and every tool and credential it holds, then plant instructions in those sources and see what the agent does. A good test covers direct and indirect injection, exfiltration channels such as links, comments and outbound messages, and tool misuse, and maps findings to the OWASP LLM and Agentic Top 10.

How we can help

Related reading

More insights

All insights

Contact

Let's have a call about your AI plans

Thirty minutes with the people who would do the work. Tell us what you want AI to do and what data it touches. We'll tell you what's realistic, what it would take, and how to keep it secure.

or write to us at [email protected]