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: July 28, 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.

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.”

The researchers also highlighted the encoding tactic:

“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.

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

  • AI In Business

    ChatGPT and Critical-Thinking Training Have Complementary Effects on Student Work, Bocconi Study Finds

    August 27, 2026
  • Generative AI

    AI Proof of Non-Sofic Groups Forces Mathematicians to Rethink Purpose

    August 27, 2026
  • AI In Business

    Young Workers Turn to Heritage Crafts as AI Disrupts White-Collar Jobs

    August 27, 2026
  • AI In Business

    AI Can Detect Heart Disease in Women Using Mammograms, Study Suggests

    August 27, 2026
  • AI Hardware & Infrastructure

    SK Hynix Breaks Ground on $4 Billion Indiana AI Chip Packaging Facility

    August 27, 2026
  • AI Tools

    Eufy Omni E28 Robot Vacuum Review: Detachable Spot Cleaner Tested

    August 27, 2026
  • AI Policy & Regulation

    OpenAI, Nvidia CEOs to Speak at Tech-Focused G20 Meeting

    August 27, 2026
  • AI In Business

    Nasdaq Futures Lead After Nvidia Forecast Refuels AI Trade

    August 27, 2026

Never Miss a Breakthrough

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

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

© 2026 Inside AI. All rights reserved.

Designed by Blue Flare Digital