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.
Driven by the rapid advancement of large language models (LLMs), LLM-based multi-agent systems (MAS) have emerged as a powerful paradigm for collaborative reasoning over complex tasks. A key design element of MAS is the communication topology, which governs information flow among agents and often encodes proprietary knowledge about the system architecture. However, recent work has shown that such topologies can be inferred even in black-box settings by exploiting semantic dependencies in observable reasoning traces, posing significant risks of intellectual property leakage and exposure of system vulnerabilities. To address this threat, we propose MIRAGE, a topology-concealment framework that preserves the genuine communication topology for task execution while shaping adversary-facing semantic evidence toward a carefully constructed phantom topology. Specifically, MIRAGE operates in three stages: (1) phantom topology synthesis, (2) semantic edge realization, and (3) protected MAS execution. It constructs a phantom topology structurally distinct from the genuine one, materializes phantom edges as plausible semantic dependencies, and suppresses source-specific cues that could reveal genuine edges absent from the phantom topology. Extensive experiments across three topology optimization frameworks and four benchmark datasets demonstrate that MIRAGE substantially reduces the effectiveness of topology inference attacks while largely preserving the task utility of the protected MAS.
Longzhu He, Zelang Wen, Xinfeng Li +2
Nanyang Technological University · Beijing University of Posts and Telecommunications · The Hong Kong Polytechnic University
LLM-based Multi-Agent Systems (MAS) have demonstrated remarkable capabilities in solving complex tasks. Central to MAS is the communication topology which governs how agents exchange information internally. Consequently, the security of communication topologies has attracted increasing attention. In this paper, we investigate a critical privacy risk: MAS communication topologies can be inferred under a restrictive black-box setting, exposing system vulnerabilities and posing significant intellectual property threats. To explore this risk, we propose Communication Inference Attack (CIA), a novel attack that constructs new adversarial queries to induce intermediate agents' reasoning outputs and models their semantic correlations through the proposed global bias disentanglement and LLM-guided weak supervision. Extensive experiments on MAS with optimized communication topologies demonstrate the effectiveness of CIA, achieving an average AUC of 0.87 and a peak AUC of up to 0.99, thereby revealing the substantial privacy risk in MAS.
Yongxuan Wu, Xixun Lin, He Zhang +5
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
Multi-agent LLM systems (MALS) introduce a privacy-leakage problem that conventional sensitivity-based defenses miss, since information disclosed to one authorized agent can propagate through routine coordination to an unauthorized one, without compromise or malicious behavior. This motivates topology-aware enforcement that blocks unauthorized propagation while preserving authorized disclosure. We evaluate 485 scenarios across coordinator-worker, peer-to-peer, and hierarchical topologies, instrumenting seven communication channels and measuring surface leakage and disclosure to topology-introduced recipients. We introduce RECONS, a Detect -> Decide -> Transform sanitizer conditioning intervention on recipient and execution context rather than sensitivity alone. Topology changes where protected information propagates, with disclosure to topology-introduced recipients rising from 0% to 52.2% while surface leakage stays nearly flat at 60.6-62.8%. This effect persists across four generator models and a second orchestration framework, though magnitude and relay paths differ; framework choice separately drives a 150x leakage spread, so topology alone is not sufficient. RECONS reduces residual disclosure from 96.7% without sanitization to 29.25%, preserving 94.1% of authorized disclosures versus 20.5% under blanket redaction. Detection coverage is the dominant bottleneck, accounting for 95.5% of residual disclosures. These results show that privacy enforcement in MALS must reason about the recipient and communication path realized at runtime, not sensitivity or topology assumptions alone.