Manuscript Offprint

arXiv:2609.02967

Privacy-Preserving Topology-Guided Safety for LLM-Based Multi-Agent Systems via Federated Graph Learning

Jinxi Yu, Eric Hanchen Jiang, Levina Li, Dong Liu, Zhi Zhang, Wenxiao Zhao, Yanxuan Yu, Kai-Wei Chang, Ying Nian Wu

Abstract

Topology-guided safeguards for LLM-based multi-agent systems (MAS) train a GNN over the inter-agent communication graph to localize risky agents and intervene on the topology—but they assume one operator can pool all labeled traces. Across organizations that assumption breaks: episodes contain private prompts, tool outputs, and proprietary workflows, and no silo alone sees the full attack distribution. We cast privacy-preserving MAS safeguarding as graph federated learning and instantiate FGLGuard: each operator fits an edge-featured graph attention detector on its own judge-labeled episode graphs and shares only model updates. The method couples a proximal local objective for non-IID clients, domain-balanced aggregation, over-refusal-constrained threshold calibration, corroborated upstream scoring, and a guarded rewrite for blocked answers. Federation is not optional: off-the-shelf transfer collapses under distribution shift (AUROC 0.51→0.70 only after in-domain retraining), so a deployable guard must adapt on each site's private traces. On Agent-SafetyBench, R-Judge, and Agent-Dojo, federated FGLGuard exceeds the in-domain centralized ceiling on all three benchmarks without pooling any data—where unsupervised anomaly guards and local-only training fail. One guard federated across four different-domain operators comes within 0.03 AUROC of multi-domain centralization, while any single-domain guard collapses on the others. Live, FGLGuard cuts AgentDojo's ground-truth attack-success rate by 43% at near-unguarded utility, zero API cost, and negligible capability loss. Our code is available here: https://github.com/jinxiy1104/FGLGuard.

1 Introduction

LLM-based multi-agent systems (MAS) built with frameworks such as AutoGen (Wu et al. 2024), MetaGPT (Hong et al. 2024), and LangGraph (LangChain AI 2024) organize several LLM agents into a communication graph whose collective capability scales with the number and connectivity of agents (Qian et al. 2025). That same channel is the system's dominant attack surface: injected prompts self-replicate across connected agents like a worm (Lee and Tiwari 2024), adversarial messages propagate through the network (Khan et al. 2025), and recursive interaction exhausts resources (Zhou et al. 2025). Because the topology governs how fast unsafe content spreads (Yu et al. 2025), a promising

Figure

Figure 1: Why federate a topology guard? (Top) Without safeguarding, injected intents propagate over the MAS communication graph. (Middle) Centralized training requires pooling private traces—infeasible across organizations—and still leaves each operator without others' attack coverage. (Bottom) Federated safeguarding keeps raw episodes local and exchanges only model updates, so operators jointly adapt a topology guard under the privacy constraint.

defense treats the MAS as a graph and trains a GNN over the communication structure to localize risky agents and intervene on the topology around them (Wang et al. 2025a; Zhou, Wang, and Yang 2025; He et al. 2025).

This paradigm carries an implicit assumption that blocks deployment across organizations: that one site can pool all labeled traces to train the detector centrally. Runtime episodes contain user prompts, tool outputs, and proprietary workflows, so across operators they are siloed; yet each operator sees only a slice of all attacks, so those who would gain most from others' unsafe examples cannot obtain them. MAS deployments across operators thus form a graph federated-

*These authors contributed equally.

learning scenario (Li et al. 2025): each holds a private set of episode-level communication graphs, unsafe labels are scarce, and attack distributions are non-IID. We ask whether operators can collaboratively train a topology guard without exchanging any raw traces.

One might expect this collaboration to be unnecessary: a detector trained once would transfer across deployments. It does not. An off-the-shelf G-Safeguard detector, trained per its official recipe on synthetic tool-injection data (Zhan et al. 2024), scores at chance on real Agent-SafetyBench episodes (AUROC 0.51); a controlled study attributes this to distribution shift, not architecture, since retraining the same architecture on ASB traces recovers it to 0.70. A deployable guard must therefore adapt on each deployment's own traces, exactly the siloed data privacy forbids centralizing. Our contribution is thus a new guard architecture built for that constraint—a federated topology guard whose scorer, aggregation, calibration, and runtime operator are jointly designed for siloed, non-IID, label-scarce deployments—and a demonstration that retraining's effect is obtainable without centralizing the data.

We instantiate FGLGuard for this graph-FL problem (Figure 2), with each design element answering a deployment reality. Skewed attack distributions: local training anchors updates to the global model with a proximal objective. Unequal silo sizes: aggregation weights domains equally rather than by volume. Users disable guards that block benign work: the threshold is calibrated under an explicit over-refusal budget. Unsafe content originates upstream of the acting agent: the runtime rule corroborates each agent's score with its upstream neighbors'. A hard block discards repairable work: the guard grants one rewrite, re-scored before release. We evaluate the no-pooling property in two settings: same-domain silos, asking whether federation matches pooled-training quality, and cross-domain silos, where pooling would additionally buy attack coverage no single site holds.

References (43)