Intellectual Property Leakage Attacks Against LLM-Based Multi-Agent SystemsIP Leakage Attacks Targeting LLM-Based Multi-Agent Systems
The authors propose MASLeak, which under black-box conditions extracts IP such as system prompts and topology from multi-agent systems, with an average ASR of 87% (prompts/instructions) and 92% (architecture) on the synthetic dataset.
The attacker has only black-box access to the target MAS: submitting inputs to the first agent through the public API, able to observe only the final agent's output, with no access to internal state or inter-agent communication; no prior knowledge other than a general task description of the MAS; and a limited number of queries is assumed. The goal is to extract and reconstruct all of the MAS's IP (system prompts, task instructions, tools, agent count, topology).
- The system prompts, task instructions, tool configurations, number of agents and topology of multi-agent systems (MAS) constitute high-value IP that can be replicated at low cost once leaked; existing single-agent prompt extraction methods cannot propagate through the agent chain of a MAS, and the state of IP protection for black-box commercial MAS lacks research.
- MASLeak draws on worm propagation mechanisms, splitting the attack query into three concatenated sub-queries—leak, retain, and propagate: inducing agents to leak IP, using domain-aware hooking templates to carry the already-leaked content, and having each agent repeat the attack payload verbatim so it propagates to the next agent; queries are generated offline and then used for multiple extractions online, with majority agreement and typed rules reconstructing the complete MAS IP.
- On 810 synthetic MAS, MASLeak achieves an average ERMAS of 0.743, far higher than the strongest baseline Handcraft's 0.073; on GPT-4o, agent count F1 reaches 0.986 and topology GStopo 0.904; on real CrewAI and Coze applications, ER is 0.792 and 0.814 respectively; all five existing single-agent defenses fail to effectively prevent it.
- The authors state that downstream attacks (such as membership inference) and detection mechanisms against such attacks are left for future work; the defense evaluation covers only five single-agent methods; the synthetic MAS contain only 3–6 agents and five topologies; ablations use GPT-4o-mini and partial topologies by default; the paper does not report the consistency of human evaluation with metric judgments.
- Evaluated models
- GPT-4oGPT-4o-miniLLaMA-3.1-70BQwen-2.5-72B
- Benchmarks
- MASD(810 个合成 MAS 应用,基于 SRDD、FinQA、MedQA)CrewAI 应用(10 个)Coze 应用(10 个)
- Metrics
- SSsysSMsysSStaskSMtaskACCtoolF1numGStopoERMASFNRFPR
Researchers propose MasLeak, an intellectual property extraction attack framework against black-box multi-agent systems (MAS). The attacker can only submit queries through public APIs and observe final outputs, yet can recover the number of agents, system topology, system prompts, task instructions, and tool configurations. The method draws on the propagation mechanism of computer worms, splitting a query into three sub-queries—inducing leakage, maintaining information, and propagation—so that leaked content is preserved along the agent chain all the way to the final output. The authors construct a synthetic dataset covering 30 task categories and 810 MAS applications; the average attack success rate is 87% for system prompts and task instructions, and 92% for system architecture in most cases, and they claim a lead of about 60% over existing prompt extraction methods. The study also evaluates real MAS applications on Coze and CrewAI, where extraction can be completed in fewer than ten queries on average, and discusses potential defense directions.
Why it was selectedThe paper presents a complete method for intellectual property extraction from black-box multi-agent systems and tests it on 810 synthetic applications and on Coze and CrewAI, which can serve as a baseline for assessing MAS configuration leakage risk.
Paper analysis
What problem does this paper attempt to solve?
How to extract the full set of intellectual property (IP), including system prompts and topology, from a multi-agent system (MAS) under black-box conditions.
Core question: Can the intellectual property (IP) of a black-box MAS application—system prompts, task instructions, tool configurations, number of agents and topology—be extracted by an external attacker.
- Scenario and importance: The authors state that MAS development requires substantial design, configuration and optimization, and its IP is of high value; leaked configurations can be replicated at low cost, causing economic losses to developers. Commercial MAS are often hosted on platforms such as Coze, exposing only the input interface of the first agent and the output of the final agent.
- Shortcomings of existing methods: The paper states that prior MAS security research mainly focused on malicious agent injection and environmental vulnerabilities, with threat models centered on protecting users; single-agent prompt extraction methods in a MAS can usually extract only the first agent's prompt and cannot propagate along agent interactions, and the authors' experiments show that these methods have very low ASR.
- Core observation: The authors observe that in a MAS each agent can see only the output of its direct predecessor, and an exploited agent may not carry its system prompt into the final output; therefore an attack must simultaneously solve the three links of propagation, leakage and retention, and the authors design the attack drawing on the propagation mechanism of computer worms.
- Paper contributions: Proposes the attack framework MASLeak; builds the synthetic MAS dataset MASD containing 810 applications and 30 tasks; evaluates on synthetic data and real applications on Coze and CrewAI, and discusses potential defenses.
- Threat model:
- Attacker goal: Extract and reconstruct the full IP of the target MAS (five categories: system prompts, task instructions, tool specifications, number of agents, topology).
- Knowledge: black-box, with no prior knowledge other than a general task description of the MAS (e.g., coding assistant).
- Capability: Submit inputs to the first agent through a public API and observe the final agent's output; cannot access internal state or inter-agent communication; assumes a limited number of queries (constrained by a query budget).
- Victim system: A remotely hosted MAS application with strict information access control between agents, where each agent can see only the output of its direct predecessor.
What related research exists?
Related work falls into three categories: prompt stealing, model extraction, and membership inference; the authors state that none of them applies to black-box MAS.
Prompt Stealing Attacks
- Sha & Zhang [63], Zhang et al. [64] — early work that stole prompts by classifying prompts and inverting LLM outputs.
- Zhang et al. [16] (Handcraft), PLeAK [15], PrivAgent [17] — extracted system prompts using manually constructed, gradient-optimized and reinforcement-learning red-teaming methods, respectively. The paper points out that gradient methods lack cross-agent transferability in the black-box setting, the attacker cannot see the internal structure, and the attack does not propagate between agents, so they perform poorly in black-box MAS.
Model Extraction Attacks
- Tramèr et al. [66], Knockoff Nets [67] — trained substitute models via prediction APIs or black-box queries to replicate functionality, mainly targeting discriminative models.
- Jagielski et al. [68], Papernot et al. [69] — query selection strategies based on entropy or uncertainty to improve extraction efficiency.
- Nasr et al. [70], Li et al. [71] — memorization and knowledge extraction for generative LLMs. The paper states that these methods cannot retain the extracted information across the multi-agent interactions of a MAS.
Membership Inference Attacks (MIA)
- Shokri et al. [80], Carlini et al. [81], Wen et al. [58] — determine whether specific data was used in model training, exploiting behavioral differences between seen and unseen data. The paper points out that MIA targets the training data of a single model, lacks a mechanism to propagate through the agent chain, and does not target system architecture; its goal differs from MASLeak but is complementary.
Baselines and Benchmarks
- Baseline methods: Handcraft [16], Fake Completion [51], Combined Attack [51], GCG [52] (attack sequences computed on LLaMA-3.1-8B and then transferred to MAS targets), all extended and adapted to the MAS setting by the authors (Appendix B.3).
- Evaluation data: The authors' self-built synthetic dataset MASD (810 MAS applications, with tasks from SRDD, FinQA, MedQA), plus 10 real applications in the CrewAI ecosystem and 10 applications on the Coze platform designed by PhD students.
Positioning: The authors state that this paper is the first IP extraction attack against black-box MAS applications, maintaining attack effectiveness across the entire agent chain through a domain-aware propagation mechanism, distinguishing it from the above single-agent methods.
How does the paper address this problem?
MASLeak splits the attack query into three sub-queries—leak, retain and propagate—generates them offline, extracts online multiple times, and then reconstructs the full IP of the MAS.
MASLeak has two phases: offline generation of adversarial queries targeting the target domain, and online use of these queries to extract and reconstruct the target MAS's IP. The core idea is to model the attack as controlled information propagation: the probability of successful extraction is decomposed into the joint probability of three factors—propagation, leak, and retain: P(Extract) = P(Propagate) × P(Leak) × P(Retain), with each sub-query optimizing one of these factors.
Problem Formalization
- The target MAS is represented as M = (A, G, C): the set of agents A, the topology directed graph G = (A, E), and each agent's configuration ci = (pi, ti, Tooli).
- The extraction target is a five-dimensional vector Ω = {ω1…ω5}: system prompts, task instructions, tool specifications, agent count, and topology.
- The optimization objective is to maximize the sum of similarities of the five types of information under a query budget |Q| ≤ B: max ∑j=15 Simj(ωj, Φj(R)).
Adversarial Query Design (Phase I)
- qLeak (leak): a sub-query that induces agents to leak IP. Agent-level IP (prompts, instructions, tools) uses variants of direct questioning; agent count is obtained by counting unique agent names; topology is obtained indirectly by having each agent record its predecessor agent's identifier.
- qRetain (retain): keeps the extracted IP from being modified or lost in the subsequent agent chain. It uses hooking templates formatted like Python code ([DATA] structural markers) and adds plausible fabricated agent IP examples generated by an LLM based on public domain descriptions, exploiting agents' tendency to follow formatted instructions and content consistent with their own role (the authors cite [31][32][33]).
- qPropagate (propagate): a fixed repetition instruction requiring each agent to copy the complete attack payload into its output, forming worm-like self-propagation without relying on privileged operations such as injecting a malicious agent.
- Generation process (Algorithm 1): first use an LLM (e.g., GPT-4o) to summarize crawled domain descriptions into domain knowledge, and generate L hookings for each IP type to form a typed hooking pool; then generate N queries, evenly divided by IP type, each concatenating qLeak + qRetain + qPropagate.
IP Reconstruction (Phase II)
- Extraction: locate the qRetain part from the final response via structural markers (e.g., [DATA]) and filter out the real IP content.
- Assembly (Algorithm 2): compare multiple extraction results pairwise to find common content, and take the longest consistent text as the candidate; the authors state this can suppress hallucination (e.g., agents fabricating nonexistent tools).
- Typed integration: prompts and instructions directly use the extracted text; tools are matched by semantic similarity to the most similar tool in the tool pool; agent count is counted by unique agent names; topology first establishes linear relations by the order in which agents appear in the carrier structure, then is corrected using explicitly extracted predecessor–successor relations to obtain the actual communication structure.
Evaluation Method
- Metrics: agent count uses F1 (F1num); prompts and instructions use semantic similarity SS (sentence-vector cosine) and substring matching SM; tools use binary hit ACCtool; topology uses graph-edit-distance-normalized GStopo; the composite metric ERMAS is the average of seven items.
- Implementation: agents use the OpenAI function calling interface with temperature 0, adopt CrewAI's structured message wrapping, and add prompt engineering to mitigate tool hallucination (Appendix B.2).
What experiments did the paper conduct?
On 810 synthetic MAS and 20 real-world applications, MASLeak substantially exceeds four baselines, and none of five existing defenses can effectively prevent it.
Experimental Setup
- Models tested: GPT-4o, GPT-4o-mini, LLaMA-3.1-70B, Qwen-2.5-72B, as the core LLMs of synthetic and real MAS; temperature 0.
- Datasets: The synthetic dataset MASD contains 810 MAS applications in total, covering the three domains of software, finance and healthcare, five topologies (linear, star, tree, random, complete), 3–6 agents, generated by extending with AutoAgents, with a tool pool of 21 tools selected from LangChain and LlamaIndex; the real evaluation consists of 10 applications in the CrewAI ecosystem (locally deployed black-box) and 10 applications on Coze designed by PhD students.
- Baselines: Handcraft, Fake Completion, Combined Attack, GCG (optimized on LLaMA-3.1-8B for 500 iterations and then transferred), all extended and adapted to MAS by the authors.
- Metrics: SSsys/SMsys/SStask/SMtask, ACCtool, F1num, GStopo and the seven-item average ERMAS; SS uses sentence transformer sentence-vector cosine similarity, and SM requires the real prompt to be a substring of the reconstruction result.
- Default ablation settings: GPT-4o-mini, with the topology subset being Random, Star, Linear.
- Sample size and number of repetitions: The paper reports an average number of queries of fewer than 10 and does not report the number of repetitions for each condition.
Main Results
According to Table 1 (synthetic dataset, average row Avg. for each topology × domain):
Swipe horizontally to read the table
Model SSsys SMsys SStask SMtask ACCtool F1num GStopo ERMAS GPT-4o-mini 0.728 0.573 0.760 0.644 0.352 0.944 0.868 0.696 GPT-4o 0.853 0.724 0.890 0.802 0.567 0.986 0.904 0.818 LLaMA-3.1-70B 0.775 0.597 0.727 0.598 0.711 0.989 0.890 0.755 Qwen-2.5-72B 0.723 0.523 0.846 0.665 0.442 0.988 0.887 0.725 - The authors state that GPT-4o is the most vulnerable and GPT-4o-mini is more resistant, and cite prior work stating that stronger models are generally more vulnerable.
- Tool extraction is overall lower than prompt extraction, which the authors attribute to agents' weak tool awareness and susceptibility to hallucination; Table 2 shows that when counting only successful extraction, ACCtool exceeds 0.93 (GPT-4o and GPT-4o-mini reach 1.000).
- Topology effects: the linear topology yields the best extraction, and the complete topology performs strongly despite its complexity (e.g., LLaMA-3.1-70B ACCtool 0.923 in the finance domain), which the authors attribute to its high information-flow density accelerating attack propagation.
Comparison with Baselines
According to Table 3 (overall results on the synthetic dataset):
Swipe horizontally to read the table
Method SSsys SMsys SStask SMtask ACCtool F1num GStopo ERMAS Handcraft 0.137 0.000 0.143 0.023 0.053 0.096 0.057 0.073 Fake Completion 0.200 0.000 0.097 0.009 0.075 0.162 0.097 0.091 Combined Attack 0.154 0.000 0.089 0.017 0.060 0.145 0.085 0.079 GCG Leak 0.024 0.000 0.002 0.000 0.000 0.027 0.017 0.010 MASLeak 0.755 0.623 0.821 0.727 0.413 0.959 0.902 0.743 - The authors state that traditional prompt injection methods lack propagation and retention mechanisms across agents, and that GCG almost completely fails under the transfer setting (F1num 0.027).
- The authors state that MASLeak can extract the IP of the target MAS with an average of fewer than 10 queries, and that execution time is under 11 seconds in almost all cases.
Real MAS Applications
- CrewAI (Table 6): Average ERMAS 0.792 across 10 applications, F1num 0.957, GStopo 0.943; the exception is Screenplay writer, with ERMAS only 0.227 (SSsys 0.268, SStask 0.000), and the paper does not explain the reason for this case.
- Coze (Table 7): Average ERMAS 0.814 across 10 applications, F1num 0.991, GStopo 0.975; the exception is Medical Symptom Severity Logger, with ERMAS 0.472 (SMsys 0.000, SMtask 0.000).
- The authors state that on both platforms the average SS of prompt extraction is above 0.8, and the reconstructed prompts are almost identical to the original prompts (Appendix Table 10 gives comparison examples).
Defense Evaluation
- Preventive defenses (Table 8): The three methods Delimiters, Sandwich and Instructional reduce some metrics (especially SMsys, e.g., from 0.623 to 0.464 under Sandwich), but the authors state that overall attack effectiveness is largely maintained, because these defenses target single agents and do not cover inter-agent communication paths.
- Detection-based defenses (Table 9): Known-answer detection FNR 81.8%, FPR 9.1%; PPL detection FNR 72.1%, FPR 0.9% (PPL computed with cl100k_base, threshold adapted per domain, controlling FPR below 1%). The authors state that the attack payload is semantically blended into normal agent communication and its perplexity distribution is close to that of clean responses, so both types of detection struggle to identify it.
Other Ablations and Analyses
- Number of agents (Fig. 5): Under the default setting, as agents increase from 3 to 6, overall performance gradually declines, with most metrics still above 0.6.
- Agent techniques (Table 4): With ReAct, CoT and Refusal prompts added, ERMAS is 0.771, 0.778 and 0.704 respectively, versus 0.743 for the standard agent; the authors state that reasoning steps may create more opportunities for the attack.
- Number of hookings (Fig. 6): Without hooking, all metrics are below 0.35; a single hooking point performs best, and increasing it further degrades performance due to message congestion.
- qLeak generation method (Table 5): ERMAS for the manual, LLM-assisted and hybrid methods is 0.771, 0.767 and 0.743 respectively, and the authors state that the attack is insensitive to the leak-triggering method.
What are some points that can be further explored?
The authors leave downstream attacks and targeted defenses for future work; the experiments cover four LLMs, five topologies, and five single-agent defenses.
Limitations and Future Directions Noted by the Authors
- Downstream attacks: The authors state that the IP extracted by MASLeak can turn a black-box MAS into a de facto white-box system, thereby supporting downstream attacks such as membership inference, but they explicitly leave exploration of such downstream attacks as future work (Sec. 6.3).
- Targeted defenses: The authors state that future research should develop detection mechanisms that can effectively identify and mitigate such attacks, with possible directions including adversarial training and drawing on intrusion detection from the networked systems field, and leave this as future work (Sec. 7).
- Code and data release: The authors promise to release the code and dataset after the paper is formally published, for academic research use only (Sec. 10); they have not yet been released.
Scope of Experimental Coverage
- The core LLMs tested are 4 in total: GPT-4o, GPT-4o-mini, LLaMA-3.1-70B, Qwen-2.5-72B; the attack sequences for the GCG baseline are computed on LLaMA-3.1-8B (Sec. 5).
- The synthetic MAS covers the three domains of software, finance and healthcare, five topologies, 3–6 agents, 810 applications in total; the real evaluation consists of 10 applications on CrewAI and 10 applications on Coze (Sec. 5, Sec. 6.3).
- The defense evaluation includes three preventive methods (Delimiters, Sandwich, Instructional) and two detection-based methods (Known-answer, PPL), all single-agent defenses; Known-answer detection randomly selects one agent in each system for evaluation (Sec. 7).
- The ablation experiments use GPT-4o-mini and a subset of the three topologies Random, Star, Linear by default (Sec. 6.2).
- The paper does not report the number of repetitions for each experimental condition, nor human evaluation and consistency in metric computation; Coze applications cannot obtain ground truth due to platform limitations, and applications designed by PhD students serve as a reference (Sec. 5).
Summarize the main content of the paper
MASLeak uses worm-like propagation queries to extract the full set of IP from black-box MAS, substantially exceeding baselines on both synthetic and real applications, with existing defenses ineffective.
An attack paper targeting intellectual property extraction from multi-agent systems (MAS). The authors define the MAS's system prompts, task instructions, tool configurations, number of agents and topology as IP, and study whether an attacker under black-box conditions (able to submit inputs only through a public API and observe final outputs, with no internal knowledge) can extract and reconstruct this IP.
- Method: MASLeak draws on the propagation mechanism of computer worms and splits the attack query into three sub-queries: qLeak induces agents to leak IP, qRetain uses a formatted hooking template plus domain-aware fabricated examples to carry the already-leaked content, and qPropagate asks each agent to repeat the attack payload verbatim so as to pass it to the next agent. Queries are generated offline and then extracted online multiple times, after which majority consensus and typed rules are used to reconstruct the complete IP to suppress hallucination.
- Data: The authors built the synthetic dataset MASD, containing 810 MAS applications, covering the three domains of software, finance and healthcare, five topologies, and 3–6 agents; they also evaluated on 10 real applications each on CrewAI and Coze.
- Main results: On the synthetic dataset, MASLeak achieves an average ERMAS of 0.743, while the strongest baseline Handcraft reaches only 0.073 and GCG 0.010 (Table 3); on GPT-4o, agent-count F1num is 0.986 and topology GStopo 0.904 (Table 1).
- Real applications: Average ERMAS is 0.792 on CrewAI and 0.814 on Coze (Tables 6, 7); individual applications are lower, e.g., Screenplay writer on CrewAI at 0.227.
- Defenses: Three preventive and two detection-based single-agent defenses all fail to effectively prevent it; Known-answer detection FNR 81.8%, PPL detection FNR 72.1% (Tables 8, 9).
- Authors' conclusion: The architecture and configuration information of black-box MAS can be extracted with high fidelity, and the extracted IP can also support downstream attacks such as membership inference; the authors call for developing detection and defense mechanisms for MAS, and leave downstream attacks and targeted defenses as future work.