Join our Newsletter — 33% off our NHI Course

Why did prompt metadata steer Claude Code, Gemini CLI and Copilot?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20225
Topic starter  

TL;DR: Pull request metadata became a secret-exfiltration path across Claude Code, Gemini CLI, and GitHub Copilot Agent, with Repello AI documenting the Comment and Control class and no CVEs assigned. Agent runtimes need tighter identity and tool scoping when repository text can steer privileged actions.

Editorial analysis by NHI Mgmt Group, based on content published by Repello AI: “Comment and Control: How One Prompt Injection Hit Claude Code, Gemini CLI, and Copilot Agent”.

Key questions

Q: Why do prompt-injection attacks on CI agents lead to credential theft?

A: They work because the agent often runs with workflow tokens and environment access that exceed what a reviewer actually needs.

Q: How do security teams know whether an AI coding agent is too permissive?

A: Look at what the agent actually tries to do, not what the prompt says it should do.

Q: What breaks when AI coding agents trust pull request metadata as input?

A: The trust boundary breaks first, then the agent’s tool use becomes attacker-directed.

Practitioner guidance

  • Harden PR metadata handling Strip or neutralise HTML comments, delimiter-like markers, and other hidden markup before pull request text reaches an agent context window.
  • Separate agent context from user content Keep system instructions, repository text, and reviewer guidance in distinct layers so attacker-controlled PR fields cannot masquerade as trusted prompts.
  • Reduce token exposure in CI Remove write-capable tokens, environment secrets, and broad repository scopes from agent workflows that only need review or summarisation privileges.

Bottom line: The central problem is not just prompt injection, but the collapse of trust boundaries between repository text and privileged agent instructions.

Glossary terms: Prompt Injection (Agentic), Context Trust Boundary, Non-Human Identity (NHI), Agent Runtime

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 1 week ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 6 months ago
Posts: 20715
 

Comment and Control is a workflow trust failure, not a model failure. The important control gap is the assumption that pull request metadata can be ingested into an agent context window without strict segregation. Once a CI agent is allowed to interpret attacker-controlled text as both data and instruction, traditional code review boundaries collapse. Practitioners should treat repository text as hostile input wherever an agent has tools or secrets.

A few things that frame the scale:

  • Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.
  • Companies are dedicating an average of 32.4% of their security budgets to secrets management and code security, with US organisations leading at 40.8%, according to the State of Secrets in AppSec.

A question worth separating out:

Q: Should organisations treat AI coding agents like privileged software identities?

A: Yes. If an AI agent can install code, access secrets, or modify repositories, it is functionally acting as a privileged non-human identity and should be governed that way. That means task-scoped access, explicit boundaries, and monitoring of its downstream actions, especially when it can touch build and release systems.

👉 Read our full editorial: Comment and Control exposes a CI trust gap in AI coding agents


This post was modified 1 week ago by NHI Mgmt Group

   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.