WebWeaver: Breaking Topology Confidentiality in LLM Multi-Agent Systems with Stealthy Context-Based Inference
Authors: Zixun Xiong, Gaoyi Wu, Lingfeng Yao, Miao Pan, Xiaojiang Du, Hao Wang
Organizations: Department of Electrical and Computer Engineering, Stevens Institute of Technology · Department of Electrical and Computer Engineering, University of Houston
Communication topology is a critical factor in the utility and safety of LLM-based multi-agent systems (LLM-MAS), making it a high-value intellectual property (IP) whose confidentiality remains insufficiently studied. Existing topology inference attempts rely on impractical assumptions, including control over the administrative agent and direct identity queries via jailbreaks, which are easily defeated by basic keyword-based defenses. As a result, prior analyses fail to capture the real-world threat of such attacks. To bridge this realism gap, we propose WebWeaver, an attack framework that infers the complete LLM-MAS topology by compromising only a single arbitrary agent instead of the administrative agent. Unlike prior approaches, WebWeaver relies solely on agent contexts rather than agent IDs, enabling significantly stealthier inference. WebWeaver further introduces a new covert jailbreak-based mechanism and a novel fully jailbreak-free diffusion design to handle cases where jailbreaks fail. Additionally, we address a key challenge in diffusion-based inference by proposing a masking strategy that preserves known topology during diffusion, with theoretical guarantees of correctness. Extensive experiments show that WebWeaver substantially outperforms state-of-the-art (SOTA) baselines, achieving about 60% higher inference accuracy under active defenses with negligible overhead.
Figures & tables
Figure 1: Studies Yu et al. (2024) ; Yang et al. (2025) show that communication topology in LLMMAS significantly affects security and utility performance, with no universally optimal topology, making it a critical form of intellectual property.
Figure 2: The pipeline of WebWeaver : Step-1: Inter-agent dialogues are collected offline under known topologies and reused for both training and inference. Step-2: The collected dialogues are used to train a sender predictor that infers the sender identity from a received dialogue. Step-3: The attacker compromises a selected agent C and retrieves all dialogues received by this agent during interaction. Step-4: The trained sender predictor is applied to the retrieved dialogues to infer the set of agents directly connected to the selected agent. Step-5: If the initial or optimized jailbreak succeeds (denoted as Y), the attacker uses it to induce connected agents to request additional context and iteratively repeats dialogue retrieval and sender prediction to expand the inferred graph until no new agents are uncovered; if the optimized jailbreak still fails (denoted as N), the attacker performs topology completion using a masked diffusion model (i.e., DDPM) trained on the collected dialogues and conditioned on the partially known topology to infer the complete interaction structure.
Dataset
Precision
Recall
F1 Score
CSQA
0.8794
0.8773
0.8772
GSM8k
0.9471
0.9472
0.9470
Fact
0.9606
0.9597
0.9597
Bias
0.9830
0.9830
0.9830
Table 1: Sender predictor performance across different datasets.
Figure 3: Robustness of different attacks against a keyword-based defense that rejects any request containing information intended to reveal adjacent agent IDs. “Ours (w/o)” is the jailbreak-free module of WebWeaver , and “Ours” is the jailbreak-based WebWeaver .
Figure 4: Scalability of the jailbreak-based module with different numbers of agents.
Dataset
Jailbreak-based module
Jailbreak-free module
Precision
Recall
F1 Score
MRR
Precision
Recall
F1 Score
MRR
CSQA
1.0000
0.7688
0.8666
0.7292
0.8310
0.7506
0.7887
0.7029
GSM8k
1.0000
0.9688
0.9821
0.9208
0.8418
0.7844
0.8120
0.7593
Fact
1.0000
1.0000
1.0000
1.0000
0.8432
0.7876
0.8145
0.7618
Bias
1.0000
1.0000
1.0000
1.0000
0.8518
0.7902
0.8198
0.8659
Table 2: Graph completion performance under jailbreak-based and jailbreak-free modules of WebWeaver .
Dataset
IP Leakage
WebWeaver
w/o
Off.
On.
Off.
On.
Off.
On.
CSQA
N/A
25.3
50.4
30.7
35.2
N/A
GSM8K
N/A
32.0
43.1
35.8
34.6
N/A
Fact
N/A
8.6
39.4
12.7
16.1
N/A
Bias
N/A
9.9
54.4
15.4
15.1
N/A
Table 3: Overall overhead analysis. All measurements are reported in seconds. “w/o Jailbreak” is when only the jailbreak-free module is activated.
Predictor
CSQA
GSM8K
Fact
Bias
Fixed
0.64
0.56
0.69
0.58
Ours
0.72
0.93
1.00
1.00
Table 4: Ablation of jailbreak prompts. We report graph completion F1 when benign agents use LLaMa Guard Inan et al. (2023) prompted by a single jailbreak example. “Fixed” uses the initial prompt, while “Ours” uses the optimized prompt.
Prediction
CSQA
GSM8K
Fact
Bias
Logistic
.5/.6/.5
.5/.7/.6
.5/.8/.6
.5/.6/.5
BERT
.8/.8/.8
.9/.9/.9
.9/.9/.9
.9/1./.9
Ours
.8/.8/.8
.9/.9/.9
.9/.9/.9
.9/.9/.9
Table 5: Ablation study of sender predictors. Each cell reports Precision, Recall, and F1 score in the format Precision/Recall/F1 score.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Data
Chain
Star
Tree
Complete
MRR
IP Leakage
CSQA
(0.00/0.00/0.00)
(0.03/0.01/0.00)
(0.00/0.00/0.00)
(0.06/0.04/0.04)
0.04
GSM8K
(0.06/0.02/0.03)
(0.06/0.00/0.00)
(0.00/0.00/0.00)
(0.04/0.01/0.01)
0.03
Fact
(0.00/0.00/0.00)
(0.02/0.01/0.01)
(0.06/0.02/0.02)
(0.10/0.03/0.05)
0.01
Bias
(0.00/0.00/0.00)
(0.02/0.01/0.01)
(0.00/0.00/0.00)
(0.04/0.01/0.02)
0.04
CZLR
CSQA
(0.31/0.25/0.28)
(0.54/0.47/0.51)
(0.35/0.45/0.39)
(0.51/0.55/0.53)
0.67
GSM8K
(0.16/0.20/0.18)
(0.41/0.40/0.41)
(0.33/0.30/0.32)
(0.34/0.33/0.33)
0.60
Appendix
Table 6: Graph completion performance (Precision/Recall/F1 and MRR) under different attack methods with 200 samples.
Figure 5: Inferred topology examples. All examples are selected randomly from five types of topologies. The red node stands for the compromised agent, and the gray nodes stand for the benign agents.
Multi-agent system security studies attacks, trust, privacy, and defenses in interacting AI agents, including language-model teams, robot swarms, and learned controllers.
Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China · School of Cyber Security, University of Chinese Academy of Sciences, Beijing, China · Griffith University, Brisbane, Australia +2