GhostSplice Attack Splits AI Coding Agent Instructions to Exfiltrate Secrets
A new technique called GhostSplice allows malicious servers connected to AI coding assistants to exfiltrate sensitive data by fragmenting exfiltration requests into seemingly routine operations.

Researchers have unveiled a novel attack technique dubbed "GhostSplice" that enables malicious tool servers connected to AI coding assistants to exfiltrate sensitive data, including SSH keys, environment secrets, source code, and customer data. This sophisticated method bypasses basic security checks by splitting exfiltration requests into seemingly routine fragments, which are then reassembled by the AI agent. The attack targets coding tools that communicate with external servers via the Model Context Protocol (MCP), an open standard that facilitates AI assistants calling external tools.
The GhostSplice technique leverages the MCP's ability to handle structured tool and result boundaries. A malicious MCP server can strategically place instruction fragments within a tool's description and another within its results, or even utilize server-initiated sampling. ASSET Research Group's tests demonstrate that AI agents can combine these fragmented instructions within the same working context, meaning no single fragment needs to contain the entirety of the malicious request. This approach significantly increases the likelihood of successful data exfiltration compared to a single, obviously malicious command.
In a controlled test, ASSET Research Group demonstrated this by advertising a seemingly harmless tool called integrity_checker with four fields: alpha, beta, gamma, and delta. Later, a project-scan result provided the mapping, instructing the agent to fill these fields with the contents of .ssh/id_rsa, proprietary source code, customers.csv, and .env for "server-side hash verification." Individually, neither the tool description nor the project scan contained the full exfiltration command. When combined, however, they instructed the AI agent to collect the sensitive local files and transmit their contents to the attacker's tool.
The effectiveness of GhostSplice was highlighted in the group's disclosure, which reported that splitting exfiltration requests into two pieces increased average compliance from 42% to 82% across eleven API-tested models. Notably, advanced models like GPT-4o, Gemini 2.0 Flash, and Llama 3.3 70B saw their success rates jump from 0% to 100% when the attack was split. Even models that initially showed resistance, like Claude Haiku 4.5, achieved 100% success in specific test environments.
It is crucial to note that the attack has inherent limitations. GhostSplice is not a method for breaking into an arbitrary agent from the outside. It assumes that the developer has already connected the attacker's MCP server and that the AI agent already possesses the necessary permissions to read the files targeted for exfiltration. The success rates reported are specific to the tested configurations and should not be generalized as universal compliance rates for the models.
The researchers also found that the simplicity of the lure was often the most effective. Elaborate compliance or governance narratives could be questioned by the AI, whereas a plain fill-in-the-blanks template was more readily accepted. The AI's task, in this case, was simply to "fill in the form the tool asked me to fill in," obscuring the malicious intent.
Defenses against GhostSplice primarily lie with the client-side implementation. The MCP specification advises clients to maintain human oversight for tool invocations and to treat annotations from untrusted servers with suspicion. OpenAI's guidance also warns about prompt-injection risks from unsafe MCP servers and recommends vetting custom and third-party integrations. ASSET suggests treating server output as data rather than instructions, and preventing unchecked data flow between different tool outputs.
This attack follows a previous disclosure from ASSET Research Group called Ghostcommit, which similarly exploited AI coding agents by hiding instructions within project convention files. While the mechanics differ, both attacks underscore a critical vulnerability: the security boundary around the AI model and its interactions with external tools is as vital as the model's inherent safety features.