Abstract
LLM-based multi-agent systems (MAS) demonstrate increasing integration into next-generation applications, but their safety in backdoor attacks remains largely underexplored. Existing research has focused exclusively on single-agent backdoor attacks, overlooking the novel attack surfaces introduced by agent collaboration in MAS. To bridge this gap, we present the first Distributed Backdoor Attack tailored to MAS. We decompose the backdoor into multiple distributed attack primitives that are embedded within MAS tools. These primitives remain dormant individually but collectively activate only when agents collaborate in a specific sequence, thereby assembling the full backdoor to execute targeted attacks such as data exfiltration. Extensive experiments demonstrate that our attack achieves an attack success rate exceeding 95% without degrading performance on benign tasks. This work underscores the need to move beyond single-agent protection.
Introduction: The New Attack Surface of Collaboration
As Large Language Models (LLMs) evolve from simple chatbots into autonomous agents, Multi-Agent Systems (MAS) are becoming prevalent. In these systems, specialized agents—such as a "Coder," "Reviewer," and "Manager"—collaborate to solve complex tasks. While security research has historically focused on single-agent backdoors (e.g., poisoning training data to trigger malicious behavior), MAS introduces a unique attack surface: collaboration.
Traditional attacks often require retraining the model or are limited to single-agent scenarios. In contrast, a distributed backdoor attack exploits the way agents interact and share tool outputs. Even if individual agents are "clean," their collective behavior can be weaponized to assemble a malicious payload that is invisible to any single entity.
Methodology: Assembling the Distributed Puzzle
The proposed "Collaborative Shadows" framework is a training-free, distributed attack that hides malicious payloads across multiple tools. The process follows several key stages:
- Primitive Decomposition: A malicious script is broken down into ordered "attack primitives." These include Conditional Primitives that set the environment and a Payload Primitive that executes the final attack (e.g., data exfiltration).
- Tool Poisoning and Encryption: These primitives are embedded into common tools. To maintain stealth, they are AES-encrypted using the user's initial instruction as the key. This ensures the primitives appear as undecipherable noise to scanners until the specific triggering prompt is provided.
- Steganographic Delivery: When an agent invokes a poisoned tool, the tool returns the expected result along with a hidden, encrypted primitive tucked into metadata or observation strings.
- Distributed Triggering and Assembly: An attacker provides a benign-looking prompt that steers agents to use a specific sequence of tools. As agents collaborate, they unknowingly pass these encrypted snippets into the system's shared memory. Finally, the pieces are extracted from the execution trace, decrypted, and reassembled into the full malicious code.
Experimental Setup and Results
To evaluate the threat, the authors developed a sandboxed framework and two primary benchmarks:
- AgentBench-MAS (DB): A collaborative version of AgentBench focused on database operations, featuring 100 reorganized tasks.
- Multi-Role Collaboration Bench: A new benchmark with four specialized roles (Retrieval, Analysis, Engineering, Reporting) across 100 tasks.
Key Performance Metrics
The attack demonstrated remarkable efficacy across state-of-the-art models, including GPT-4, Qwen3, and Gemini 2.5:
- Attack Success Rate (ASR): The attack achieved an ASR exceeding 95% across most benchmarks. For instance, GPT-4.1 reached a 100% success rate on the database benchmark.
- Clean Accuracy (ACC): The performance on benign tasks remained virtually unchanged, making the attack nearly impossible to detect through standard performance monitoring.
Discussion: Stealth and Reliability
The "sleeper cell" nature of this attack poses a significant challenge for security audits. Since primitives are distributed and encrypted, auditing a single agent or tool reveals nothing suspicious. The backdoor only exists momentarily in the collective memory during a specific workflow.
However, there is a trade-off between task complexity and reliability. If the underlying LLM is not "intelligent" enough to complete the complex primary task, the backdoor sequence may never be fully triggered. Ironically, the more capable the agents are at collaborating, the more reliable the distributed attack becomes.
Conclusion
This research exposes a critical vulnerability in the collaborative nature of MAS. Current single-agent defenses are insufficient against distributed threats that exploit inter-agent communication. There is an urgent need for the development of collaboration-aware security protocols to protect the next generation of autonomous systems.
Code and benchmark are available at https://github.com/whfeLingYu/Distributed-Backdoor-Attacks-in-MAS.
Summary updated