Dev.to AI ๐Ÿค– Ai ๐Ÿ‘ 2 ๐Ÿ“– 4 min read

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

Originally published on the Aamin AI blog. 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

Originally published on the Aamin AI blog.

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.

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.

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.

The full article, with an FAQ, is on aaminai.ae.

๐Ÿ“ฐ Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.