TL;DR
This paper introduces G-Safeguard, a novel framework that uses graph neural networks to detect and mitigate attacks on Large Language Model (LLM)-based Multi-agent Systems (MAS). By analyzing the communication patterns and topology of agent interactions, G-Safeguard effectively identifies malicious agents and prunes harmful communication pathways, significantly improving MAS robustness.
What Problem Does This Paper Address?
LLM-based Multi-agent Systems (MAS) are becoming increasingly sophisticated, capable of tackling complex tasks through collaboration. However, their integration into critical applications is hampered by significant security vulnerabilities. These systems are susceptible to adversarial attacks, misinformation propagation, and unintended behaviors, which can arise not only from the underlying LLMs but also from the complex interactions between agents. Existing defenses often focus on individual agents or specific attack types, failing to address the systemic risks inherent in MAS, particularly the propagation of malicious information through agent communication networks. The challenge is to develop a defense mechanism that can understand and counteract these inter-agent attack dynamics across diverse MAS architectures and LLM backbones.
Methods
G-Safeguard tackles this challenge by employing a two-pronged approach: detection and remediation, guided by the system's topology.
- Topology-Aware Utterance Graph Construction: At the end of each dialogue round, G-Safeguard constructs a "multi-agent utterance graph." This graph captures both the communicative interactions between agents (as edges) and the agents' historical outputs (as node features). This representation is crucial for understanding how information flows and potentially becomes corrupted within the MAS.
- Graph Neural Network (GNN) for Anomaly Detection: A GNN is then used to analyze this utterance graph. The GNN learns to identify anomalous agents and "toxic" information flows by processing the graph's structural and semantic dependencies. This allows G-Safeguard to pinpoint high-risk agents that are either directly compromised or have been influenced by malicious information.
- Topological Intervention for Remediation: Once attacked agents are identified, G-Safeguard employs "topological intervention," specifically edge pruning. This involves removing the outgoing edges from compromised agents in the communication graph, effectively severing the pathways through which malicious information could propagate to other agents. This ensures contamination-free inter-agent communication.
Datasets
The paper utilizes several standard datasets for evaluating MAS performance and attack scenarios:
- CSQA: For evaluating question-answering tasks.
- MMLU: For assessing broad knowledge understanding.
- GSM8K: For mathematical reasoning tasks.
- InjecAgent: Used for constructing tool attack scenarios.
- PoisonRAG: Used for constructing memory attack scenarios.
The authors also construct MAS communication data by combining these questions with various network topologies (chain, tree, star, random) and assigning roles to agents, including attackers.
Key Insights and Ideas
- Topology Matters: The paper strongly emphasizes that understanding the communication topology of MAS is critical for effective defense. Attacks can spread through these connections, and defenses must leverage this structural information.
- Inductive Transferability: A key insight is that G-Safeguard, by using GNNs, exhibits strong inductive capabilities. This means a model trained on small-scale MAS can be effectively applied to larger, more complex MAS without requiring retraining, saving significant computational resources.
- Generalizability Across LLMs: The GNN-based approach allows G-Safeguard to generalize well across different LLM backbones, meaning it doesn't need to be retrained for every new LLM used in an MAS.
- Seamless Integration: G-Safeguard is designed to be easily integrated into existing MAS frameworks, offering a plug-and-play security enhancement.
Key Results
G-Safeguard demonstrates significant effectiveness across various attack types and MAS configurations:
- Prompt Injection Defense: G-Safeguard recovers over 40% of performance lost due to prompt injection attacks. It blocks 12.50% to 33.23% of infections in chain structures and 10% to 38.52% in star structures on the MMLU dataset.
- Broad Attack Mitigation: It reduces the Attack Success Rate (ASR) by 21.38% for prompt injection on CSQA, 22.01% for MMLU, 12.67% for tool attacks, and 16.27% for memory poisoning.
- Scalability: G-Safeguard maintains stable performance on large-scale MAS, achieving ASR reductions of 19.50% to 39.23% under prompt injection.
- Cross-LLM and Topology Generalization: Experiments show G-Safeguard's effectiveness across diverse LLMs (GPT-4o, LLaMA-3.1-70b, Claude-3.5-haiku, Deepseek-V3) and network topologies (chain, tree, star, random).
- Real-world Applicability: In multi-role scenarios, G-Safeguard achieves over 80% attacker recognition accuracy on CSQA and MMLU, demonstrating its utility in practical MAS deployments.
Limitations and Future Work
The authors acknowledge a key limitation: G-Safeguard cannot preemptively prevent an MAS from being compromised. Its defense relies on analyzing communication data, meaning some nodes might already be compromised by the time an attack is detected. The primary function is to curtail the further dissemination of malicious information.
Future work could focus on proactive prevention strategies to address this limitation. The paper also suggests that the proactive prevention of attacks in MAS environments is a pivotal direction for future research endeavors.
Summary updated