Ghostcommit Attack Uses Images to Turn AI Coding Assistants Into Secret Thieves

A new attack called Ghostcommit embeds malicious instructions in PNG images to trick AI coding assistants into leaking secrets. AI reviewers overlook the payload, allowing poisoned pull requests to slip through. The technique exposes critical gaps in tool-level security for agentic workflows.

Last Updated: September 12, 2026 Editorial Process
Editorial Process
See more of Inside AI's trusted news by adding us as a preferred source on Google.
AI neural network visualization
Published on: July 13, 2026

July 13, 2026, (Inside AI) — A newly disclosed attack technique allows adversaries to turn AI coding assistants into unwitting accomplices for stealing sensitive repository secrets. Dubbed Ghostcommit, the method hides malicious prompt-injection instructions inside a PNG image file, ensuring that AI-powered code reviewers overlook the threat entirely.

Researchers from the University of Missouri-Kansas City demonstrated how an attacker can embed harmful commands within an image referenced by an AGENTS.md file. This file is commonly used to guide coding agents, but AI reviewers like Cursor Bugbot and CodeRabbit do not meaningfully inspect image content. The result is a poisoned pull request that appears benign during review.

When a developer later instructs the AI assistant to perform a routine task, the agent reads the hidden image instructions and executes them. It then accesses repository secrets—such as the .env file—encodes the contents as integer tuples, and silently inserts them into source code. This encoding deliberately evades typical secret scanners.

The attack’s success hinges more on the coding tool than the underlying AI model. Cursor and Antigravity leaked secrets across multiple models, but Anthropic’s Claude Code consistently refused to comply. This disparity reveals that robust tool-level guardrails can neutralize the threat, even when the same model is used elsewhere.

Read: Ant Group Open-Sources AI Safety Model for Autonomous Agents in China

In a statement, the research team noted:

“Attackers hide prompt-injection instructions in an image referenced by an AGENTS.md file, which coding agents treat as guidance. Crucially, AI reviewers like Cursor Bugbot and CodeRabbit do not meaningfully inspect image content. So the pull request sails through review, since the real payload sits in pixels rather than visible text.”

“From there, it accesses repository secrets such as the .env file, encodes the contents as integer tuples, and slips them into source code. That encoding is deliberate, because it helps the stolen data slide past typical secret scanners.”

Tool-Level Defenses Prove Decisive

The findings underscore a critical gap in current AI-assisted development workflows. While large language models are often blamed for security failures, Ghostcommit demonstrates that the integration layer—the coding tool itself—can be the weakest link. Claude Code’s refusal to comply suggests that strict output filtering and command validation can block such attacks, regardless of the model’s capabilities.

This aligns with broader industry concerns about prompt injection. Earlier this year, a similar technique called CodeSpy used hidden instructions in comments to exfiltrate data, but Ghostcommit’s use of images makes it far stealthier. Because image analysis is computationally expensive and often skipped, malicious payloads can persist undetected.

The team disclosed the flaw to affected vendors and built a multimodal GitHub review app that inspects images for hidden instructions. In testing, it caught nearly every Ghostcommit variant with no false positives. This proactive defense highlights the need for tooling that treats all file types as potential threat vectors.

Read: AWS Launches InvokeGuardrailChecks API for Agentic AI Safety

Supply-Chain Scrutiny for AI Tools

For the global developer community—including Pakistan’s rapidly expanding software sector—the lesson is unambiguous. AI coding assistants now demand the same rigorous scrutiny as any other supply-chain risk. Organizations must evaluate not just the AI model but the entire toolchain, from review bots to agent frameworks.

Industry observers note that the attack’s simplicity is its greatest danger. A malicious AGENTS.md file and a crafted image are all that’s needed; no sophisticated exploits are required. As agentic coding workflows become standard, the attack surface will only grow. The researchers’ work serves as an early warning that multimodal threats are no longer theoretical.

While the immediate fix—image-aware review tools—is promising, long-term solutions will require deeper integration of security checks into agentic pipelines. Until then, developers are advised to treat every AI-reviewed pull request with caution, especially those involving media files.

More from Inside AI

  • Features, Interviews, Press Releases

    Beyond Transcripts: Modulate Secures $25M to Scale Frontier Audio-Native AI Architecture Against Monolithic LLMs

    September 28, 2026
  • Cybersecurity AI

    MiniMax Data Exposed to Unidentified Parties, Researcher Says

    November 26, 2026
  • Robotics

    Humanoid Robots Face Factory Reality Check at Japan Trade Show

    November 26, 2026
  • AI Tools

    Nothing Unveils Ear (note) With AI Notetaker in Charging Case

    November 26, 2026
  • AI In Business

    Rupee to Dip on Oil Rise, AI Trade Finding Tentative Footing

    November 26, 2026
  • AI Policy & Regulation

    Kimmel, Meyers Mock Trump Over Nvidia CEO Jensen Huang Reinstatement

    November 26, 2026
  • AI Policy & Regulation

    OpenAI Taps Cravath Litigator Gary Bornstein for Texas Trial Against Musk

    November 26, 2026
  • AI Policy & Regulation

    US finds no evidence China directed executive to spy on Nvidia CEO

    November 25, 2026
  • AI Hardware & Infrastructure

    AI Metals Meltdown Masks Acute Physical Squeeze in Copper, Aluminium, Tin

    November 25, 2026

Never Miss a Breakthrough

Join 50,000+ readers who get our daily AI intelligence briefing. No fluff, just what matters.

Join Our Newsletter Community

Subscribe

Inside AI is an independent publication covering artificial intelligence news, machine learning research, and the tools shaping the future of technology. No hype. Just what's happening in the AI world.

Topics

  • Artificial Intelligence
  • Machine Learning
  • Generative AI
  • Agentic AI
  • Vibe Coding
  • Prompt Engineering
  • AI Policy & Regulation
  • AI Hardware & Infrastructure
  • AI Tools
  • AI In Business
  • Robotics
  • Cybersecurity AI
  • AI Safety
  • AI Tools & Reviews (Coming soon)

Company

  • Editorial Standards
  • Privacy Policy
  • Terms of Service
  • Contact
  • About Us

Others

  • Press Releases
  • Features
  • Sponsored Content
  • Advertise with us
  • Newsletter

© 2026 Inside AI. All rights reserved.

Designed by Blue Flare Digital