Researchers Found a Way to Trick AI Coding Agents Into Leaking Secrets, One Fragment at a Time
Cybersecurity

Researchers Found a Way to Trick AI Coding Agents Into Leaking Secrets, One Fragment at a Time

The GhostSplice technique splits malicious instructions across separate MCP tool descriptions and results, pushing exfiltration rates on tested models from zero to one hundred percent once an AI agent stitches the fragments together.

PublishedAugust 24, 2026
Read time5 min read
Share

How GhostSplice actually works

The Model Context Protocol, or MCP, has become the standard way AI coding agents connect to external tools, letting an agent call a tool, read its description, and act on the results within a single reasoning context. The ASSET Research Group's GhostSplice technique exploits exactly that mechanism. Instead of embedding a single obviously malicious instruction that safety filters would catch, the attack splits the instruction into fragments, placing one component inside a tool's description and a second, complementary component inside that tool's result output.

Neither fragment looks dangerous in isolation. The proof-of-concept implementation used a fake tool called integrity_checker with benign-sounding field names, alpha through delta, and a later project-scan result that quietly mapped those innocuous field names to genuinely sensitive file paths like .ssh/id_rsa and .env. The AI agent, processing both pieces within the same context window, stitched them together and followed the combined instruction as if it were a single, coherent, and legitimate request.

What the exfiltration rates actually showed

The results are the part enterprise security teams should sit with. When researchers presented the full malicious instruction in one piece, every model tested correctly refused it, a zero percent exfiltration rate across the board. When the exact same instruction was split using GhostSplice, GPT-4o, Gemini 2.0 Flash, and Claude Haiku 4.5 all jumped to a one hundred percent exfiltration rate. The safety training these models received clearly generalizes to recognizing malicious intent when it is stated plainly, and just as clearly fails to recognize the same intent once it is distributed across two ostensibly separate, benign-looking inputs.

More capable models fared somewhat better in aggregate, but not perfectly. Researchers documented at least one case where a more advanced model still exfiltrated proprietary source code containing hardcoded credentials during testing. The researchers captured the underlying failure mode in a single quote describing how the agent rationalized its own action: it was simply filling in the form the tool asked it to fill in. That is a model treating a tool's structured request as inherently trustworthy, without applying the same scrutiny it would to a single plainly malicious prompt.

Why this is a different risk category than prompt injection

Enterprise security teams have spent the past two years building intuition around prompt injection, the practice of hiding malicious instructions inside content an AI model processes. GhostSplice is a meaningfully different problem because it does not require injecting anything into content the model reads. It exploits the architecture of tool-calling itself, the expectation that a tool's description and a tool's output are both trustworthy inputs the agent should act on together. That means content filtering approaches built to catch injected instructions in a single input will not catch an attack deliberately engineered to look harmless at every individual step.

This also means the attack surface is not your organization's own code or prompts. It is every third-party MCP server your developers connect their AI coding assistants to, many of which are unvetted community tools installed for convenience during a sprint. An attacker does not need to compromise your environment directly. They only need one developer to install a malicious or compromised MCP server that speaks the fragmented instruction pattern GhostSplice demonstrates.

What is and is not fixed yet

As of the disclosure, no CVE had been assigned, and the researchers describe coordinated disclosure with affected vendors as still ongoing. That means there is no patch enterprises can simply deploy to close this gap today. The responsibility currently sits with organizations to reduce their own exposure: treating third-party MCP servers with the same scrutiny applied to any other piece of software with access to source code and credentials, rather than installing them as casually as a browser extension that a developer added on a whim between sprints.

Model providers will likely improve training to recognize fragmented malicious intent over time, but that is a probabilistic defense, not a guarantee, exactly as this research demonstrates with the one case where a stronger model still failed. Enterprises cannot design a security program that assumes model-level defenses will catch every variant of an attack technique that is, by design, built to evade exactly that kind of pattern recognition, which puts the durable fix outside the model and back inside the enterprise's own controls.

The governance decision this creates now

For CTOs rolling out AI coding assistants at scale, GhostSplice is a concrete argument for treating MCP server adoption as a governed procurement decision rather than a developer self-service choice. That means maintaining an approved registry of vetted MCP servers, requiring security review before any new one connects to an environment with access to source code or secrets, and monitoring agent tool-call logs for unusual data access patterns rather than trusting that the model's own safety training is a sufficient control.

It is also a reason to reconsider how much standing access AI coding agents are granted by default. An agent that can read SSH keys and environment files because a developer's workstation happens to have them accessible is one fragmented instruction away from exfiltrating them. Scoping agent permissions down to only what a specific task requires, rather than whatever the underlying developer account can reach, converts this from a one-hundred-percent failure into a much narrower incident even when an attack like this one succeeds.

Tagged#news#security#cybersecurity#breach#cisa#ransomware#zero-day#supply-chain#ai-security#GhostSplice#MCP security#AI coding agents#prompt injection#ASSET Research Group