TRACE-MAS:诊断与修复多智能体系统中的协作故障
摘要
TRACE-MAS 是一个用于诊断和修复基于大语言模型的多智能体系统中协作故障的框架。它通过学习正常执行模式、进行来源感知归因并选择最小干预措施,在五个多智能体系统基准测试中将根因定位准确率提高了 60.2%。
查看缓存全文
缓存时间: 2026/11/19 08:59
# TRACE-MAS: Diagnosing and Repairing Collaboration Failures in Multi-Agent Systems
Source: [https://arxiv.org/html/2611.23362](https://arxiv.org/html/2611.23362)
Yihan SunAffiliation:Minzu University of ChinaXunkai LiAffiliation:Beijing Institute of TechnologyXun WuAffiliation:Beijing Institute of TechnologyXinmo JinAffiliation:Beijing Institute of TechnologyYinlin ZhuAffiliation:Sun Yat\-sen UniversityHaodong LuAffiliation:Beijing Institute of TechnologyXuaner ChenAffiliation:Shandong University, WeihaiEmail of Zekai Chen: zackchen02@163\.comRong\-Hua LiAffiliation:Beijing Institute of Technology
###### Abstract
LLM\-based multi\-agent systems \(MAS\) rely on not only individual agent behaviors but also the interactions that connect agents, including message exchanges and task dependencies\. Existing MAS safeguards mainly perform agent\-level anomaly detection, which becomes insufficient when failures originate from agent interactions and detected anomalies do not necessarily reveal their true sources\. To address this limitation, we proposeTRACE\-MAS, a finer\-grained framework for diagnosing and repairing MAS failures\. TRACE\-MAS learns normal collaborative execution patterns from benign trajectories and detects deviations in agent state changes, message transitions, and task dependency evolutions\. It further identifies responsible execution elements through source\-aware attribution and selects minimal interventions to restore collaboration while preserving task\-critical capabilities\. Experiments on five MAS benchmarks demonstrate that TRACE\-MAS significantly improves root\-cause localization accuracy by60\.2% and achieves consistent gains in task recovery over strong MAS safeguards\.
## 1Introduction
LLM\-based multi\-agent systems \(MAS\) coordinate specialized agents through role assignment, communication, tool utilization, and task planning, enabling complex applications such as software development\([Hong et al\., 2024](https://arxiv.org/html/2611.23362#bib.bib1)\), embodied decision making\([Song et al\., 2023](https://arxiv.org/html/2611.23362#bib.bib8)\), and collaborative scientific reasoning\([Tang et al\., 2023](https://arxiv.org/html/2611.23362#bib.bib9)\)\. However, unlike single\-agent systems, MAS performance depends not only on individual agent behaviors, but also on the correct execution of interactions among agents\. These dependencies introduce new attack surfaces: adversaries may inject malicious information into agent prompts or memories\([Chen et al\., 2024](https://arxiv.org/html/2611.23362#bib.bib3)\), manipulate messages exchanged between agents\([He et al\., 2025b](https://arxiv.org/html/2611.23362#bib.bib2)\), or interfere with task assignment and execution dependencies\([Zhou et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib6);[Shahroz et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib7)\)\.
Recent MAS safeguards have substantially improved the detection and mitigation of compromised agents\. Existing approaches mainly identify suspicious agents through interaction structures, observable behaviors, or system\-level signals\([Wang et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib4);[Miao et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib5)\)\. However, these methods are primarily designed around agent\-level anomaly detection: they treat individual agents as the basic detection units and answer the question of*which agent appears abnormal*\. This coarse detection granularity becomes insufficient when failures originate from the interactions among agents rather than the agents themselves\. For example, attackers can modify exchanged messages or disrupt task dependencies, causing normal agents to exhibit abnormal behaviors even though the actual corruption occurs in the collaborative process\. Therefore, a key challenge is to identify corrupted execution elements at a finer granularity, while determining how the corresponding collaboration can be effectively recovered\.
To investigate this challenge, we conduct a diagnostic empirical study in Sec\.[4](https://arxiv.org/html/2611.23362#S4), revealing three connected observations\. ❶Agent\-Level Blind Spot\.Existing defenses are effective when attacks directly modify agent states\. However, MAS execution can also be disrupted by modifying exchanged messages or altering task dependencies without changing individual agent profiles\. As shown in Fig\.[1](https://arxiv.org/html/2611.23362#S4.F1), these execution\-level attacks cause substantial task failures, indicating that agent abnormality alone cannot fully characterize MAS corruption\. ❷Anomaly\-Source Mismatch\.A natural solution is to extend monitoring beyond individual agents\. However, broader anomaly detection still cannot determine where the failure originates\. Once corrupted information propagates through normal collaboration, downstream components may exhibit stronger abnormal signals than the original source\. As shown in Fig\.[2](https://arxiv.org/html/2611.23362#S4.F2), the most abnormal component is not necessarily where collaboration first deviates, demonstrating that anomaly localization and source identification are different objectives\. ❸Repair\-Target Mismatch\.Furthermore, the mismatch between anomaly and source directly limits recovery effectiveness, since repairing the most abnormal component may only remove propagated symptoms, while isolating suspicious components can unnecessarily eliminate useful capabilities\. As shown in Fig\.[3](https://arxiv.org/html/2611.23362#S4.F3), source\-aware repair achieves better recovery with fewer interventions than symptom\-based strategies\. Together, these observations show that existing MAS safeguards are limited by their agent\-level detection granularity, which motivates a finer\-grained modeling of collaborative execution beyond individual agents\. Specifically, TRACE\-MAS considers whether an agent’s internal execution state changes abnormally, whether the information exchanged between agents is inconsistent with expected interactions, and whether task assignments or execution dependencies deviate from normal collaboration patterns\.
Motivated by this perspective, we proposeTRACE\-MAS, a finer\-grained framework for detecting, locating, and repairing MAS failures\. TRACE\-MAS models MAS execution as a structured event process and learns normal execution patterns from benign trajectories\. It detects deviations in agent states, message transitions, and task dependency evolutions, identifies responsible execution elements through source\-aware attribution, and selects minimal interventions to restore collaboration\. By integrating detection, diagnosis, and recovery within a unified execution model, TRACE\-MAS extends MAS safeguarding from identifying abnormal agents to fine\-grained understanding and repairing corrupted collaborative execution\.
Our Contributions\.\(1\) New Problem\.We study execution\-level failure diagnosis and recovery in LLM\-based MAS, where abnormal behaviors may originate from agent states, communication messages, or coordination operations\. We reveal that detected anomalies and actual failure sources may not coincide, limiting existing agent\-centric safeguards\.\(2\) New Framework\.We propose TRACE\-MAS, which learns normal collaborative execution patterns from benign trajectories and performs unified execution\-level detection, source\-aware attribution, and minimal recovery\.\(3\) SOTA Performance\.Experiments on5 benchmarkscovering reasoning, retrieval, and tool\-use MAS under3 attack settingsdemonstrate that TRACE\-MAS outperforms existing MAS safeguards, achieving an average improvement of15\.5 points\.
## 2Problem Formulation
We consider an LLM\-based multi\-agent system with agents𝒜=\{A1,…,AN\}\\mathcal\{A\}=\\\{A\_\{1\},\\ldots,A\_\{N\}\\\}collaboratively solving a taskqqthrough role specialization, message exchange, and task dependencies\. Instead of viewing agents independently, we model MAS execution as a partially ordered event process\. Each event is represented as
et=\(it,rt,qt,xt,ht,mtin,mtout,at,st\),e\_\{t\}=\\big\(i\_\{t\},r\_\{t\},q\_\{t\},x\_\{t\},h\_\{t\},m\_\{t\}^\{\\mathrm\{in\}\},m\_\{t\}^\{\\mathrm\{out\}\},a\_\{t\},s\_\{t\}\\big\),\(1\)whereiti\_\{t\},rtr\_\{t\}, andqtq\_\{t\}denote the agent, role, and subtask;xtx\_\{t\}andhth\_\{t\}represent execution context and agent state;mtinm\_\{t\}^\{\\mathrm\{in\}\}andmtoutm\_\{t\}^\{\\mathrm\{out\}\}denote exchanged messages; andata\_\{t\},sts\_\{t\}describe availability and task progress\. The execution process is organized as a structured graph
𝒢=\(𝒱,ℰmsg∪ℰdep∪ℰtemp\),\\mathcal\{G\}=\\big\(\\mathcal\{V\},\\mathcal\{E\}^\{\\mathrm\{msg\}\}\\cup\\mathcal\{E\}^\{\\mathrm\{dep\}\}\\cup\\mathcal\{E\}^\{\\mathrm\{temp\}\}\\big\),\(2\)where the edges capture message exchange, task dependency, and temporal order, andPa\(t\)\\mathrm\{Pa\}\(t\)denotes the direct predecessors ofete\_\{t\}in𝒢\\mathcal\{G\}\. Let𝐨t=\(Δht,Δmt,Δst\)\\mathbf\{o\}\_\{t\}=\(\\Delta h\_\{t\},\\Delta m\_\{t\},\\Delta s\_\{t\}\)denote the execution transition of eventete\_\{t\}, corresponding to changes in agent states, message interactions, and task progress\. In implementation, textual and structured fields in Eq\. \([1](https://arxiv.org/html/2611.23362#S2.E1)\) are embedded into the contract space as in Appendix[A\.1](https://arxiv.org/html/2611.23362#A1.SS1)\(Eq\. \([13](https://arxiv.org/html/2611.23362#A1.E13)\)\); the transition residualΔet\\Delta e\_\{t\}used in Sec\.[5\.2](https://arxiv.org/html/2611.23362#S5.SS2)denotes the same object as𝐨t\\mathbf\{o\}\_\{t\}\. Under benign collaboration, these transitions follow:
p0\(𝒢∣q\)=∏et∈𝒱p0\(𝐨t∣rt,qt,xt,𝐨Pa\(t\)\),p\_\{0\}\(\\mathcal\{G\}\\mid q\)=\\prod\_\{e\_\{t\}\\in\\mathcal\{V\}\}p\_\{0\}\\left\(\\mathbf\{o\}\_\{t\}\\mid r\_\{t\},q\_\{t\},x\_\{t\},\\mathbf\{o\}\_\{\\mathrm\{Pa\}\(t\)\}\\right\),\(3\)wherep0p\_\{0\}describes normal execution dynamics conditioned on roles, tasks, and preceding events\. Attacks can intervene on different execution elements, including agent states, message transitions, and task dependencies\. We denote the resulting corrupted execution as𝒢~\\widetilde\{\\mathcal\{G\}\}\. Given benign trajectories𝒟0=\{𝒢\(1\),…,𝒢\(M\)\}\\mathcal\{D\}\_\{0\}=\\\{\\mathcal\{G\}^\{\(1\)\},\\ldots,\\mathcal\{G\}^\{\(M\)\}\\\}and an observed execution𝒢~\\widetilde\{\\mathcal\{G\}\}, the objective is to:*\(i\)*detect deviations from normal collaboration;*\(ii\)*identify the responsible execution element rather than propagated effects; and*\(iii\)*restore subsequent execution with minimal intervention\.
## 3Related Work
### 3\.1Attacks on LLM\-based MAS\.
LLM\-based MAS inherit single\-model risks such as jailbreaks and prompt injection\([Perez et al\., 2022](https://arxiv.org/html/2611.23362#bib.bib10);[Wei et al\., 2023](https://arxiv.org/html/2611.23362#bib.bib11);[Greshake et al\., 2023](https://arxiv.org/html/2611.23362#bib.bib24)\), and add new ones through agent interaction\. AgentPoison corrupts agent memory and retrieval\([Chen et al\., 2024](https://arxiv.org/html/2611.23362#bib.bib3)\), AiTM and Prompt Infection show that inter\-agent messages can carry and spread malicious content\([He et al\., 2025b](https://arxiv.org/html/2611.23362#bib.bib2);[Lee et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib25)\), and recent attacks target coordination structures and execution dynamics\([Zhou et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib6)\), whose damage depends on the collaboration topology\([Huang et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib26)\)\. These works analyze specific attack mechanisms, leaving open how to diagnose failures across heterogeneous collaborative executions\.
### 3\.2Safeguarding LLM\-based MAS\.
Existing defenses detect suspicious behaviors and mitigate compromised components\. G\-Safeguard and NetSafe exploit the interaction topology\([Wang et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib4);[Yu et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib27)\), BlindGuard handles unknown attacks\([Miao et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib5)\), AgentMonitor predicts risk from agent\-level signals\([Chan et al\., 2024](https://arxiv.org/html/2611.23362#bib.bib28)\), and single\-agent methods self\-correct through execution feedback\([Shinn et al\., 2023](https://arxiv.org/html/2611.23362#bib.bib12);[Yao et al\., 2023](https://arxiv.org/html/2611.23362#bib.bib13)\)\. Failure\-attribution studies catalogue MAS failure modes\([Cemri et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib32)\)and locate the failing agent or step from logs\([Zhang et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib23);[Zhou et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib20)\), but report where a failure becomes visible rather than repairing where it originates\.Trace\-Mascomplements these efforts by learning benign execution contracts, tracing the initiating violation, and repairing the source that disrupts subsequent execution\.
## 4Empirical Study
Before introducing TRACE\-MAS, we investigate why existing MAS safeguards fail to achieve reliable diagnosis and recovery\. We conduct controlled attacks on agent states, message exchanges, and task dependencies while keeping tasks and system configurations unchanged \(detailed attack protocols are provided in Appendix[B\.4](https://arxiv.org/html/2611.23362#A2.SS4)\)\. As shown in Figs\.[1](https://arxiv.org/html/2611.23362#S4.F1)–[3](https://arxiv.org/html/2611.23362#S4.F3), these studies reveal three connected observations: failures may originate beyond individual agents, observed anomalies may not indicate their sources, and effective recovery requires source\-aware intervention\.
Observation 1: Agent\-centric monitoring misses relational corruption\.Existing safeguards mainly associate MAS failures with abnormal agents\. However, message exchanges and task dependencies can be disrupted without directly modifying agents\. As shown in Fig\.[1](https://arxiv.org/html/2611.23362#S4.F1), when attacks shift from agent states to agent interactions, representative safeguards experience a22\.7\-pointperformance drop under comparable task failures, indicating that agent abnormality alone cannot characterize MAS corruption\.
Observation 2: Observed anomaly does not reveal the root cause\.Extending monitoring beyond agents does not directly solve diagnosis\. Once corruption propagates through normal collaboration, downstream events may exhibit stronger deviations than the original source\. Fig\.[2](https://arxiv.org/html/2611.23362#S4.F2)shows that the maximum\-anomaly event identifies the true source in only32\.1%of cases, with the strongest deviation appearing0\.7 hopsaway from the source on average\. Therefore, anomaly magnitude indicates where failure becomes visible rather than where it originates\.
Observation 3: Symptom repair cannot guarantee recovery\.The mismatch between anomaly and source directly limits recovery\. Repairing the most abnormal event may leave the actual cause unchanged, while isolating suspicious components may remove useful capabilities\. As shown in Fig\.[3](https://arxiv.org/html/2611.23362#S4.F3), source\-aware repair improves task recovery by30\.0 pointsover anomaly\-based repair while requiring50\.0%fewer interventions\.
Figure 1:Agent\-centric monitoring misses relational corruption\. Detection F1 vs\. L1–L3 on GSM8K and CSQA \(matched ASR\); F1 drops 14–30 points while ASR stays flat\.Figure 2:Observed anomaly does not reveal the root cause\. Source hit rate and hop offset on HotPotQA; magnitude monitors≤\\leq32\.1%, TRACE\-MAS 72\.5%\.Figure 3:Symptom repair cannot guarantee recovery\. Task EM, hop to source, and symptom budgetBB; source repair hits 100% EM, extra symptom steps do not help\.
Figure 4:Overview of TRACE\-MAS\. Partial\-order event graph and shared contracts for detection, source attribution, and repair\.
## 5Methodology
### 5\.1Overview
As illustrated in Fig\.[4](https://arxiv.org/html/2611.23362#S4.F4), TRACE\-MAS builds a single execution contract that characterizes how reliable collaboration should evolve, and reuses it for three purposes: learning the benign execution manifold conditioned on roles, tasks, and past interactions \(Sec\.[5\.2](https://arxiv.org/html/2611.23362#S5.SS2)\); attributing observed deviations to the execution element whose restoration removes them \(Sec\.[5\.3](https://arxiv.org/html/2611.23362#S5.SS3)\); and selecting the minimal intervention that returns future execution to that manifold \(Sec\.[5\.4](https://arxiv.org/html/2611.23362#S5.SS4)\)\.
### 5\.2Execution Contract Learning
Motivation\.Observation 1 shows that agent\-level abnormality cannot characterize MAS failures, since correctness also depends on message interactions and task dependencies\.Trace\-Mastherefore learns a conditional contract for how each event should evolve under its collaborative context\.
Execution Context Encoding\.Trace\-Masaggregates upstream execution with a relation\-aware encoder,
ct=ExecFormer\(et,\{\(ej,ρjt\)∣ej∈Pa\(t\)\}\),c\_\{t\}=\\mathrm\{ExecFormer\}\\bigl\(e\_\{t\},\\\{\(e\_\{j\},\\rho\_\{jt\}\)\\mid e\_\{j\}\\in\\mathrm\{Pa\}\(t\)\\\}\\bigr\),\(4\)wherePa\(t\)\\mathrm\{Pa\}\(t\)are the direct predecessors of eventete\_\{t\}\(Sec\. 2\) andρjt\\rho\_\{jt\}is the relation type \(message, task dependency, or temporal order\)\.
Uncertainty\-aware Execution Contract\.As roles and tasks legitimately vary, the contract is a conditional distribution fit on benign trajectories only:
pθ\(Δet∣ct\)=𝒩\(μt,Σt\),ℒcon=−∑G∈𝒟0∑et∈Glogpθ\(Δet∣ct\),p\_\{\\theta\}\(\\Delta e\_\{t\}\\mid c\_\{t\}\)=\\mathcal\{N\}\(\\mu\_\{t\},\\Sigma\_\{t\}\),\\qquad\\mathcal\{L\}\_\{\\mathrm\{con\}\}=\-\\textstyle\\sum\_\{G\\in\\mathcal\{D\}\_\{0\}\}\\sum\_\{e\_\{t\}\\in G\}\\log p\_\{\\theta\}\(\\Delta e\_\{t\}\\mid c\_\{t\}\),\(5\)whereΔet=\(Δht,Δmt,Δst\)\\Delta e\_\{t\}=\(\\Delta h\_\{t\},\\Delta m\_\{t\},\\Delta s\_\{t\}\)collects the agent\-state, message, and task\-progress changes, with meanμt\\mu\_\{t\}and adaptive uncertaintyΣt\\Sigma\_\{t\}\. The violation score is
V\(et\)=\(Δe~t−μt\)⊤Σt−1\(Δe~t−μt\),V\(e\_\{t\}\)=\(\\widetilde\{\\Delta e\}\_\{t\}\-\\mu\_\{t\}\)^\{\\top\}\\Sigma\_\{t\}^\{\-1\}\(\\widetilde\{\\Delta e\}\_\{t\}\-\\mu\_\{t\}\),\(6\)whereΔe~t\\widetilde\{\\Delta e\}\_\{t\}is observed in the test trajectoryG~\\tilde\{G\}; its message and progress terms are weighted by\(β,γ\)\(\\beta,\\gamma\)\(Appendix[A\.5](https://arxiv.org/html/2611.23362#A1.SS5)\), andG~\\tilde\{G\}is flagged whenmaxetV\(et\)\>τ\\max\_\{e\_\{t\}\}V\(e\_\{t\}\)\>\\tau\.
### 5\.3Violation Source Attribution
Motivation\.Observation 2 shows that corruption propagates through benign interactions, so a downstream event can deviate more than the origin\.Trace\-Mastherefore tests whether restoring a candidate recovers the subsequent execution\.
Source Restoration Analysis\.Violated events areΩ=\{et∣V\(et\)\>τ\}\\Omega=\\\{e\_\{t\}\\mid V\(e\_\{t\}\)\>\\tau\\\}, withτ=α⋅Quantileδ\(\{V\(e\)\}e∈𝒟val\)\\tau=\\alpha\\cdot\\mathrm\{Quantile\}\_\{\\delta\}\(\\\{V\(e\)\\\}\_\{e\\in\\mathcal\{D\}\_\{\\mathrm\{val\}\}\}\)theα\\alpha\-scaledδ\\delta\-quantile of benign validation scores \(Appendix[A\.9](https://arxiv.org/html/2611.23362#A1.SS9)\)\. Each candidatec∈𝒞c\\in\\mathcal\{C\}, an event ofΩ\\Omegaor one of itsHH\-hop ancestors, receives the contract expectation under its contextccc\_\{c\}:
Δecres=𝔼pθ\[Δec∣cc\]=μc,Gcres=Restorec\(G~,Δecres\),\\Delta e^\{\\mathrm\{res\}\}\_\{c\}=\\mathbb\{E\}\_\{p\_\{\\theta\}\}\[\\Delta e\_\{c\}\\mid c\_\{c\}\]=\\mu\_\{c\},\\quad G^\{\\mathrm\{res\}\}\_\{c\}=\\mathrm\{Restore\}\_\{c\}\(\\tilde\{G\},\\Delta e^\{\\mathrm\{res\}\}\_\{c\}\),\(7\)whereRestorec\\mathrm\{Restore\}\_\{c\}propagates the restored state downstream in contract space without LLM calls \(Appendix[A\.6\.2](https://arxiv.org/html/2611.23362#A1.SS6.SSS2)\)\.
Responsibility Attribution\.WithVcres\(ej\)V^\{\\mathrm\{res\}\}\_\{c\}\(e\_\{j\}\)the score recomputed onGcresG^\{\\mathrm\{res\}\}\_\{c\},V~c\(ej\)=ωVcres\(ej\)\+\(1−ω\)V\(ej\)\\tilde\{V\}\_\{c\}\(e\_\{j\}\)=\\omega V^\{\\mathrm\{res\}\}\_\{c\}\(e\_\{j\}\)\+\(1\-\\omega\)V\(e\_\{j\}\), andwj=ψd\(c,ej\)w\_\{j\}=\\psi^\{\\,d\(c,e\_\{j\}\)\}for hop distancedd,
R\(c\)=∑ej∈\{c\}∪Desc\(c\)wj\[V\(ej\)−V~c\(ej\)\]−λpen𝒫\(c\),c⋆=argmaxc∈𝒞R\(c\),R\(c\)=\\\!\\\!\\sum\_\{e\_\{j\}\\in\\\{c\\\}\\cup\\mathrm\{Desc\}\(c\)\}\\\!\\\!w\_\{j\}\\bigl\[V\(e\_\{j\}\)\-\\tilde\{V\}\_\{c\}\(e\_\{j\}\)\\bigr\]\-\\lambda\_\{\\mathrm\{pen\}\}\\mathcal\{P\}\(c\),\\qquad c^\{\\star\}=\\arg\\max\_\{c\\in\\mathcal\{C\}\}R\(c\),\(8\)whereDesc\(c\)\\mathrm\{Desc\}\(c\)are the strict descendants ofcc,ψ,ω∈\(0,1\]\\psi,\\omega\\in\(0,1\]are the hop decay and evidence gate, and𝒫\(c\)\\mathcal\{P\}\(c\)penalizes dependency or ordering violations \(Appendix[A\.6\.3](https://arxiv.org/html/2611.23362#A1.SS6.SSS3)\)\.R\(c\)R\(c\)is thus the hop\-discounted violation drop on the branch rooted atcc, so the selected event explains the most propagated violation rather than deviating most\.
### 5\.4Contract Restoration
Motivation\.Observation 3 shows that repairing a visible anomaly may fail while the true source remains unchanged\.Trace\-Mastherefore selects the intervention that returns future execution toward normality with minimal change\.
Intervention\-aware Future Rollout\.Givenc⋆c^\{\\star\},Trace\-Masbuilds a repair space𝒰\(c⋆\)\\mathcal\{U\}\(c^\{\\star\}\)\(state recovery, message correction, dependency adjustment\) and predicts theKK\-step future of eachuufrom the repaired stepttasG^t:t\+Ku=Rollout\(G~,u,pθ\)\\hat\{G\}^\{u\}\_\{t:t\+K\}=\\mathrm\{Rollout\}\(\\tilde\{G\},u,p\_\{\\theta\}\), with predicted eventse^iu\\hat\{e\}^\{u\}\_\{i\}\.
Minimal Contract Restoration\.The committed intervention minimizes residual violation, task degradation, and edit cost,
u⋆=argminu∈𝒰\(c⋆\)\[∑i=tt\+KV\(e^iu\)\+λ1ℒtask\(u\)\+λ2κ\(u\)\],u^\{\\star\}=\\arg\\min\_\{u\\in\\mathcal\{U\}\(c^\{\\star\}\)\}\\left\[\\sum\_\{i=t\}^\{t\+K\}V\(\\hat\{e\}^\{u\}\_\{i\}\)\+\\lambda\_\{1\}\\mathcal\{L\}\_\{\\mathrm\{task\}\}\(u\)\+\\lambda\_\{2\}\\kappa\(u\)\\right\],\(9\)whereℒtask\\mathcal\{L\}\_\{\\mathrm\{task\}\}is the fraction of workflow\-template steps the rollout leaves unsatisfied,κ\(u\)\\kappa\(u\)the operator count, andλ1,λ2\\lambda\_\{1\},\\lambda\_\{2\}trade\-off weights \(Appendix[A\.7\.3](https://arxiv.org/html/2611.23362#A1.SS7.SSS3)\); only the branches thatu⋆u^\{\\star\}affects are regenerated\.
## 6Experiments
In this section, we conduct a comprehensive evaluation of TRACE\-MAS to answer the following research questions\.Q1: Detection Performance\.Can TRACE\-MAS accurately detect execution failures across different attack types?Q2: Source Localization\.Can TRACE\-MAS identify the true failure source rather than propagated anomalies?Q3: Recovery Effectiveness\.Can TRACE\-MAS restore collaboration with fewer interventions while preserving task performance?Q4: Calibration and Robustness\.Can TRACE\-MAS be calibrated from benign logs alone, remain stable under standard hyperparameters, and keep reliable detection under deployment shifts?Q5: Runtime Overhead\.Is the non\-LLM cost of monitoring, attribution, and repair scoring practical when layered on standard MAS rollouts?
### 6\.1Experimental Setup
We evaluate on five public LLM\-based MAS benchmarks—GSM8K\([Cobbe et al\., 2021](https://arxiv.org/html/2611.23362#bib.bib16)\)and CSQA\([Talmor et al\., 2019](https://arxiv.org/html/2611.23362#bib.bib17)\)\(multi\-agent reasoning\), HotPotQA\([Yang et al\., 2018](https://arxiv.org/html/2611.23362#bib.bib18)\)and PoisonRAG\([Zou et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib19)\)\(retrieval\-based collaboration\), and InjecAgent\([Zhan et al\., 2024](https://arxiv.org/html/2611.23362#bib.bib22)\)\(tool use\)—under controlled L1–L3 corruptions on shared role graphs and splits\. We report trajectory\-level detection, root\-cause localization, and task\-preserving recovery\. Following prior attack–defense evaluations, we compare TRACE\-MAS with interaction\-graph monitors \(BlindGuard\([Miao et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib5)\), G\-Safeguard\([Wang et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib4)\)\), trust\- and agent\-centric safeguards \(A\-Trust\([He et al\., 2025a](https://arxiv.org/html/2611.23362#bib.bib15)\), AgentSafe\([Mao et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib21)\)\), activation\-centric MAS monitors\(AcMAS\(\-R\)\([Xu et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib14)\)\), and Oracle Anomaly Ranking\. All methods share the same backbone LLM, MAS templates, attack injections, and benign\-train / validation\-calibration / attacked\-test splits; baseline details, monitor variants, and calibration defaults are in Appendix[B](https://arxiv.org/html/2611.23362#A2)\(Sec\. B\.5\) and Appendix[A](https://arxiv.org/html/2611.23362#A1)\.
### 6\.2Overall Performance \(Q1\)
To answerQ1, we compare TRACE\-MAS with the baselines in Sec\.[6\.1](https://arxiv.org/html/2611.23362#S6.SS1)under the shared L1–L3 protocol\. As shown in Table[1](https://arxiv.org/html/2611.23362#S6.T1), TRACE\-MAS achieves the highest trajectory F1 in every benchmark×\\timeslevel cell, improving over the strongest competing method by15\.5points on average \(per cell\) and by up to62\.1points on PoisonRAG at Level 3\. Notably, TRACE\-MAS remains above52F1 on GSM8K and CSQA under Level 2–3 while graph monitors and activation\-centric methods often fall below20F1 when corruption targets messages or dependencies rather than agent states\. Together, the table supports learning benign state, message, and completion contracts and flagging violationsV\(et\)V\(e\_\{t\}\)on the event graph for reliable execution\-level detection across corruption types\.
Table 1:Detection on five benchmarks under L1–L3 attacks \(trajectory F1 and AUROC; mean±\\pmstd\)\.Boldbest andunderlinedsecond\-best per column; shared splits and calibration\.
### 6\.3Root\-Cause Localization \(Q2\)
To answerQ2, we measure Hit@1 and hop distance to the labeled initiating eventcgtc^\{\\mathrm\{gt\}\}under the same injections as in Q1 \(Table[2](https://arxiv.org/html/2611.23362#S6.T2)\)\. TRACE\-MAS ranks first on both metrics on every dataset, improving average Hit@1 by28\.0points over the baseline with the highest average \(AcMAS\) and reaching86\.7% Hit@1 with0\.18hops on PoisonRAG\. On HotPotQA it attains71\.1% Hit@1 where the strongest activation\-centric baseline remains at23\.3%\. The gains align with attributing failures via counterfactual violation dropR\(c\)R\(c\)after contractRestore, instead of treating the largest downstream residual as the initiating event\. Alert\-pool diagnosis dominates the non\-LLM cost at this stage; Q5 \(Figure[6](https://arxiv.org/html/2611.23362#S6.F6)\) shows that a small candidate capCCpreserves most of this Hit@1 while substantially reducing diagnosis wall time\.
Table 2:Root\-cause localization: Hit@1 and mean hop distance to the labeled initiating eventcgtc^\{\\mathrm\{gt\}\}\.
### 6\.4Task\-Preserving Recovery \(Q3\)
Repair results\.To answerQ3, we evaluate post\-alert recovery on attacked test trajectories under abalancedL1–L3 attack mix \(pooled across levels, unlike the level\-wise rows in Table[1](https://arxiv.org/html/2611.23362#S6.T1)\)\. Table[3](https://arxiv.org/html/2611.23362#S6.T3)reports ASR and task ACC after TRACE\-MAS commits one repair at the attributed source; TCR and mean operator cost are in Appendix Table[9](https://arxiv.org/html/2611.23362#A2.T9)\(Appendix[B\.7\.4](https://arxiv.org/html/2611.23362#A2.SS7.SSS4)\)\. TRACE\-MAS achieves the best ASR and ACC on every benchmark \(e\.g\., PoisonRAG ASR3\.0%, ACC93\.8%\), and Appendix Table[9](https://arxiv.org/html/2611.23362#A2.T9)shows the strongest TCR–cost trade\-off \(PoisonRAG TCR82\.9%, cost0\.54\), whereas retry\-based recovery \(AcMAS\-R\) and agent\-level sanitization or trust\-based exclusion \(AgentSafe, A\-Trust\) lag on utility or intervention cost under the same balanced\-attack protocol\. Predictive contract repair atc⋆c^\{\\star\}therefore restores collaboration with minimal intervention, whereas quarantining agents or patching downstream symptoms alone does not reach the same utility–cost balance\.
Table 3:Post\-defense ASR and task ACC on attacked trajectories\.Ablation study\.Building on the recovery results, we ablate the key designs of TRACE\-MAS in Table[4](https://arxiv.org/html/2611.23362#S6.T4), retraining each variant end to end on benign data with the same schedule as the full model\. We replace the shared relation\-aware contract with independent per\-agent encoders, substitute absolute\-embedding scoring for transition residuals, remove contract\-based violation alerting, and replace rollout\-based repair ranking with fixed operators\. The resulting rows isolate how unified execution modeling, residual transition contracts, the alert–attribute loop, and predictive repair selection contribute to the detection, localization, and recovery trends reported in Q1–Q3\.
Table 4:Ablation—one core module removed per row, each retrained end to end as Full and evaluated on balanced L1–L3 pooled splits\.
### 6\.5Calibration Convergence and Sensitivity \(Q4\)
To answerQ4, we study benign\-only calibration, standard hyperparameter choices, and deployment stress factors\.
Benign\-only calibration\.We fit contracts and refresh the alert thresholdτ\\taufrom held\-out benign trajectories only \(k∈\[30,150\]k\\in\[30,150\]calibration rounds; no attack labels for TRACE\-MAS\)\. Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)\(a–b\) reports detection F1 on GSM8K and CSQA: TRACE\-MAS gains F1 faster and saturates higher than interaction\-graph, activation\-centric, and trust\-centric monitors\.
Threshold scaleα\\alpha\.We perform a hyperparameter sensitivity sweep on the alert scaleα\\alphainτ=α⋅Quantileδ\(⋅\)\\tau=\\alpha\\cdot\\mathrm\{Quantile\}\_\{\\delta\}\(\\cdot\)overα∈\{0\.8,0\.9,1\.0,1\.1,1\.2\}\\alpha\\in\\\{0\.8,0\.9,1\.0,1\.1,1\.2\\\}, with\(β,γ\)\(\\beta,\\gamma\)fixed at their defaults and contracts calibrated as in the main protocol\. Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)\(c\) plots trajectory\-level detection F1 againstα\\alpha, withone line per benchmark; all curves peak at the defaultα=1\\alpha\{=\}1and change by only about1–2F1 points across the sweep, indicating mild sensitivity to threshold scaling on every workflow\.
Contract weights\(β,γ\)\(\\beta,\\gamma\)\.We perturb the message\- and completion\-violation weights around\(β,γ\)=\(1,0\.5\)\(\\beta,\\gamma\)=\(1,0\.5\)on HotPotQA benign validation\. Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)\(d\) exhibits a wide high\-F1 region near the default, indicating modest sensitivity to these weights in standard settings\.
Deployment stress tests\.We further stress\-test detection under alert delay, agent scale, dynamic edges, and execution imbalance; full curves and baseline comparisons are in Figs\.[7](https://arxiv.org/html/2611.23362#A3.F7)–[11](https://arxiv.org/html/2611.23362#A3.F11)\.
Together, the calibration and sensitivity panels in Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)support fitting TRACE\-MAS from benign logs with a quantile threshold onmaxtV\(et\)\\max\_\{t\}V\(e\_\{t\}\), without attack labels during threshold selection\.
\(a\)GSM8K, F1\(b\)CSQA, F1\(c\)F1 vs\.α\\alpha\(d\)F1 vs\.β\\betaandγ\\gamma
Figure 5:Benign calibration and hyperparameter sensitivity\.
### 6\.6Runtime Overhead \(Q5\)
To answerQ5, we profile the non\-LLM wall\-clock cost of contract alerting, gated counterfactual diagnosis on the alert pool, and rollout\-based repair scoring in Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\(bulk LLM generation is excluded because it dominates standard MAS rollouts and is invoked only for committed repairs\)\.
Detection\-stage overhead\.Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\(a\) breaks down per\-trajectory contract scoring and graph maintenance; this stage is lightweight relative to downstream diagnosis because it reuses cached event features from logging\.
Alert\-pool diagnosis\.We vary the counterfactual candidate capCCon the alert\-triggered pool\. Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\(b\) shows thatC=4C\{=\}4retains75\.3% Hit@1 while cutting diagnosis time by about3\.4×\\timesversusC=16C\{=\}16, matching the gated pool design used after contract alerts in Q2\.
Repair\-pool scoring\.We vary rollout depthKKwhen ranking repair operators on the repair pool\. Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\(c\) shows that TCR on the attack\-successful repair pool of Q3 is unchanged fromK=1K\{=\}1toK=6K\{=\}6while scoring cost grows withKK, so we useK=1K\{=\}1\(Appendix[A\.9](https://arxiv.org/html/2611.23362#A1.SS9)\)\.
\(a\)Detection\(b\)Diagnosis, C\(c\)Repair, K
Figure 6:Runtime overhead of TRACE\-MAS\.
## 7Conclusion
In this work, we study collaboration failures in LLM\-based multi\-agent systems from an execution\-centric perspective\. We reveal that the attacked component, observed anomaly, and optimal repair target may not coincide during collaborative execution\. To address this gap, we propose TRACE\-MAS, which learns benign execution contracts and unifies violation detection, counterfactual root\-cause attribution, and task\-preserving recovery within a shared execution model\. Experiments across diverse MAS benchmarks demonstrate that TRACE\-MAS achieves more accurate failure diagnosis and effective recovery with minimal intervention\. Future work will investigate adaptive execution contracts under open\-ended environments where collaboration structures and agent behaviors continuously evolve\.
## AI Usage Disclosure
Generative AI tools were used during the preparation of this manuscript for limited purposes, including language refinement, literature retrieval and discovery, and research ideation support\. Specifically, AI tools assisted with improving writing clarity, organizing related work, exploring potential research directions, and discussing possible methodological designs and experimental considerations\.
## References
- Angelopoulos and Bates \(2021\)A\. N\. Angelopoulos and S\. BatesA gentle introduction to conformal prediction and distribution\-free uncertainty quantification\.arXiv preprint arXiv:2107\.07511\.Cited by:[§D\.2](https://arxiv.org/html/2611.23362#A4.SS2.p5.1)\.
- Budhathokiet al\.\(2022\)K\. Budhathoki, L\. Minorics, P\. Blöbaum, and D\. JanzingCausal structure\-based root cause analysis of outliers\.InInternational Conference on Machine Learning,Cited by:[§D\.3](https://arxiv.org/html/2611.23362#A4.SS3.p2.3)\.
- Cemriet al\.\(2025\)M\. Cemri, M\. Z\. Pan, S\. Yang, L\. A\. Agrawal, B\. Chopra, R\. Tiwari, K\. Keutzer, A\. Parameswaran, D\. Klein, K\. Ramchandran,et al\.Why do multi\-agent LLM systems fail?\.InAdvances in Neural Information Processing Systems \(Datasets and Benchmarks Track\),Cited by:[§B\.1](https://arxiv.org/html/2611.23362#A2.SS1.p2.1.1),[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1)\.
- Chanet al\.\(2024\)C\. Chan, J\. Yu, W\. Chen, C\. Jiang, X\. Liu, W\. Shi, Z\. Liu, W\. Xue, and Y\. GuoAgentmonitor: a plug\-and\-play framework for predictive and secure multi\-agent systems\.arXiv preprint arXiv:2408\.14972\.Cited by:[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1)\.
- Chenet al\.\(2024\)Z\. Chen, Z\. Xiang, C\. Xiao, D\. Song, and B\. LiAgentPoison: red\-teaming llm agents via poisoning memory or knowledge bases\.InAdvances in Neural Information Processing Systems,Vol\.37\.Cited by:[§1](https://arxiv.org/html/2611.23362#S1.p1.1),[§3\.1](https://arxiv.org/html/2611.23362#S3.SS1.p1.1)\.
- Cobbeet al\.\(2021\)K\. Cobbe, V\. Kosaraju, M\. Bavarian, M\. Chen, H\. Jun, L\. Kaiser, M\. Plappert, J\. Tworek, J\. Hilton, R\. Nakano, C\. Hesse, and J\. SchulmanTraining verifiers to solve math word problems\.External Links:2110\.14168,[Link](https://arxiv.org/abs/2110.14168)Cited by:[§B\.2](https://arxiv.org/html/2611.23362#A2.SS2.p2.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Duet al\.\(2024\)Y\. Du, S\. Li, A\. Torralba, J\. B\. Tenenbaum, and I\. MordatchImproving factuality and reasoning in language models through multiagent debate\.InInternational Conference on Machine Learning,Cited by:[§B\.2](https://arxiv.org/html/2611.23362#A2.SS2.p3.1)\.
- Greshakeet al\.\(2023\)K\. Greshake, S\. Abdelnabi, S\. Mishra, C\. Endres, T\. Holz, and M\. FritzNot what you’ve signed up for: compromising real\-world LLM\-integrated applications with indirect prompt injection\.InProceedings of the 16th ACM Workshop on Artificial Intelligence and Security,pp\. 79–90\.Cited by:[§3\.1](https://arxiv.org/html/2611.23362#S3.SS1.p1.1)\.
- Heet al\.\(2025a\)P\. He, Z\. Dai, X\. Tang, Y\. Xing, H\. Liu, J\. Zeng, Q\. Peng, S\. Agrawal, S\. Varshney, S\. Wang, J\. Tang, and Q\. HeTo trust or not to trust: Attention\-based Trust Management for LLM Multi\-Agent Systems\.arXiv e\-prints,pp\. arXiv:2506\.02546\.External Links:[Document](https://dx.doi.org/10.48550/arXiv.2506.02546),2506\.02546Cited by:[§B\.5](https://arxiv.org/html/2611.23362#A2.SS5.p5.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Heet al\.\(2025b\)P\. He, Y\. Lin, S\. Dong, H\. Xu, Y\. Xing, and H\. LiuRed\-teaming llm multi\-agent systems via communication attacks\.InFindings of the Association for Computational Linguistics: ACL 2025,pp\. 6726–6747\.External Links:[Document](https://dx.doi.org/10.18653/v1/2025.findings-acl.349)Cited by:[§1](https://arxiv.org/html/2611.23362#S1.p1.1),[§3\.1](https://arxiv.org/html/2611.23362#S3.SS1.p1.1)\.
- Honget al\.\(2024\)S\. Hong, M\. Zhuge, J\. Chen, X\. Zheng, Y\. Cheng, J\. Wang, C\. Zhang, Z\. Wang, S\. K\. S\. Yau, Z\. Lin, L\. Zhou, C\. Ran, L\. Xiao, C\. Wu, and J\. SchmidhuberMetaGPT: meta programming for a multi\-agent collaborative framework\.InInternational Conference on Learning Representations,Cited by:[§1](https://arxiv.org/html/2611.23362#S1.p1.1)\.
- Huanget al\.\(2025\)J\. Huang, J\. Zhou, T\. Jin, X\. Zhou, Z\. Chen, W\. Wang, Y\. Yuan, M\. R\. Lyu, and M\. SapOn the resilience of LLM\-based multi\-agent collaboration with faulty agents\.InInternational Conference on Machine Learning,Cited by:[§3\.1](https://arxiv.org/html/2611.23362#S3.SS1.p1.1)\.
- Leeet al\.\(2025\)D\. Lee, M\. Tiwari, and B\. MirandaPrompt infection: llm\-to\-llm prompt injection within multi\-agent systems\.InEuropean Symposium on Research in Computer Security,pp\. 511–520\.Cited by:[§3\.1](https://arxiv.org/html/2611.23362#S3.SS1.p1.1)\.
- Leeet al\.\(2018\)K\. Lee, K\. Lee, H\. Lee, and J\. ShinA simple unified framework for detecting out\-of\-distribution samples and adversarial attacks\.InAdvances in Neural Information Processing Systems,Cited by:[§D\.2](https://arxiv.org/html/2611.23362#A4.SS2.p9.1)\.
- Loshchilov and Hutter \(2019\)I\. Loshchilov and F\. HutterDecoupled weight decay regularization\.InInternational Conference on Learning Representations,Cited by:[§A\.4](https://arxiv.org/html/2611.23362#A1.SS4.p4.2)\.
- Maoet al\.\(2025\)J\. Mao, F\. Meng, Y\. Duan, M\. Yu, X\. Jia, J\. Fang, Y\. Liang, K\. Wang, and Q\. WenAgentsafe: safeguarding large language model\-based multi\-agent systems via hierarchical data management\.arXiv preprint arXiv:2503\.04392\.Cited by:[§B\.5](https://arxiv.org/html/2611.23362#A2.SS5.p6.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Miaoet al\.\(2026\)R\. Miao, Y\. Liu, Y\. Wang, X\. Shen, Y\. Tan, Y\. Dai, S\. Pan, and X\. WangBlindGuard: safeguarding llm\-based multi\-agent systems under unknown attacks\.InProceedings of the 64th Annual Meeting of the Association for Computational Linguistics,pp\. 39215–39234\.External Links:[Document](https://dx.doi.org/10.18653/v1/2026.acl-long.1819)Cited by:[§B\.5](https://arxiv.org/html/2611.23362#A2.SS5.p3.1),[§1](https://arxiv.org/html/2611.23362#S1.p2.1),[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Perezet al\.\(2022\)E\. Perez, S\. Huang, F\. Song, T\. Cai, R\. Ring, J\. Aslanides, A\. Glaese, S\. McAleer, and G\. IrvingRed teaming language models with language models\.arXiv preprint arXiv:2202\.03286\.Cited by:[§3\.1](https://arxiv.org/html/2611.23362#S3.SS1.p1.1)\.
- Qwen Team \(2024\)Qwen TeamQwen2\.5 technical report\.arXiv preprint arXiv:2412\.15115\.Cited by:[§B\.7\.1](https://arxiv.org/html/2611.23362#A2.SS7.SSS1.p2.1)\.
- Reimers and Gurevych \(2019\)N\. Reimers and I\. GurevychSentence\-BERT: sentence embeddings using Siamese BERT\-networks\.InProceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing \(EMNLP\-IJCNLP\),pp\. 3982–3992\.Cited by:[§A\.3](https://arxiv.org/html/2611.23362#A1.SS3.p1.1)\.
- Shahrozet al\.\(2025\)R\. Shahroz, Z\. Tan, S\. Yun, C\. Fleming, and T\. ChenAgents under siege: breaking pragmatic multi\-agent llm systems with optimized prompt attacks\.InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics,pp\. 9661–9674\.External Links:[Document](https://dx.doi.org/10.18653/v1/2025.acl-long.476)Cited by:[§1](https://arxiv.org/html/2611.23362#S1.p1.1)\.
- Shinnet al\.\(2023\)N\. Shinn, F\. Cassano, A\. Berman, A\. Gopinath, K\. Narasimhan, and S\. YaoReflexion: language agents with verbal reinforcement learning\.InAdvances in Neural Information Processing Systems,Vol\.36\.Cited by:[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1)\.
- Songet al\.\(2023\)C\. H\. Song, J\. Wu, C\. Washington, B\. M\. Sadler, W\. Chao, and Y\. SuLLM\-planner: few\-shot grounded planning for embodied agents with large language models\.InProceedings of the IEEE/CVF International Conference on Computer Vision,pp\. 2998–3009\.Cited by:[§1](https://arxiv.org/html/2611.23362#S1.p1.1)\.
- Talmoret al\.\(2019\)A\. Talmor, J\. Herzig, N\. Lourie, and J\. BerantCommonsenseQA: a question answering challenge targeting commonsense knowledge\.InProceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 \(Long and Short Papers\),Minneapolis, Minnesota,pp\. 4149–4158\.External Links:[Document](https://dx.doi.org/10.18653/v1/N19-1421),[Link](https://aclanthology.org/N19-1421/)Cited by:[§B\.2](https://arxiv.org/html/2611.23362#A2.SS2.p3.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Tanget al\.\(2023\)X\. Tang, A\. Zou, Z\. Zhang, Z\. Li, Y\. Zhao, X\. Zhang, A\. Cohan, and M\. GersteinMedAgents: large language models as collaborators for zero\-shot medical reasoning\.arXiv preprint arXiv:2311\.10537\.Cited by:[§1](https://arxiv.org/html/2611.23362#S1.p1.1)\.
- Vovket al\.\(2005\)V\. Vovk, A\. Gammerman, and G\. ShaferAlgorithmic learning in a random world\.Springer\.Cited by:[§D\.2](https://arxiv.org/html/2611.23362#A4.SS2.p5.1)\.
- Wanget al\.\(2025\)S\. Wang, G\. Zhang, M\. Yu, G\. Wan, F\. Meng, C\. Guo, K\. Wang, and Y\. WangG\-safeguard: a topology\-guided security lens and treatment on llm\-based multi\-agent systems\.InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics,pp\. 7261–7276\.External Links:[Document](https://dx.doi.org/10.18653/v1/2025.acl-long.359)Cited by:[§B\.5](https://arxiv.org/html/2611.23362#A2.SS5.p4.1),[§1](https://arxiv.org/html/2611.23362#S1.p2.1),[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Weiet al\.\(2023\)A\. Wei, N\. Haghtalab, and J\. SteinhardtJailbroken: how does llm safety training fail?\.InAdvances in Neural Information Processing Systems,Vol\.36\.Cited by:[§3\.1](https://arxiv.org/html/2611.23362#S3.SS1.p1.1)\.
- Xuet al\.\(2026\)H\. Xu, X\. Tan, L\. Ma, Z\. Zhang, C\. Wang, Q\. Wang, P\. Chen, J\. Dai, and X\. SunWhen agents go rogue: activation\-based detection of malicious behaviors in multi\-agent systems\.arXiv preprint arXiv:2607\.06807\.Cited by:[§B\.5](https://arxiv.org/html/2611.23362#A2.SS5.p2.1),[§B\.6](https://arxiv.org/html/2611.23362#A2.SS6.p4.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Yanget al\.\(2018\)Z\. Yang, P\. Qi, S\. Zhang, Y\. Bengio, W\. Cohen, R\. Salakhutdinov, and C\. D\. ManningHotpotQA: a dataset for diverse, explainable multi\-hop question answering\.InProceedings of the 2018 Conference on Empirical Methods in Natural Language Processing,E\. Riloff, D\. Chiang, J\. Hockenmaier, and J\. Tsujii \(Eds\.\),Brussels, Belgium,pp\. 2369–2380\.External Links:[Link](https://aclanthology.org/D18-1259/),[Document](https://dx.doi.org/10.18653/v1/D18-1259)Cited by:[§B\.2](https://arxiv.org/html/2611.23362#A2.SS2.p4.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Yaoet al\.\(2023\)S\. Yao, J\. Zhao, D\. Yu, N\. Du, I\. Shafran, K\. Narasimhan, and Y\. CaoReAct: synergizing reasoning and acting in language models\.InInternational Conference on Learning Representations,Cited by:[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1)\.
- Yuet al\.\(2025\)M\. Yu, S\. Wang, G\. Zhang, J\. Mao, C\. Yin, Q\. Liu, K\. Wang, Q\. Wen, and Y\. WangNetSafe: exploring the topological safety of multi\-agent system\.InFindings of the Association for Computational Linguistics: ACL 2025,pp\. 2905–2938\.Cited by:[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1)\.
- Zhanet al\.\(2024\)Q\. Zhan, Z\. Liang, Z\. Ying, and D\. KangInjecagent: benchmarking indirect prompt injections in tool\-integrated large language model agents\.InFindings of the Association for Computational Linguistics: ACL 2024,pp\. 10471–10506\.Cited by:[§B\.2](https://arxiv.org/html/2611.23362#A2.SS2.p6.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
- Zhanget al\.\(2025\)S\. Zhang, M\. Yin, J\. Zhang, J\. Liu, Z\. Han, J\. Zhang, B\. Li, C\. Wang, H\. Wang, Y\. Chen, and Q\. WuWhich agent causes task failures and when? On automated failure attribution of LLM multi\-agent systems\.InProceedings of the 42nd International Conference on Machine Learning,Proceedings of Machine Learning Research, Vol\.267,pp\. 76583–76599\.External Links:[Link](https://proceedings.mlr.press/v267/zhang25cq.html)Cited by:[§B\.1](https://arxiv.org/html/2611.23362#A2.SS1.p2.1.1),[§B\.1](https://arxiv.org/html/2611.23362#A2.SS1.p3.1.1),[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1)\.
- Zhouet al\.\(2025\)J\. Zhou, L\. Wang, and X\. YangGUARDIAN: safeguarding llm multi\-agent collaborations with temporal graph modeling\.External Links:2505\.19234,[Link](https://arxiv.org/abs/2505.19234)Cited by:[§B\.1](https://arxiv.org/html/2611.23362#A2.SS1.p3.1.1),[§3\.2](https://arxiv.org/html/2611.23362#S3.SS2.p1.1)\.
- Zhouet al\.\(2026\)Z\. Zhou, Z\. Li, J\. Zhang, Y\. Zhang, K\. Wang, Y\. Liu, and Q\. GuoCORBA: contagious recursive blocking attacks on multi\-agent systems based on large language models\.InFindings of the Association for Computational Linguistics: ACL 2026,pp\. 6899–6908\.External Links:[Document](https://dx.doi.org/10.18653/v1/2026.findings-acl.342)Cited by:[§1](https://arxiv.org/html/2611.23362#S1.p1.1),[§3\.1](https://arxiv.org/html/2611.23362#S3.SS1.p1.1)\.
- Zouet al\.\(2025\)W\. Zou, R\. Geng, B\. Wang, and J\. JiaPoisonedRAG: knowledge corruption attacks to Retrieval\-Augmented generation of large language models\.In34th USENIX Security Symposium \(USENIX Security 25\),Seattle, WA,pp\. 3827–3844\.External Links:ISBN 978\-1\-939133\-52\-6,[Link](https://www.usenix.org/conference/usenixsecurity25/presentation/zou-poisonedrag)Cited by:[§B\.2](https://arxiv.org/html/2611.23362#A2.SS2.p5.1),[§6\.1](https://arxiv.org/html/2611.23362#S6.SS1.p1.1)\.
## Appendix AMethodology in Detail
This appendix expands the method of the main text\. It keeps the same pipeline and the same symbols, and adds the parts that do not fit in the main paper: how execution logs become a typed event graph, how textual fields become transition features, how the execution contract is trained and calibrated, how candidate sources are constructed and scored, how repairs are ranked, and what each stage costs\. Sec\.[A\.8](https://arxiv.org/html/2611.23362#A1.SS8)summarizes the end\-to\-end procedure, and Sec\.[A\.9](https://arxiv.org/html/2611.23362#A1.SS9)lists every default used in the main tables\. Analytical support for the design choices is in Appendix[D](https://arxiv.org/html/2611.23362#A4); shared experimental settings are in Appendix[B](https://arxiv.org/html/2611.23362#A2)\.
Table[5](https://arxiv.org/html/2611.23362#A1.T5)collects the symbols used throughout\.
Table 5:Notation used in Appendix A and referenced by the main text\.### A\.1Execution Graph Construction
A multi\-agent execution is a sequence of interleaved agent steps, messages, and task updates\.Trace\-Masrepresents one trajectory as a typed event graph so that a single representation covers both local agent behavior and cross\-agent coordination\.
Each execution event is recorded as
et=\(it,rt,qt,xt,ht,mtin,mtout,at,st\),e\_\{t\}=\\bigl\(i\_\{t\},r\_\{t\},q\_\{t\},x\_\{t\},h\_\{t\},m^\{\\mathrm\{in\}\}\_\{t\},m^\{\\mathrm\{out\}\}\_\{t\},a\_\{t\},s\_\{t\}\\bigr\),\(10\)which is the event of Sec\. 2 field by field:iti\_\{t\}is the executing agent,rtr\_\{t\}its role in the workflow template,qtq\_\{t\}the subtask it works on,xtx\_\{t\}the execution context visible to the step \(task input and received content\),hth\_\{t\}the agent state \(prompt, memory, and scratchpad content\),mtinm^\{\\mathrm\{in\}\}\_\{t\}andmtoutm^\{\\mathrm\{out\}\}\_\{t\}the consumed and emitted message or tool payloads,ata\_\{t\}the agent’s availability flag, andsts\_\{t\}the task\-progress summary after the step\. Every field is read from the log of the unmodified benchmark workflow; we do not add instrumentation to the agents themselves\.
Events become nodes of a partial\-order graph
G=\(𝒱,E\),G=\(\\mathcal\{V\},E\),\(11\)and each edge carries a relation type
ρij∈\{ρmsg,ρdep,ρtemp\}\.\\rho\_\{ij\}\\in\\\{\\rho\_\{\\mathrm\{msg\}\},\\rho\_\{\\mathrm\{dep\}\},\\rho\_\{\\mathrm\{temp\}\}\\\}\.\(12\)The three types are built by fixed rules rather than learned: aρmsg\\rho\_\{\\mathrm\{msg\}\}edge connects the event that emits a message \(or tool result\) to the event that consumes it; aρdep\\rho\_\{\\mathrm\{dep\}\}edge connects events whose tasks are linked by the workflow template \(for example a verifier step that depends on a solver output\); and aρtemp\\rho\_\{\\mathrm\{temp\}\}edge connects consecutive events of the same agent\. Edges always point from an earlier producer to a later consumer, soGGis a directed acyclic graph and defines a partial order over events\.
Two properties follow from this construction and are used later\. First, the representation never assumes lock\-step rounds: two events are ordered only when a message, a task dependency, or the same agent’s own history links them, which is why delayed or asynchronous execution does not change the graph semantics \(Appendix[C\.1](https://arxiv.org/html/2611.23362#A3.SS1)\)\. Second, the three corruption levels of our threat model touch different parts of the same object: L1 changeshth\_\{t\}on a node, L2 changesmtoutm^\{\\mathrm\{out\}\}\_\{t\}on aρmsg\\rho\_\{\\mathrm\{msg\}\}edge payload \(and henceminm^\{\\mathrm\{in\}\}of its consumer\), and L3 changes theρdep\\rho\_\{\\mathrm\{dep\}\}structure itself\. A monitor defined on this graph can therefore express all three, whereas agent\-level state monitors observe only the first\.
The initial node representation concatenates the embedded execution factors,
zt0=\[fi\(it\);fr\(rt\);fq\(qt\);fa\(at\);fx\(xt\);fh\(ht\);fm\(mtin,mtout\);fs\(st\)\],z^\{0\}\_\{t\}=\[f\_\{i\}\(i\_\{t\}\);f\_\{r\}\(r\_\{t\}\);f\_\{q\}\(q\_\{t\}\);f\_\{a\}\(a\_\{t\}\);f\_\{x\}\(x\_\{t\}\);f\_\{h\}\(h\_\{t\}\);f\_\{m\}\(m^\{\\mathrm\{in\}\}\_\{t\},m^\{\\mathrm\{out\}\}\_\{t\}\);f\_\{s\}\(s\_\{t\}\)\],\(13\)where eachf\(⋅\)f\(\\cdot\)embeds the corresponding component\. Structured fields \(iti\_\{t\},rtr\_\{t\},qtq\_\{t\},ata\_\{t\}\) use learnable embedding tables, and textual fields \(xtx\_\{t\},hth\_\{t\},mtinm^\{\\mathrm\{in\}\}\_\{t\},mtoutm^\{\\mathrm\{out\}\}\_\{t\},sts\_\{t\}\) are mapped into the contract space as described in Sec\.[A\.3](https://arxiv.org/html/2611.23362#A1.SS3)\. When several events share a timestamp, parsing uses deterministic tie\-breaking \(agent id, then log line number\) so that the graph, and hence every score below, is reproducible across runs\.
### A\.2Relation\-Aware Execution Context Encoder
The contract must predict what an event*should*look like given the collaboration that preceded it\.Trace\-Mastherefore encodes, for each event, the execution context formed by its ancestors and the relation types through which they act\.
The neighborhood ofete\_\{t\}is
ℋt=\{ej∣\(ej,et\)∈E\},\\mathcal\{H\}\_\{t\}=\\\{e\_\{j\}\\mid\(e\_\{j\},e\_\{t\}\)\\in E\\\},\(14\)that is, the direct parents ofete\_\{t\}in the partial order\. BecauseEEonly contains producer\-to\-consumer edges,ℋt\\mathcal\{H\}\_\{t\}never includes events that occur afterete\_\{t\}; the encoder is causal by construction and cannot use post\-hoc information when scoring a step\.
Each neighbor is transformed with parameters tied to its relation type,
kjt=Wkρjtzj0,vjt=Wvρjtzj0,k\_\{jt\}=W^\{\\rho\_\{jt\}\}\_\{k\}z^\{0\}\_\{j\},\\qquad v\_\{jt\}=W^\{\\rho\_\{jt\}\}\_\{v\}z^\{0\}\_\{j\},\(15\)so that a corrupted message and a corrupted dependency enter the context through different projections\. With the queryq~t=Wqzt0\\tilde\{q\}\_\{t\}=W\_\{q\}z^\{0\}\_\{t\}, attention weights over the neighborhood are
πjt=exp\(q~t⊤kjt/d\)∑l∈ℋtexp\(q~t⊤klt/d\),\\pi\_\{jt\}=\\frac\{\\exp\\bigl\(\\tilde\{q\}\_\{t\}^\{\\top\}k\_\{jt\}/\\sqrt\{d\}\\bigr\)\}\{\\sum\_\{l\\in\\mathcal\{H\}\_\{t\}\}\\exp\\bigl\(\\tilde\{q\}\_\{t\}^\{\\top\}k\_\{lt\}/\\sqrt\{d\}\\bigr\)\},\(16\)and the context representation is
ct=σ\(Wo∑ej∈ℋtπjtvjt\+Wszt0\)\.c\_\{t\}=\\sigma\\\!\\left\(W\_\{o\}\\sum\_\{e\_\{j\}\\in\\mathcal\{H\}\_\{t\}\}\\pi\_\{jt\}v\_\{jt\}\+W\_\{s\}z^\{0\}\_\{t\}\\right\)\.\(17\)The residual termWszt0W\_\{s\}z^\{0\}\_\{t\}keeps the event’s own identity \(agent, role, task\) in the context, so the contract is conditioned on*who*is acting as well as on what it received\.
Relation\-specific projections matter for our setting rather than being a generic design choice: the expected transition of a verifier that just received a retrieved document differs from that of the same agent following its own previous step, even when the surface text is similar\. A single untyped aggregation would average these regimes and inflate the benign variance, which directly weakens the score in Eq\. \([25](https://arxiv.org/html/2611.23362#A1.E25)\)\.
In implementation, one parent\-event multi\-head attention layer \(4 heads, hidden dimensiond=256d\{=\}256\) realizes this aggregation; role and relation types use 64\-dimensional learnable embeddings over nine role ids and\{ρmsg,ρdep,ρtemp\}\\\{\\rho\_\{\\mathrm\{msg\}\},\\rho\_\{\\mathrm\{dep\}\},\\rho\_\{\\mathrm\{temp\}\}\\\}\(Table[6](https://arxiv.org/html/2611.23362#A1.T6)\)\. Encoding one trajectory costsO\(\|E\|d\+\|𝒱\|d2\)O\(\|E\|\\,d\+\|\\mathcal\{V\}\|\\,d^\{2\}\)time andO\(\|𝒱\|d\)O\(\|\\mathcal\{V\}\|\\,d\)memory, and events with disjoint ancestor sets are batched together\.
### A\.3Text\-to\-Transition Featureization
Logs are tokenized per event\. Letϕtext\\phi\_\{\\text\{text\}\}be a frozenall\-MiniLM\-L6\-v2Sentence\-BERT\([Reimers and Gurevych, 2019](https://arxiv.org/html/2611.23362#bib.bib29)\)encoder \(384\-dimensional pooled vectors\) applied to the concatenated agent text of the event \(thought, inbound and outbound message snippets, and task\-state summary\), followed by a learned linear map into the 256\-dimensional contract space\. Writingzt∈ℝ256z\_\{t\}\\in\\mathbb\{R\}^\{256\}for the projected embedding of the active fields atete\_\{t\}, the quantity modeled by the contract is the transition residual
Δet=zt−zt−1,\\Delta e\_\{t\}=z\_\{t\}\-z\_\{t\-1\},\(18\)wherezt−1z\_\{t\-1\}is the embedding of the immediately preceding state of the same execution thread\.
Modeling the residual rather than the absolute embedding is what makes benign\-only training usable across benchmarks: absolute embeddings differ strongly between, say, a math scratchpad and a retrieved passage, while the*change*induced by one legitimate step is far more regular under a fixed role and relation type\. The frozen encoder plays the same stabilizing role\. Because it is never updated, the geometry of the feature space does not shift between the benign fitting split and the attacked test split, and no attack supervision can leak into the representation\.
Three two\-layer MLP heads \(state, message, completion\) predict the channel\-wise meanμt\\mu\_\{t\}, and the Gaussian head operates on the 256\-dimensional residual block with a diagonalΣt\\Sigma\_\{t\}\. Following the main text,Δet\\Delta e\_\{t\}denotes the transition variable of the contract,Δe~t\\widetilde\{\\Delta e\}\_\{t\}its value observed inG~\\tilde\{G\}, andμt\\mu\_\{t\}the contract mean\. At inference the implementation shrinks the observed residual toward the contract mean,
Δe¯t=γresΔe~t\+ηresμt,\(γres,ηres\)=\(0\.5,0\.5\),\\bar\{\\Delta e\}\_\{t\}=\\gamma\_\{\\mathrm\{res\}\}\\,\\widetilde\{\\Delta e\}\_\{t\}\+\\eta\_\{\\mathrm\{res\}\}\\,\\mu\_\{t\},\\qquad\(\\gamma\_\{\\mathrm\{res\}\},\\eta\_\{\\mathrm\{res\}\}\)=\(0\.5,0\.5\),\(19\)before Mahalanobis scoring\. Becauseγres\+ηres=1\\gamma\_\{\\mathrm\{res\}\}\+\\eta\_\{\\mathrm\{res\}\}=1, this givesΔe¯t−μt=γres\(Δe~t−μt\)\\bar\{\\Delta e\}\_\{t\}\-\\mu\_\{t\}=\\gamma\_\{\\mathrm\{res\}\}\(\\widetilde\{\\Delta e\}\_\{t\}\-\\mu\_\{t\}\), so the scored value is exactlyγres2V\(et\)\\gamma\_\{\\mathrm\{res\}\}^\{2\}\\,V\(e\_\{t\}\)withVVas in Eq\. \([25](https://arxiv.org/html/2611.23362#A1.E25)\)\. Sinceτ\\tauis a quantile of the same scaled score, every alert, the setΩ\\Omega, and every ranking of events are identical to those obtained fromV\(et\)V\(e\_\{t\}\)itself; the shrinkage only fixes the numerical scale of the violation terms relative toλpen\\lambda\_\{\\mathrm\{pen\}\},λ1\\lambda\_\{1\}, andλ2\\lambda\_\{2\}, whose defaults \(Sec\.[A\.9](https://arxiv.org/html/2611.23362#A1.SS9)\) were set on this scale\. All statements below and in Appendix[D](https://arxiv.org/html/2611.23362#A4)are therefore written forV\(et\)V\(e\_\{t\}\)\. The coefficientγres\\gamma\_\{\\mathrm\{res\}\}is distinct both from the completion\-violation weightγ\\gammaof Sec\.[A\.5](https://arxiv.org/html/2611.23362#A1.SS5)and from the attribution hop decayψ\\psiof Sec\.[A\.6\.3](https://arxiv.org/html/2611.23362#A1.SS6.SSS3)\.
### A\.4Probabilistic Execution Contract Learning
Given the contextctc\_\{t\}, the contract states how a normal event evolves under that collaboration condition\. The transition is decomposed by channel,
Δet=\[Δht;Δmt;Δst\],\\Delta e\_\{t\}=\[\\Delta h\_\{t\};\\Delta m\_\{t\};\\Delta s\_\{t\}\],\(20\)whereΔht\\Delta h\_\{t\},Δmt\\Delta m\_\{t\}, andΔst\\Delta s\_\{t\}are the changes in agent state, message interaction, and task progress\. The decomposition is deliberate: it gives each corruption level a channel in which it is expressed, so a single scalar score can react to state edits, payload edits, and coordination edits without a separate detector per attack type\.
A transition network predicts the expected evolution from a shared hidden stateφt\\varphi\_\{t\}\(kept distinct from the execution transitionoto\_\{t\}of Sec\. 2, which is the same object asΔet\\Delta e\_\{t\}\),
φt=MLPθ\(ct\),μt=\[gh\(φt\);gm\(φt\);gs\(φt\)\],\\varphi\_\{t\}=\\mathrm\{MLP\}\_\{\\theta\}\(c\_\{t\}\),\\qquad\\mu\_\{t\}=\[g\_\{h\}\(\\varphi\_\{t\}\);g\_\{m\}\(\\varphi\_\{t\}\);g\_\{s\}\(\\varphi\_\{t\}\)\],\(21\)and, because legitimate executions are themselves variable, the contract also predicts a spread
Σt=Softplus\(WΣφt\),\\Sigma\_\{t\}=\\mathrm\{Softplus\}\(W\_\{\\Sigma\}\\varphi\_\{t\}\),\(22\)kept diagonal and floored away from zero for numerical stability\. The contract is therefore
pθ\(Δet∣ct\)=𝒩\(μt,Σt\)\.p\_\{\\theta\}\(\\Delta e\_\{t\}\\mid c\_\{t\}\)=\\mathcal\{N\}\(\\mu\_\{t\},\\Sigma\_\{t\}\)\.\(23\)
PredictingΣt\\Sigma\_\{t\}is what allows one threshold to serve heterogeneous roles\. An agent that speaks rarely and an agent that speaks at every round have different benign transition spreads; with a shared fixed variance, the busier agent would accumulate large raw deviations and dominate the alerts\. Conditioning the spread on the same context as the mean removes this volume effect, which is visible in the imbalance stress test of Appendix[C\.1](https://arxiv.org/html/2611.23362#A3.SS1)\.
Training uses benign trajectories only,
ℒcon=−∑G∈𝒟0∑et∈Glogpθ\(Δet∣ct\),\\mathcal\{L\}\_\{\\mathrm\{con\}\}=\-\\sum\_\{G\\in\\mathcal\{D\}\_\{0\}\}\\sum\_\{e\_\{t\}\\in G\}\\log p\_\{\\theta\}\(\\Delta e\_\{t\}\\mid c\_\{t\}\),\(24\)where𝒟0\\mathcal\{D\}\_\{0\}is the normal execution set\. In practice the objective is a weighted sum of the per\-channel negative log\-likelihoods for state, message, and completion, plus two auxiliary regularization terms, with weightsλh=2\\lambda\_\{h\}\{=\}2,λm=1\\lambda\_\{m\}\{=\}1,λδ=2\\lambda\_\{\\delta\}\{=\}2,λs=0\.5\\lambda\_\{s\}\{=\}0\.5,λp=0\.5\\lambda\_\{p\}\{=\}0\.5\(Table[6](https://arxiv.org/html/2611.23362#A1.T6)\)\. Optimization uses AdamW\([Loshchilov and Hutter, 2019](https://arxiv.org/html/2611.23362#bib.bib30)\)with learning rate10−310^\{\-3\}, batches of 8 trajectories, at most 100 epochs with early stopping \(patience 20 on validation negative log\-likelihood\), 100 warmup steps, and gradient clipping at 1\.0\. The same configuration is used on all five benchmarks and is not re\-tuned per dataset \(Appendix[B\.7\.2](https://arxiv.org/html/2611.23362#A2.SS7.SSS2)\), so the detection numbers in Sec\. 6 are not the product of per\-benchmark contract tuning\.
### A\.5Violation Detection
At inference the realized transition is read from the observed trajectory,Δe~t=\[Δh~t;Δm~t;Δs~t\]\\widetilde\{\\Delta e\}\_\{t\}=\[\\widetilde\{\\Delta h\}\_\{t\};\\widetilde\{\\Delta m\}\_\{t\};\\widetilde\{\\Delta s\}\_\{t\}\], and compared against the contract channel by channel\. BecauseΣt\\Sigma\_\{t\}is diagonal, the Mahalanobis deviation of the main text splits exactly into a state, a message, and a progress term,Vch\(et\)=\(Δch~t−μtch\)⊤\(Σtch\)−1\(Δch~t−μtch\)V\_\{\\mathrm\{ch\}\}\(e\_\{t\}\)=\(\\widetilde\{\\Delta\\mathrm\{ch\}\}\_\{t\}\-\\mu^\{\\mathrm\{ch\}\}\_\{t\}\)^\{\\top\}\(\\Sigma^\{\\mathrm\{ch\}\}\_\{t\}\)^\{\-1\}\(\\widetilde\{\\Delta\\mathrm\{ch\}\}\_\{t\}\-\\mu^\{\\mathrm\{ch\}\}\_\{t\}\)forch∈\{h,m,s\}\\mathrm\{ch\}\\in\\\{h,m,s\\\}, and the violation score weights the last two:
V\(et\)=Vh\(et\)\+βVm\(et\)\+γVs\(et\),\(β,γ\)=\(1,0\.5\)\.V\(e\_\{t\}\)=V\_\{h\}\(e\_\{t\}\)\+\\beta\\,V\_\{m\}\(e\_\{t\}\)\+\\gamma\\,V\_\{s\}\(e\_\{t\}\),\\qquad\(\\beta,\\gamma\)=\(1,0\.5\)\.\(25\)Atβ=γ=1\\beta=\\gamma=1this is the unweighted form\(Δe~t−μt\)⊤Σt−1\(Δe~t−μt\)\(\\widetilde\{\\Delta e\}\_\{t\}\-\\mu\_\{t\}\)^\{\\top\}\\Sigma\_\{t\}^\{\-1\}\(\\widetilde\{\\Delta e\}\_\{t\}\-\\mu\_\{t\}\); for general weights it is the same Mahalanobis form with the rescaled diagonal covarianceΣ~t=diag\(Σth,Σtm/β,Σts/γ\)\\tilde\{\\Sigma\}\_\{t\}=\\mathrm\{diag\}\(\\Sigma^\{h\}\_\{t\},\\Sigma^\{m\}\_\{t\}/\\beta,\\Sigma^\{s\}\_\{t\}/\\gamma\), since weighting a channel byβ\\betais identical to dividing its variance byβ\\beta\.\(β,γ\)\(\\beta,\\gamma\)are the message\- and completion\-violation weights swept in Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)\(d\)\. This score is not a new objective introduced at test time: for the Gaussian contract of Eq\. \([23](https://arxiv.org/html/2611.23362#A1.E23)\) it equals twice the negative log\-likelihood of the observed transition under𝒩\(μt,Σ~t\)\\mathcal\{N\}\(\\mu\_\{t\},\\tilde\{\\Sigma\}\_\{t\}\)up to terms that depend only on the covariance \(Appendix[D\.2](https://arxiv.org/html/2611.23362#A4.SS2)\)\. Training by Eq\. \([24](https://arxiv.org/html/2611.23362#A1.E24)\) and scoring by Eq\. \([25](https://arxiv.org/html/2611.23362#A1.E25)\) are thus the same Gaussian quantity evaluated on benign and on test trajectories, with the two channel weights acting as a fixed reweighting of its variance\.
Events whose deviation exceeds the alert threshold form the violated set
Ω=\{et∣V\(et\)\>τ\},\\Omega=\\\{e\_\{t\}\\mid V\(e\_\{t\}\)\>\\tau\\\},\(26\)and a trajectory is flagged whenmaxtV\(et\)\>τ\\max\_\{t\}V\(e\_\{t\}\)\>\\tau, i\.e\. whenΩ≠∅\\Omega\\neq\\emptyset\. The threshold is fixed on benign validation trajectories,
τ=α⋅Quantileδ\(\{V\(e\)\}e∈𝒟val\),\\tau=\\alpha\\cdot\\mathrm\{Quantile\}\_\{\\delta\}\\bigl\(\\\{V\(e\)\\\}\_\{e\\in\\mathcal\{D\}\_\{\\mathrm\{val\}\}\}\\bigr\),\(27\)whereδ\\deltaselects the benign quantile andα\\alpharescales it into the operating threshold \(main experiments:δ=0\.99\\delta\{=\}0\.99,α=1\\alpha\{=\}1\)\.
Calibration proceeds in three steps and uses no attack labels:
1. 1\.fit the contract on the benign training split \(Sec\.[A\.4](https://arxiv.org/html/2611.23362#A1.SS4)\);
2. 2\.score every event of the held\-out benign validation split with Eq\. \([25](https://arxiv.org/html/2611.23362#A1.E25)\) and refresh the benign quantile each calibration round \(k∈\[30,150\]k\\in\[30,150\]rounds, identical schedule for all methods, Appendix[B\.7\.3](https://arxiv.org/html/2611.23362#A2.SS7.SSS3)\);
3. 3\.setτ\\tauby Eq\. \([27](https://arxiv.org/html/2611.23362#A1.E27)\) and keep it fixed for all attacked test trajectories\.
Becauseτ\\tauis a benign quantile, the nominal false\-alarm rate is controlled byδ\\deltaby construction rather than tuned against attacks; Appendix[D\.2](https://arxiv.org/html/2611.23362#A4.SS2)states this property and its finite\-sample form, and Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)reports how detection behaves asα\\alphamoves around its default\.
### A\.6Violation Source Attribution
#### A\.6\.1Candidate Source Construction
A violated event marks where inconsistency becomes visible, not necessarily where it began: once a corrupted payload enters the context of later events, those events are scored against contracts they can no longer satisfy\.Trace\-Mastherefore searches upstream fromΩ\\Omegaand builds a candidate set
𝒞=⋃ei∈Ω\(\{ei\}∪AncH\(ei\)\),\\mathcal\{C\}=\\bigcup\_\{e\_\{i\}\\in\\Omega\}\\bigl\(\\\{e\_\{i\}\\\}\\cup\\mathrm\{Anc\}\_\{H\}\(e\_\{i\}\)\\bigr\),\(28\)whereAncH\(ei\)\\mathrm\{Anc\}\_\{H\}\(e\_\{i\}\)are the ancestors ofeie\_\{i\}withinHHhops alongEmsg∪Edep∪EtempE\_\{\\mathrm\{msg\}\}\\cup E\_\{\\mathrm\{dep\}\}\\cup E\_\{\\mathrm\{temp\}\}\. The violated events themselves are included so that a source whose own deviation is already the largest \(the 0\-hop case of Fig\. 3\) stays eligible\. Deployment uses a hop limitH=8H\{=\}8and scores the topC=4C\{=\}4candidates, ranked by their proximity\-weighted violation mass; candidates are ordered deterministically so that ties do not depend on iteration order\. Gating onΩ\\Omegamatters for cost: the number of counterfactual evaluations grows withCCrather than with the trajectory length, which is the behavior profiled in Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\.
#### A\.6\.2Source Restoration Analysis
For each candidatec∈𝒞c\\in\\mathcal\{C\}, the observed transition atccis replaced by the one the contract expects,
Δecres=𝔼pθ\[Δec∣cc\]=μc,\\Delta e^\{\\mathrm\{res\}\}\_\{c\}=\\mathbb\{E\}\_\{p\_\{\\theta\}\}\[\\Delta e\_\{c\}\\mid c\_\{c\}\]=\\mu\_\{c\},\(29\)whereccc\_\{c\}is the encoded context of candidatecc, and the trajectory is re\-evaluated on the resulting graph
Gcres=Restorec\(G~,Δecres\)\.G^\{\\mathrm\{res\}\}\_\{c\}=\\mathrm\{Restore\}\_\{c\}\(\\tilde\{G\},\\Delta e^\{\\mathrm\{res\}\}\_\{c\}\)\.\(30\)Restore\\mathrm\{Restore\}writes contract\-consistent structured fields atcc\(message payload features, dependency flags, state summaries\), recomputeszcz\_\{c\}, and then refreshes the contexts ofDesc\(c\)\\mathrm\{Desc\}\(c\)in embedding space with the same encoder used at detection time; the contextccc\_\{c\}of the candidate itself is held at its pre\-restoration value, so thatμc\\mu\_\{c\}is the target the restored transition is scored against\. Two properties of this operation are used by the scoring rule below\. It is*local*: onlyccand its descendants change, so scores on any branch that does not pass throughccare unaffected\. And it is*label\-free*: the replacement value comes from the learned contract, never from the ground\-truth source annotationcgtc^\{\\mathrm\{gt\}\}, which is used only to evaluate Hit@1\. Becauseccc\_\{c\}is held fixed, the restored transition equals its own contract mean andVcres\(c\)=0V^\{\\mathrm\{res\}\}\_\{c\}\(c\)=0\.
Counterfactual scoring makes no LLM call\. Restoration and rescoring run entirely in the contract space, and message\-correction operators invoke LLM re\-generation only afterc⋆c^\{\\star\}has been selected and a repair is committed \(Sec\.[A\.7](https://arxiv.org/html/2611.23362#A1.SS7)\)\. This separation is why the diagnosis cost in Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)is measured without bulk generation, and why increasingCCchanges wall time but not the number of model calls in the underlying MAS\.
#### A\.6\.3Responsibility Estimation
A responsible source should explain a substantial part of the downstream violations once restored\. LetVcres\(ej\)V^\{\\mathrm\{res\}\}\_\{c\}\(e\_\{j\}\)be the score ofeje\_\{j\}onGcresG^\{\\mathrm\{res\}\}\_\{c\}, and define the restored score and hop weights
V~c\(ej\)=ωVcres\(ej\)\+\(1−ω\)V\(ej\),wj=ψd\(c,ej\)\.\\tilde\{V\}\_\{c\}\(e\_\{j\}\)=\\omega\\,V^\{\\mathrm\{res\}\}\_\{c\}\(e\_\{j\}\)\+\(1\-\\omega\)\\,V\(e\_\{j\}\),\\qquad w\_\{j\}=\\psi^\{\\,d\(c,e\_\{j\}\)\}\.\(31\)Responsibility and the attributed source are then
R\(c\)=∑ej∈\{c\}∪Desc\(c\)wj\[V\(ej\)−V~c\(ej\)\]−λpen𝒫\(c\),c⋆=argmaxc∈𝒞R\(c\),R\(c\)=\\\!\\\!\\sum\_\{e\_\{j\}\\in\\\{c\\\}\\cup\\mathrm\{Desc\}\(c\)\}\\\!\\\!w\_\{j\}\\bigl\[V\(e\_\{j\}\)\-\\tilde\{V\}\_\{c\}\(e\_\{j\}\)\\bigr\]\-\\lambda\_\{\\mathrm\{pen\}\}\\mathcal\{P\}\(c\),\\qquad c^\{\\star\}=\\arg\\max\_\{c\\in\\mathcal\{C\}\}R\(c\),\(32\)where𝒫\(c\)\\mathcal\{P\}\(c\)penalizes candidates whose restoration would violate dependency or ordering constraints of the workflow template\. Two conventions are worth stating explicitly\. The sum ranges overcc*together with*its descendants, and the candidate itself enters at hop distanced\(c,c\)=0d\(c,c\)=0and hence weightψ0=1\\psi^\{0\}=1; byVcres\(c\)=0V^\{\\mathrm\{res\}\}\_\{c\}\(c\)=0this own term equalsV\(c\)V\(c\)\. What separates an initiating event from a symptom on its branch is the descendant part of the sum: the source is credited with the drop its restoration causes at the symptom, whereas the symptom receives no credit for events upstream of it \(Appendix[D\.4](https://arxiv.org/html/2611.23362#A4.SS4)\)\. And becauseV\(ej\)−V~c\(ej\)=ω\[V\(ej\)−Vcres\(ej\)\]V\(e\_\{j\}\)\-\\tilde\{V\}\_\{c\}\(e\_\{j\}\)=\\omega\\bigl\[V\(e\_\{j\}\)\-V^\{\\mathrm\{res\}\}\_\{c\}\(e\_\{j\}\)\\bigr\], the score is the hop\-discounted counterfactual violation drop: the gateω\\omegasets how much restored\-branch evidence enters the ranking relative to the validity penalty, and atω=1\\omega\{=\}1the drop is scored at full weight, soc⋆c^\{\\star\}is the candidate whoseRestorec\\mathrm\{Restore\}\_\{c\}removes the most violation mass\. The hop decayψ\\psidiscounts far descendants, whose scores also depend on intervening events and are therefore weaker evidence aboutcc\. Values used in the main tables are in Sec\.[A\.9](https://arxiv.org/html/2611.23362#A1.SS9)\. The scoring rule matches the responsibility objective in Sec\. 5\.3 of the main text\.
### A\.7Contract Restoration
#### A\.7\.1Repair Space Construction
Attribution returns where to act, not what to do; several interventions are usually admissible at the same event\.Trace\-Masenumerates them as
𝒰\(c⋆\)=\{u1,u2,…,u\|𝒰\(c⋆\)\|\},\\mathcal\{U\}\(c^\{\\star\}\)=\\\{u\_\{1\},u\_\{2\},\\ldots,u\_\{\|\\mathcal\{U\}\(c^\{\\star\}\)\|\}\\\},\(33\)with each candidate instantiating one intervention type:*state recovery*rewrites the agent state fields atc⋆c^\{\\star\}to contract\-consistent values,*message correction*regenerates or replaces the payload carried by the outgoingρmsg\\rho\_\{\\mathrm\{msg\}\}edge, and*dependency adjustment*repairs the coordination structure \(restoring a dropped dependency, reinstating a skipped role\)\. The three types mirror the three corruption levels, so the repair space can express a fix at the level at which the failure was introduced instead of only suppressing its symptoms\.
#### A\.7\.2Future Execution Rollout
Each candidate is evaluated by how the collaboration would continue if it were applied,
G^t:t\+Ku=Rollout\(G~,u,pθ\),\\hat\{G\}^\{u\}\_\{t:t\+K\}=\\mathrm\{Rollout\}\(\\tilde\{G\},u,p\_\{\\theta\}\),\(34\)wherettindexes the attributed eventc⋆c^\{\\star\}\. Rollout runs entirely in contract space and is fully specified by the four rules below\.
*Operator edit\.*Each operator edits one field ofc⋆c^\{\\star\}and thereby one channel of its transition: state recovery edits the agent statehh\(channelhh\), message correction edits the outgoing payloadmoutm^\{\\mathrm\{out\}\}\(channelmm\), and dependency adjustment edits theρdep\\rho\_\{\\mathrm\{dep\}\}edges incident toc⋆c^\{\\star\}\(channelss\)\. We writeℱ\(u\)\\mathcal\{F\}\(u\)for the edited field\. In the rollout the edited channel ofc⋆c^\{\\star\}is set to its contract mean, while the other two channels keep their logged values; for dependency adjustment the context ofc⋆c^\{\\star\}is first recomputed on the edited edge set\. The payload that message correction regenerates with the LLM exists only after commitment, so the rollout uses its contract mean in its place\.
*Window\.*The rolled\-out events are the firstKKevents ofDesc\(c⋆\)\\mathrm\{Desc\}\(c^\{\\star\}\)in the deterministic topological order of Sec\.[A\.1](https://arxiv.org/html/2611.23362#A1.SS1)\(all ofDesc\(c⋆\)\\mathrm\{Desc\}\(c^\{\\star\}\)if it has fewer thanKKevents\)\. We index themt\+1,…,t\+Kt\{\+\}1,\\ldots,t\{\+\}Kin this order, so the sum in Eq\. \(9\) of Sec\. 5\.4 runs over the edited event and theKKwindow events\.
*Carry\-over\.*Each relation type carries one field:ρtemp\\rho\_\{\\mathrm\{temp\}\}carries the agent state \(hh\),ρmsg\\rho\_\{\\mathrm\{msg\}\}the payload \(mm\), andρdep\\rho\_\{\\mathrm\{dep\}\}the task dependency \(ss\)\. A window eventeie\_\{i\}is a*carry\-over*event underuuif it has a parenteje\_\{j\}such that eitherej=c⋆e\_\{j\}=c^\{\\star\}and the field carried byρji\\rho\_\{ji\}is notℱ\(u\)\\mathcal\{F\}\(u\), oreje\_\{j\}is itself a carry\-over window event\. A carry\-over event consumes a logged field thatuuleaves in place; every other window event is*regenerated*\.
*Recursion\.*Fori=t,t\+1,…,t\+Ki=t,t\{\+\}1,\\ldots,t\{\+\}Kin order, the contextc^iu\\hat\{c\}^\{u\}\_\{i\}is computed by the encoder of Sec\.[A\.2](https://arxiv.org/html/2611.23362#A1.SS2)on the graph in which parents inside\{c⋆\}∪\{et\+1,…,et\+K\}\\\{c^\{\\star\}\\\}\\cup\\\{e\_\{t\+1\},\\ldots,e\_\{t\+K\}\\\}take their rolled\-out features and all other parents keep their logged features\. With\(μ^iu,Σ^iu\)\(\\hat\{\\mu\}^\{u\}\_\{i\},\\hat\{\\Sigma\}^\{u\}\_\{i\}\)the contract underc^iu\\hat\{c\}^\{u\}\_\{i\}, the rolled\-out transition of a window event is
Δe^ui=\{Δe~iifeiis a carry\-over event,μ^iuifeiis regenerated,z^ui=z^ui−\+Δe^ui,\\widehat\{\\Delta e\}\{\}^\{u\}\_\{i\}=\\begin\{cases\}\\widetilde\{\\Delta e\}\_\{i\}&\\text\{if \}e\_\{i\}\\text\{ is a carry\-over event\},\\\\ \\hat\{\\mu\}^\{u\}\_\{i\}&\\text\{if \}e\_\{i\}\\text\{ is regenerated\},\\end\{cases\}\\qquad\\hat\{z\}^\{u\}\_\{i\}=\\hat\{z\}^\{u\}\_\{i^\{\-\}\}\+\\widehat\{\\Delta e\}\{\}^\{u\}\_\{i\},\(35\)wherei−i^\{\-\}is the preceding event of the same thread \(rolled\-out if it lies in the window, logged otherwise\), andz^iu\\hat\{z\}^\{u\}\_\{i\}is the feature later window events read\. The rolled\-out evente^iu\\hat\{e\}^\{u\}\_\{i\}carriesΔe^ui\\widehat\{\\Delta e\}\{\}^\{u\}\_\{i\}, and its scoreV\(e^iu\)V\(\\hat\{e\}^\{u\}\_\{i\}\)is Eq\. \([25](https://arxiv.org/html/2611.23362#A1.E25)\) with\(μ^iu,Σ^iu\)\(\\hat\{\\mu\}^\{u\}\_\{i\},\\hat\{\\Sigma\}^\{u\}\_\{i\}\)in place of\(μi,Σi\)\(\\mu\_\{i\},\\Sigma\_\{i\}\)\. Hence a regenerated event scores zero, a carry\-over event contributes its logged transition rescored under the repaired context, and the edited event contributes the violation left in its two unedited channels\.ℒviol\(u\)\\mathcal\{L\}\_\{\\mathrm\{viol\}\}\(u\)below is therefore the violation carried by the logged fields thatuuleaves in place within the window\. UnlikeRestore\\mathrm\{Restore\}, which only rescores the logged descendants of a candidate under refreshed contexts, Rollout also models which descendants would be regenerated onceuuis committed\.
*Commitment and real re\-execution\.*Committinguuapplies the edit to the logged fields \(message correction regenerates the payload with the trajectory LLM\) and re\-executesDesc\(c⋆\)\\mathrm\{Desc\}\(c^\{\\star\}\)with the same decoding \(Table[8](https://arxiv.org/html/2611.23362#A2.T8)\), leaving every event outsideDesc\(c⋆\)\\mathrm\{Desc\}\(c^\{\\star\}\)untouched\. Evaluating the three terms of the repair objective on the firstKKre\-executed descendants, with the same contract, the same template steps, and the sameκ\\kappa, gives the realized objective𝒥\(u\)\\mathcal\{J\}\(u\)that the rollout estimates\. The two differ in exactly two places: the edited channel and the regenerated events are set to contract means rather than realized by the LLM, and carry\-over events keep their logged transitions rather than being regenerated from partly repaired inputs\. Appendix[D\.5](https://arxiv.org/html/2611.23362#A4.SS5)bounds the effect of both on the selected repair, and Appendix[C\.3](https://arxiv.org/html/2611.23362#A3.SS3)measures it by real re\-execution of every candidate\. Deployment usesK=1K\{=\}1, because deeper rollouts did not change the top\-1 repair in our runs, and Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)reports the cost of largerKK\.
#### A\.7\.3Minimal Repair Selection
The selected repair minimizes remaining inconsistency, task degradation, and intervention cost jointly,
u⋆=argminu∈𝒰\(c⋆\)\(ℒviol\(u\)\+λ1ℒtask\(u\)\+λ2κ\(u\)\),u^\{\\star\}=\\arg\\min\_\{u\\in\\mathcal\{U\}\(c^\{\\star\}\)\}\\bigl\(\\mathcal\{L\}\_\{\\mathrm\{viol\}\}\(u\)\+\\lambda\_\{1\}\\mathcal\{L\}\_\{\\mathrm\{task\}\}\(u\)\+\\lambda\_\{2\}\\kappa\(u\)\\bigr\),\(36\)with the three terms defined as
ℒviol\(u\)\\displaystyle\\mathcal\{L\}\_\{\\mathrm\{viol\}\}\(u\)=∑i=tt\+KV\(e^iu\),\\displaystyle=\\sum\_\{i=t\}^\{t\+K\}V\(\\hat\{e\}^\{u\}\_\{i\}\),\(37\)ℒtask\(u\)\\displaystyle\\mathcal\{L\}\_\{\\mathrm\{task\}\}\(u\)=1\|𝒯\|∑s∈𝒯𝟙\[sunsatisfied inG^t:t\+Ku\],\\displaystyle=\\frac\{1\}\{\|\\mathcal\{T\}\|\}\\sum\_\{s\\in\\mathcal\{T\}\}\\mathbb\{1\}\\bigl\[s\\text\{ unsatisfied in \}\\hat\{G\}^\{u\}\_\{t:t\+K\}\\bigr\],\(38\)κ\(u\)\\displaystyle\\kappa\(u\)=intervention cost \(operator count / edit magnitude\)\.\\displaystyle=\\text\{intervention cost \(operator count / edit magnitude\)\}\.\(39\)Hereℒviol\\mathcal\{L\}\_\{\\mathrm\{viol\}\}\(the first term of Eq\. \(9\) in Sec\. 5\.4, named here to keep it apart from the contract lossℒcon\\mathcal\{L\}\_\{\\mathrm\{con\}\}\) measures how much violation remains after the repair, withe^iu\\hat\{e\}^\{u\}\_\{i\}theii\-th rolled\-out event underuu,ℒtask\\mathcal\{L\}\_\{\\mathrm\{task\}\}measures task degradation as the fraction of the workflow template’s required steps𝒯\\mathcal\{T\}\(roles to be invoked, dependencies to be satisfied, and their order\) that the rolled\-out graph leaves unsatisfied, read from the structured dependency and state fields thatRestore\\mathrm\{Restore\}andRollout\\mathrm\{Rollout\}maintain, so it needs neither generated text nor gold labels, andκ\(u\)\\kappa\(u\)charges for the edit itself; we writeκ\\kapparather thanCCto keep it distinct from the candidate capCC\. Main runs useλ1=λ2=0\.1\\lambda\_\{1\}=\\lambda\_\{2\}=0\.1unless noted\. The third term is what keeps the reported operator cost low in Table[9](https://arxiv.org/html/2611.23362#A2.T9): a repair that suppresses the attack by rewriting many events is penalized relative to one committed edit at the attributed source\.
### A\.8End\-to\-End Procedure and Cost
Putting the stages together, one attacked trajectory is processed as follows\.
1. 1\.Parse\.BuildG~\\tilde\{G\}from the execution log with typed edges and deterministic tie\-breaking \(Sec\.[A\.1](https://arxiv.org/html/2611.23362#A1.SS1)\)\.
2. 2\.Score\.Encode contexts, evaluate the contract, and computeV\(et\)V\(e\_\{t\}\)for every event; raise a trajectory alert ifmaxtV\(et\)\>τ\\max\_\{t\}V\(e\_\{t\}\)\>\\tau\(Sec\.[A\.5](https://arxiv.org/html/2611.23362#A1.SS5)\)\.
3. 3\.Attribute\.Build𝒞\\mathcal\{C\}fromΩ\\OmegaandAncH\(Ω\)\\mathrm\{Anc\}\_\{H\}\(\\Omega\), restore the topCCcandidates, and takec⋆=argmaxcR\(c\)c^\{\\star\}=\\arg\\max\_\{c\}R\(c\)\(Sec\.[A\.6](https://arxiv.org/html/2611.23362#A1.SS6)\)\.
4. 4\.Repair\.Enumerate𝒰\(c⋆\)\\mathcal\{U\}\(c^\{\\star\}\), roll outKKsteps per candidate, selectu⋆u^\{\\star\}, and commit it with regeneration restricted to the edited branch \(Sec\.[A\.7](https://arxiv.org/html/2611.23362#A1.SS7)\)\.
The accounting of model evaluations follows directly: detection performs\|𝒱\|\|\\mathcal\{V\}\|contract evaluations, attribution performs at mostC⋅\|Desc\(c\)\|C\\cdot\|\\mathrm\{Desc\}\(c\)\|rescorings, repair performs at most\|𝒰\(c⋆\)\|⋅\(K\+1\)\|\\mathcal\{U\}\(c^\{\\star\}\)\|\\cdot\(K\{\+\}1\)rollout evaluations, and the only LLM calls are those of the committed repair\. SinceCC,KK, and\|𝒰\(c⋆\)\|\|\\mathcal\{U\}\(c^\{\\star\}\)\|are small constants and detection reuses cached event features, the non\-LLM overhead stays a small fraction of an MAS rollout, which is the behavior measured in Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\.
### A\.9Default Hyperparameters \(Method\)
Detection and repair defaults for the main tables areδ=0\.99\\delta\{=\}0\.99,α=1\\alpha\{=\}1,ω=1\\omega\{=\}1,ψ=0\.5\\psi\{=\}0\.5,λ1=λ2=0\.1\\lambda\_\{1\}\{=\}\\lambda\_\{2\}\{=\}0\.1,λpen=0\.1\\lambda\_\{\\mathrm\{pen\}\}\{=\}0\.1,H=8H\{=\}8,C=4C\{=\}4,K=1K\{=\}1; all five benchmarks share these values\. The violation\-channel weights of the detection score stay at\(β,γ\)=\(1,0\.5\)\(\\beta,\\gamma\)\{=\}\(1,0\.5\)\. Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)sweepsα\\alphaand\(β,γ\)\(\\beta,\\gamma\)on held\-out benign trajectories, and Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)variesCCandKK\. Contract and encoder settings are listed in Table[6](https://arxiv.org/html/2611.23362#A1.T6)\.
Table 6:ExecFormer and execution\-contract training \(all benchmarks\)\.
## Appendix BExperiments in Detail
This appendix documents everything needed to reproduce Sec\. 4–6: what is and is not compared \(Sec\.[B\.1](https://arxiv.org/html/2611.23362#A2.SS1)\), the five benchmarks and their task metrics \(Sec\.[B\.2](https://arxiv.org/html/2611.23362#A2.SS2)\), how trajectories are logged and split \(Sec\.[B\.3](https://arxiv.org/html/2611.23362#A2.SS3)\), how the L1–L3 corruptions are injected \(Sec\.[B\.4](https://arxiv.org/html/2611.23362#A2.SS4)\), how each baseline is instantiated on our testbed \(Sec\.[B\.5](https://arxiv.org/html/2611.23362#A2.SS5)\), how every reported quantity is defined \(Sec\.[B\.6](https://arxiv.org/html/2611.23362#A2.SS6)\), and the shared implementation, protocol, and randomness settings \(Sec\.[B\.7](https://arxiv.org/html/2611.23362#A2.SS7)\)\. Method\-side defaults are fixed in Appendix[A\.9](https://arxiv.org/html/2611.23362#A1.SS9)and are not re\-tuned per benchmark\.
### B\.1Evaluation Scope and Omitted Benchmarks
Controlled protocol \(main results\)\.All tables report defenses on the same five benchmarks with injected L1–L3 corruptions, shared MAS templates, and the metrics of Sec\. 6, including task\-preserving recovery\. Every method sees the same trajectories, the same attack placement, the same benign calibration budget, and the same repair operators where applicable, so differences in the tables reflect the monitoring and attribution logic rather than differences in workflow, decoding, or attack strength\. The protocol is therefore scoped to injected corruptions with a known initiating event, which is what makes the localization and recovery metrics of Sec\.[B\.6](https://arxiv.org/html/2611.23362#A2.SS6)computable at all\.
Why natural failure corpora \(Who&When\([Zhang et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib23)\), MAST\-Data\([Cemri et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib32)\)\) are not used as benchmarks\.Our three metric groups each require an input that these corpora do not release, so the exclusion follows from the metric definitions rather than from a judgement about the corpora\. \(i\)*Contract inputs\.*Every score in this paper is conditioned on the encoded contextctc\_\{t\}, which is built from the typed edgesρmsg\\rho\_\{\\mathrm\{msg\}\},ρdep\\rho\_\{\\mathrm\{dep\}\}, andρtemp\\rho\_\{\\mathrm\{temp\}\}of Appendix[A\.1](https://arxiv.org/html/2611.23362#A1.SS1)\. These corpora release conversation turns or taxonomy\-labeled steps; which event consumed which message, and which task depends on which, are not recorded, soℋt\\mathcal\{H\}\_\{t\}cannot be recovered from the released logs and Eqs\. \([23](https://arxiv.org/html/2611.23362#A1.E23)\)–\([25](https://arxiv.org/html/2611.23362#A1.E25)\) are not defined on them without re\-annotating every trace\. \(ii\)*Localization labels\.*Hit@1 and hop distance \(Sec\.[B\.6](https://arxiv.org/html/2611.23362#A2.SS6)\) are defined against a single labeled*initiating event*cgtc^\{\\mathrm\{gt\}\}per trajectory\. The released labels mark a failing agent, a failing step, or a failure category, which identifies where the failure is visible rather than where it originates; by Obs\. 2 those two need not coincide, so the labels cannot be reinterpreted ascgtc^\{\\mathrm\{gt\}\}without new annotation\. \(iii\)*Recovery metrics\.*ASR, ACC, TCR, and operator cost all require re\-executing the workflow after a repair is committed\. These corpora are static traces without an executable workflow behind them, so no operator from𝒰\(c⋆\)\\mathcal\{U\}\(c^\{\\star\}\)can be applied and no post\-repair task metric can be computed\. \(iv\)*Calibration split\.*Our thresholds are fit by Eq\. \([27](https://arxiv.org/html/2611.23362#A1.E27)\) on a benign split with task ids disjoint from the test split, and cross\-method comparison relies on that split being shared \(Sec\.[B\.7\.2](https://arxiv.org/html/2611.23362#A2.SS7.SSS2)\)\. These releases do not provide a matched benign split from the same workflow, so no method in Table[1](https://arxiv.org/html/2611.23362#S6.T1)could be calibrated on them under the protocol used for the reported numbers\. Because \(i\)–\(iv\) would each require new annotation or new instrumentation, any number we produced on these corpora would be measured under a different protocol from the rest of the paper; we therefore report none and treat the extension as future work\.
Why attribution pipelines such as AutoFA\([Zhang et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib23)\)and GUARDIAN\([Zhou et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib20)\)are not rows in Table[1](https://arxiv.org/html/2611.23362#S6.T1)\.The same protocol requirements apply to methods, and three of them are not satisfiable by the released pipelines without changing what is being measured\. \(i\)*Scoring unit\.*Their released implementations score conversation\-level or agent\-level units \(or temporal\-graph snapshots\), whereas every number in Tables[1](https://arxiv.org/html/2611.23362#S6.T1)–[3](https://arxiv.org/html/2611.23362#S6.T3)is computed over partial\-order events\. Mapping their output onto our events requires a new adapter that defines their scoring unit onVV; the resulting rows would report our re\-implementation, not the released method, and would not be attributable to the original work\. \(ii\)*Log schema\.*Their public inputs do not expose the event fields of Sec\. 2 that our testbed logs, and conversely our logs do not contain the trace format their code parses, so neither side can be fed to the other without a lossy conversion whose effect on their score is itself unmeasured\. \(iii\)*Repair interface\.*They return an attribution \(a failing agent or step\) or an agent\-level quarantine decision, not an operator applied at an execution element\. ASR, ACC, TCR, and cost in Tables[3](https://arxiv.org/html/2611.23362#S6.T3)and[9](https://arxiv.org/html/2611.23362#A2.T9)are defined only after an operator is committed, so these columns have no value for such methods unless our own operator set is attached to their output—in which case the recovery numbers would measure our repair module rather than theirs\. Where a method additionally requires failure\-labeled traces to be tuned or prompted, supplying those labels would also break the benign\-only calibration that every row in Table[1](https://arxiv.org/html/2611.23362#S6.T1)shares \(Sec\.[B\.7\.2](https://arxiv.org/html/2611.23362#A2.SS7.SSS2)\)\. To keep the comparison aligned while still covering these design principles, the baseline set in Sec\.[B\.5](https://arxiv.org/html/2611.23362#A2.SS5)instantiates one monitor per family under our identical protocol: interaction\-graph statistics, topology\-guided detection, activation monitoring, trust aggregation, and per\-agent sanitization\.
### B\.2Datasets and Downstream Tasks
All benchmarks use the public MAS workflow templates bundled with each release; we do not change task definitions or agent role graphs relative to those templates\. The five workflows are chosen to cover different failure surfaces: pure reasoning chains, debate, retrieval, poisoned external content, and tool execution\.
GSM8K\([Cobbe et al\., 2021](https://arxiv.org/html/2611.23362#bib.bib16)\)\. Multi\-agent math reasoning \(Solver, Critic, Verifier\)\. Downstream metric:exact match \(EM\)on the final numeric answer\. Failures propagate mainly alongρmsg\\rho\_\{\\mathrm\{msg\}\}edges between solver and critic steps\.
CSQA\([Talmor et al\., 2019](https://arxiv.org/html/2611.23362#bib.bib17)\)\. Commonsense multiple\-choice debate in the style of[Du et al\. \(2024\)](https://arxiv.org/html/2611.23362#bib.bib33)\. Downstream metric:accuracy \(ACC\)on the selected option\. Multiple agents argue over the same question, so a single corrupted message can be repeated by several downstream speakers, which is the amplification regime discussed in Appendix[D\.3](https://arxiv.org/html/2611.23362#A4.SS3)\.
HotPotQA\([Yang et al\., 2018](https://arxiv.org/html/2611.23362#bib.bib18)\)\. Retriever–reasoner–verifier collaboration on multi\-hop questions\. Downstream metric:answer EM / F1on the short span\. Task dependencies are explicit, so L3 coordination edits are meaningful here\.
PoisonRAG\([Zou et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib19)\)\. Retrieval pipeline with document poisoning\. Downstream metric:answer correctness \(EM/ACC\)under poisoned retrieval\. The corruption enters through external content rather than through an agent’s own state\.
InjecAgent\([Zhan et al\., 2024](https://arxiv.org/html/2611.23362#bib.bib22)\)\. Planner–executor–monitor tool\-use MAS\. Downstream metric:task successand valid tool traces under channel injection\. Tool payloads give the message channel a wide benign spread, which makes this the hardest setting for magnitude\-only monitors\.
### B\.3Data Splits and Logging Protocol
Every trajectory is executed once by the unmodified workflow and logged as a partial\-order event graph with the parser of Appendix[A\.1](https://arxiv.org/html/2611.23362#A1.SS1)\. Logging records agent id, role, task id, state fields, message and tool payloads, and task\-progress summaries per event, together with the producer of each consumed message; no agent prompt is modified for instrumentation, so the logged execution is the execution that ran\.
Benign train\.FitTrace\-Mascontracts and train or tune baselines that require benign logs; task ids are disjoint from the test split\.
Benign validation\.Set the thresholdτ\\tauat quantile levelδ\\deltaand produce the calibration curves of Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)\(a–b\)\. No attack labels enterTrace\-Mastraining or threshold fitting at any point\.
Test\.Attacked trajectories for Tables[1](https://arxiv.org/html/2611.23362#S6.T1)–[3](https://arxiv.org/html/2611.23362#S6.T3), with exactly one labeled initiating sourcecgtc^\{\\mathrm\{gt\}\}per trajectory for localization; three random seeds; mean±\\pmstd reported in all tables\.
Sec\. 4 observations\.One corruption object per trajectory; ASR matched across L1–L3 on GSM8K and CSQA so that level\-wise detection differences are not confounded by attack strength; the Obs\. 3 repair pool usesn=30n\{=\}30trajectories per hop bucket with clean EM=1\{=\}1and attacked EM=0\{=\}0, aligned with Fig\. 3\.
### B\.4Attack Levels \(L1–L3\)
The three levels differ in*which part of the execution graph*is edited, which is what lets us separate detection difficulty from attack strength\.
L1corrupts agent state \(prompt or scratchpad content\) without changing wire\-level message identity: the sender, receiver, and dependency structure are untouched\.
L2corrupts message or tool payloads while keeping the sender–receiver topology intact, so graph\-structure monitors observe an unchanged adjacency\.
L3corrupts coordination itself: dependencies are rewired, roles are skipped, or an agent is taken offline, so the edit is not visible in any single agent’s content\.
Each test trace carries exactly one attack at the specified level and one ground\-truth initiating event, which is what makes Hit@1 well defined\. Attack placement is drawn per seed from the eligible events of the trajectory, and the same placement stream is replayed for every defense, so all methods face identical trajectories\. On GSM8K and CSQA we additionally match pre\-defense ASR across levels \(Sec\.[B\.3](https://arxiv.org/html/2611.23362#A2.SS3)\), so a level\-wise drop in detection F1 in Table[1](https://arxiv.org/html/2611.23362#S6.T1)reflects reduced observability rather than a weaker attack\. Ground\-truth sources are used only for evaluation; they never enter contract training, threshold calibration, attribution, or repair selection\.
### B\.5Baselines
All methods share MAS topology, LLM decoding, attacks, splits, and, where applicable, the same benign calibration roundsk∈\[30,150\]k\\in\[30,150\]\. Each baseline keeps its native scoring rule and is given the inputs its design requires; we tune its threshold on the same benign validation split we use forτ\\tau\.
AcMAS\(\-R\)\([Xu et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib14)\)\. Activation and behavior monitoring at agent granularity; the \(\-R\) variant adds generic retry and reassignment as its recovery action\. It observes per\-agent signals, so L2 and L3 edits that leave agent activations close to benign are only visible through their downstream effects\.
BlindGuard\([Miao et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib5)\)\. Interaction\-graph anomaly detection from message statistics, without contract\-level expectations for a given role and relation type\.
G\-Safeguard\([Wang et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib4)\)\. Topology\-guided detection that assumes a stable workflow graph; it is the most affected by the dynamic topology stress test in Appendix[C\.1](https://arxiv.org/html/2611.23362#A3.SS1)\.
A\-Trust\([He et al\., 2025a](https://arxiv.org/html/2611.23362#bib.bib15)\)\. Trust aggregation over agents from historical compliance; it scores agents rather than events, so its localization output is an agent, which we map to that agent’s highest\-scoring event for Hit@1\.
AgentSafe\([Mao et al\., 2025](https://arxiv.org/html/2611.23362#bib.bib21)\)\. Per\-agent sanitization and self\-checks without cross\-agent counterfactual rollback\.
Oracle Anomaly Ranking\.Every row, curve, or legend labeled “Oracle” denotes thesameweak baseline:*Oracle Anomaly Ranking*, a magnitude and ranking monitor without contract training or counterfactual attribution\. It appears in Tables[1](https://arxiv.org/html/2611.23362#S6.T1)–[3](https://arxiv.org/html/2611.23362#S6.T3), Table[9](https://arxiv.org/html/2611.23362#A2.T9), Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5), the recovery figures, and the Appendix[C](https://arxiv.org/html/2611.23362#A3)stress plots whenever the standard baseline set is shown\. Mechanism: residual\-feature ranking without role\-conditioned contract training or counterfactual attribution\. It may receive a privileged hint during*benign calibration*for ranking evaluation only, and never receives ground\-truth attack locations at test time\. Low F1 or suboptimal recovery relative toTrace\-Masis therefore expected; “Oracle” here isnota clairvoyant upper bound\.
GT\-source repair \(diagnostic only\)\.Fig\. 3 and related panels use*GT\-source repair*, which applies our repair operators at theground\-truth initiating sourceon held\-out diagnostic trajectories\. It is a reference curve that isolates repair quality from attribution quality; it isnotOracle Anomaly Ranking and isnotavailable at deployment\.
Ablations \(Table[4](https://arxiv.org/html/2611.23362#S6.T4)\)\.Independent Contract \(per\-agent contracts without relation\-aware context\); w/o Transition Contract \(absolute\-embedding scoring instead of residual contracts\); w/o Violation \(no contract alerting, so attribution runs on magnitude ranking\); w/o Predictive Repair \(fixed operators without rollout\-based selection\)\. Each variant is retrained on the same benign split with the same schedule as the full model, so the rows differ only in the removed component\.
### B\.6Metrics
Unless stated otherwise, every metric is computed per benchmark and per seed and reported as mean±\\pmstd over seeds\{0,1,2\}\\\{0,1,2\\\}\.
Detection\.Trajectory\-level F1 and AUROC \(Table[1](https://arxiv.org/html/2611.23362#S6.T1)\)\. A trajectory is flagged when its native trajectory score exceeds the method’s calibrated threshold; forTrace\-Masthis ismaxtV\(et\)\>τ\\max\_\{t\}V\(e\_\{t\}\)\>\\tau\. WithTP\\mathrm\{TP\},FP\\mathrm\{FP\}, andFN\\mathrm\{FN\}counted over trajectories,F1=2TP/\(2TP\+FP\+FN\)\\mathrm\{F1\}=2\\mathrm\{TP\}/\(2\\mathrm\{TP\}\+\\mathrm\{FP\}\+\\mathrm\{FN\}\)\. AUROC uses each method’s native trajectory score in the orientation declared by that method, with higher meaning more anomalous\. The two are reported together because they measure different things and can disagree: F1 is evaluated at each method’s calibrated operating point, whereas AUROC is threshold\-free and summarizes the ranking over all thresholds\.
On AUROC values below 50%\.Several baseline entries in Table[1](https://arxiv.org/html/2611.23362#S6.T1)fall below 50%, and we read them as follows\. For a fixed score orientation, AUROC is the probability that a randomly chosen attacked trajectory is ranked above a randomly chosen benign one, and it satisfiesAUROC\(−s\)=1−AUROC\(s\)\\mathrm\{AUROC\}\(\-s\)=1\-\\mathrm\{AUROC\}\(s\)for any scoress\. A value below 50% therefore states that, on that split, the method’s own statistic ranks attacked trajectories*below*benign ones: the score is anti\-correlated with the attack rather than merely uninformative\. This is a well\-defined outcome of the definition, not a computation error, and it is what the score’s declared orientation produces on that split\.
Sub\-50% AUROC is also reported in prior evaluations of monitors from the same families, including multiple sub\-50% entries in the AcMAS evaluation\([Xu et al\., 2026](https://arxiv.org/html/2611.23362#bib.bib14)\), so its occurrence here is consistent with published behavior of these scores rather than specific to our testbed\.
We do not flip scores post hoc, for two reasons that follow from the protocol\. First, choosing the orientation per split requires knowing on that split which direction separates attacks, which is exactly the attack supervision that no method in Table[1](https://arxiv.org/html/2611.23362#S6.T1)is given \(Sec\.[B\.7\.2](https://arxiv.org/html/2611.23362#A2.SS7.SSS2)\); a deployed monitor must commit to one orientation before the attack is seen\. Second, by the identity above, flipping every sub\-50% entry would raise all of them above 50% by construction, so the resulting column would report an oracle\-selected orientation rather than a property of the detector\. Reporting the unflipped value keeps the column comparable across levels and methods\.
The sub\-50% entries are concentrated at L2 and L3, which is consistent with Obs\. 1: when the injected content is carried by messages or dependencies and is then consumed by agents whose own behavior stays on\-policy, an agent\-centric statistic can move*toward*its benign range on attacked trajectories, so the induced ranking inverts instead of flattening\. The very low L3 AUROC of Oracle Anomaly Ranking has a further, structural cause: its trajectory score is a maximum over per\-event magnitudes, and L3 attacks that skip a role or take an agent offline remove events, so the attacked trajectory takes a maximum over fewer events and tends to score*below*a benign one\. The same rows show that F1 and AUROC need not degrade together, since a method can retain a usable operating point while losing the global ordering\.
Localization\.Hit@1 and mean hop distance tocgtc^\{\\mathrm\{gt\}\}\(Table[2](https://arxiv.org/html/2611.23362#S6.T2)\)\. Hit@1 is the fraction of attacked trajectories whose top\-ranked candidatec⋆c^\{\\star\}equals the labeled initiating event, and the hop distance isd\(c⋆,cgt\)d\(c^\{\\star\},c^\{\\mathrm\{gt\}\}\)measured in the partial\-order graph, averaged over trajectories\. Reporting both matters because a method can miss Hit@1 while staying one hop away \(a symptom adjacent to the source\) or while pointing at an unrelated branch\.
Recovery\.ASR and ACC \(Table[3](https://arxiv.org/html/2611.23362#S6.T3)\); TCR and mean post\-alert operator count \(Table[9](https://arxiv.org/html/2611.23362#A2.T9)\)\. ASR is the fraction of attacked trajectories in which the attack goal is still achieved after the defense acts, and ACC is the benchmark task metric of Sec\.[B\.2](https://arxiv.org/html/2611.23362#A2.SS2)evaluated on the post\-defense trajectory\. TCR \(task\-correct recovery\) is computed on the attack\-successful pool \(clean EM=1\{=\}1, attacked EM=0\{=\}0\) and is the fraction of that pool whose task output becomes correct after the committed intervention\. Cost is the mean number of post\-alert operators applied per trajectory, so a defense that suppresses the attack by editing many events pays for it here rather than in ASR\.
Ablation \(Table[4](https://arxiv.org/html/2611.23362#S6.T4)\)\.Detect\(F1\) onbalancedL1–L3 pooled splits, not level\-stratified as in Table[1](https://arxiv.org/html/2611.23362#S6.T1)\. Every row, including Full, is retrained end to end with all three seeds \(Sec\.[B\.7\.3](https://arxiv.org/html/2611.23362#A2.SS7.SSS3)\) and evaluated on these pooled splits, so the Full row’s Hit@1 and TCR are re\-measured under this protocol and are not expected to equal the per\-benchmark entries of Tables[2](https://arxiv.org/html/2611.23362#S6.T2)and[9](https://arxiv.org/html/2611.23362#A2.T9)\.
Efficiency\.Wall\-clock milliseconds for the non\-LLM stages, excluding bulk LLM generation \(Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\); the corresponding cost model is in Appendix[D\.6](https://arxiv.org/html/2611.23362#A4.SS6)\.
### B\.7Shared Implementation Settings and Reproducibility
#### B\.7\.1Computation Resources and Software
Table[7](https://arxiv.org/html/2611.23362#A2.T7)summarizes the machine used for contract training, benign calibration, and non\-LLM runtime profiling \(Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\)\. Trajectory generation uses the LLM stack in Table[8](https://arxiv.org/html/2611.23362#A2.T8); bulk LLM wall time is excluded from the efficiency plots as in Sec\. 6, because it is incurred by the underlying MAS rather than by the defense\.
We implementTrace\-Masand the learned baselines inPyTorch\(CUDA\)\. Event logs are parsed into partial\-order graphs with fixed deterministic tie\-breaking, so repeated parses of the same log yield identical graphs and identical scores\. Frozen text encoding usessentence\-transformers\(all\-MiniLM\-L6\-v2\) and is never fine\-tuned \(Appendix[A\.3](https://arxiv.org/html/2611.23362#A1.SS3)\)\. Multi\-agent rollouts callQwen2\.5\-7B\-Instruct\([Qwen Team, 2024](https://arxiv.org/html/2611.23362#bib.bib31)\)through the benchmark GGUF backends \(Table[8](https://arxiv.org/html/2611.23362#A2.T8)\)\. Exact Python, PyTorch, and CUDA versions are pinned in the anonymizedrequirements\.txt\.
#### B\.7\.2Unified Evaluation Protocol
Following Sec\.[B\.1](https://arxiv.org/html/2611.23362#A2.SS1), all methods in Tables[1](https://arxiv.org/html/2611.23362#S6.T1),[2](https://arxiv.org/html/2611.23362#S6.T2),[3](https://arxiv.org/html/2611.23362#S6.T3),[4](https://arxiv.org/html/2611.23362#S6.T4),[9](https://arxiv.org/html/2611.23362#A2.T9), and Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)share: \(i\) the same five benchmark workflows and task metrics; \(ii\) identical L1–L3 injection and disjoint benign train, validation, and test task ids; \(iii\) the same trajectory LLM decoding \(Table[8](https://arxiv.org/html/2611.23362#A2.T8)\) for MAS execution and for repair; \(iv\) the same benign calibration schedule \(k∈\[30,150\]k\\in\[30,150\]rounds with shared quantile refresh\); \(v\) three random seeds on attacked test trajectories \(mean±\\pmstd\)\.Trace\-Masfits contracts on the benign train split only, and attack labels never enter training or threshold fitting\. ExecFormer hyperparameters are fixed in Appendix A \(Table[6](https://arxiv.org/html/2611.23362#A1.T6)\) and are not re\-tuned per benchmark, so no part of the reported gain comes from per\-dataset search\.
#### B\.7\.3Randomness and Reporting
Seeds\{0,1,2\}\\\{0,1,2\\\}control attack placement, dataloader order, and dropout where present\. Contract training initializes with seed 0 unless an ablation retrains end to end \(Table[4](https://arxiv.org/html/2611.23362#S6.T4)\), in which case all three seeds are used per variant\. No post\-hoc score flipping is applied anywhere, including AUROC \(Sec\.[B\.6](https://arxiv.org/html/2611.23362#A2.SS6)\)\.
Calibration \(Q4\)\.Each calibration round refreshes the benign quantile on the validation split; Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)uses the same schedule for every method, so the curves compare data efficiency of calibration rather than different calibration budgets\.
Deployment stress \(Appendix[C](https://arxiv.org/html/2611.23362#A3)\)\.Message delayℓ∈\{0,…,5\}\\ell\\in\\\{0,\\ldots,5\\\}; agent countN∈\{2,4,8,16,32\}N\\in\\\{2,4,8,16,32\\\}; dynamic\-edge fraction in\[0\.2,1\.0\]\[0\.2,1\.0\]; execution imbalanceIR=minifi/maxifi\\mathrm\{IR\}=\\min\_\{i\}f\_\{i\}/\\max\_\{i\}f\_\{i\}over per\-agent event counts, in\[0\.2,1\.0\]\[0\.2,1\.0\]\. One factor is varied at a time with attacks, splits, and calibration protocol held fixed\.
#### B\.7\.4Supplementary Tables \(Hardware, LLM, Recovery Cost\)
Tables[7](https://arxiv.org/html/2611.23362#A2.T7)–[9](https://arxiv.org/html/2611.23362#A2.T9)collect the implementation settings and the Q3 supplement referenced above\. Table[9](https://arxiv.org/html/2611.23362#A2.T9)reports TCR↑\\uparrowand post\-alert operator cost \(Cost↓\\downarrow\) alongside Table[3](https://arxiv.org/html/2611.23362#S6.T3); per\-column best results arebold\. Reading the two columns together is the point of the table: a method can raise TCR by intervening aggressively, so the cost column is what distinguishes recovery from over\-correction\.
Table 7:Hardware used for contract training, calibration, and non\-LLM profiling\.Table 8:Trajectory LLM and decoding defaults shared across benchmarks\.Table 9:Recovery quality and intervention cost \(Q3 supplement to Table[3](https://arxiv.org/html/2611.23362#S6.T3)\)\. TCR↑\\uparrowand post\-alert operator count Cost↓\\downarrowon five benchmarks \(mean±\\pmstd, %\)\. Bestbold; second\-bestunderlined\.
## Appendix CAdditional Results
Sec\. 6\.5 reports benign calibration and hyperparameter sensitivity in the main text \(Fig\.[5](https://arxiv.org/html/2611.23362#S6.F5)\)\. This appendix reports the two experiment groups deferred from there: \(i\) deployment robustness, i\.e\. whether contracts calibrated on benign logs remain useful when the runtime environment differs from the one assumed by the workflow template \(Sec\.[C\.1](https://arxiv.org/html/2611.23362#A3.SS1)\); and \(ii\) localization under different MAS communication structures \(Sec\.[C\.2](https://arxiv.org/html/2611.23362#A3.SS2)\)\. It then reports two checks of the repair stage: \(iii\) how faithfully the contract\-space rollout of Appendix[A\.7\.2](https://arxiv.org/html/2611.23362#A1.SS7.SSS2)predicts real re\-execution \(Sec\.[C\.3](https://arxiv.org/html/2611.23362#A3.SS3)\); and \(iv\) a comparison of localization and repair under the same input, the same operators, and the same budget \(Sec\.[C\.4](https://arxiv.org/html/2611.23362#A3.SS4)\)\.
Protocol \(Secs\.[C\.1](https://arxiv.org/html/2611.23362#A3.SS1)–[C\.2](https://arxiv.org/html/2611.23362#A3.SS2)\)\.All stress tests varyonefactor at a time\. Attacks, task splits, seeds, and the metric definitions are those of Appendix[B](https://arxiv.org/html/2611.23362#A2), and the benign calibration procedure of Appendix[B\.7\.2](https://arxiv.org/html/2611.23362#A2.SS7.SSS2)is applied unchanged in every configuration, so no method is evaluated with a threshold fitted under a different regime\. Method\-side hyperparameters stay at the defaults of Appendix[A\.9](https://arxiv.org/html/2611.23362#A1.SS9); nothing is re\-tuned per configuration\. Each panel therefore isolates the effect of the environment on the monitors themselves rather than on their tuning\.
### C\.1Deployment Robustness
The four factors below correspond to assumptions that monitoring methods commonly make about an MAS: synchronous visibility, fixed scale, static topology, and comparable per\-agent activity\. Each factor breaks one of them\.
Message delay \(Fig\.[7](https://arxiv.org/html/2611.23362#A3.F7)\)\.End\-to\-end message visibility is delayed byℓ∈\{0,…,5\}\\ell\\in\\\{0,\\ldots,5\\\}units, so an event may be observed well after the step that produced it\.Trace\-Maskeeps detection F1 stable because the partial\-order event graph is built from producer–consumer links rather than from wall\-clock rounds \(Appendix[A\.1](https://arxiv.org/html/2611.23362#A1.SS1)\): delaying delivery changes when an edge is observed but not which events it connects, and the contextctc\_\{t\}the contract conditions on is unchanged\. Timing\-sensitive baselines \(AcMAS\(\-R\), A\-Trust, AgentSafe\) degrade as delay grows, since their per\-round aggregates mix events that no longer belong to the same logical step\.
Agent scale \(Fig\.[8](https://arxiv.org/html/2611.23362#A3.F8)\)\.We replicate role templates forN∈\{2,4,8,16,32\}N\\in\\\{2,4,8,16,32\\\}, keeping the task and attack protocol fixed\.Trace\-Masremains comparatively flat because scoring is per event and conditioned on role and relation type, so adding agents adds events without diluting the signal at the corrupted one\. Trust\- and activation\-heavy monitors lose signal as graphs grow, since they aggregate over more agents to reach one decision and the corrupted contribution shrinks in the pooled statistic\.
Dynamic topology \(Fig\.[9](https://arxiv.org/html/2611.23362#A3.F9)\)\.We vary the fraction of time\-varying communication edges in\[0\.2,1\.0\]\[0\.2,1\.0\]\. Contract scores do not reference a fixed adjacency matrix: the encoder aggregates whichever parents an event actually has, so a re\-routed message is still scored against the contract for its relation type\. Topology\-centric baselines drop when edges churn, because edge churn is itself the anomaly signal they rely on\.
Execution imbalance \(Fig\.[10](https://arxiv.org/html/2611.23362#A3.F10)\)\.The per\-agent event\-rate ratioIR=minifi/maxifi∈\[0\.2,1\.0\]\\mathrm\{IR\}=\\min\_\{i\}f\_\{i\}/\\max\_\{i\}f\_\{i\}\\in\[0\.2,1\.0\]\(1 is balanced; smaller is more skewed\) sets how unevenly the agents speak\. Because the contract predicts a context\-dependent spreadΣt\\Sigma\_\{t\}as well as a mean \(Appendix[A\.4](https://arxiv.org/html/2611.23362#A1.SS4)\), a talkative agent’s larger raw deviations are normalized by its own benign variability, which is exactly the effect described by Property 3 in Appendix[D\.2](https://arxiv.org/html/2611.23362#A4.SS2)\. Role\-conditioned residuals therefore avoid the volume\-only false alarms that hurt uniform\-rhythm heuristics\.
Taken together, the four panels test the deployment assumption behind Q4: thresholds fit on benign logs should stay usable when coordination timing, scale, and structure move away from the calibration setting, and the factors that degrade the baselines are the ones their representations depend on\.
Figure 7:Effect of alert delay\. Detection F1 under increasing end\-to\-end latency on GSM8K, CSQA, HotPotQA, and InjecAgent\.Trace\-Masdoes not assume synchronous communication and stays comparatively flat\.Figure 8:Robustness to agent scale\. Detection F1 vs\.N∈\{2,4,8,16,32\}N\\in\\\{2,4,8,16,32\\\}on four benchmarks\.Figure 9:Robustness to dynamic topology\. Detection F1 vs\. dynamic\-edge fraction on four benchmarks\.Figure 10:Robustness to execution imbalance\. Detection F1 vs\. imbalance ratio IR on four benchmarks\.
### C\.2Localization under Varying Topologies
Detection robustness does not imply attribution robustness: changing the communication structure changes the ancestor sets that candidate sources are drawn from, and hence the number of plausible explanations per alert\. We therefore evaluate Hit@1 on GSM8K, CSQA, HotPotQA, and PoisonRAG under Chain, Star, Hierarchical, and Dense communication templates \(Fig\.[11](https://arxiv.org/html/2611.23362#A3.F11)\), with attacks, splits, and defaults unchanged\.
The four templates span the range that matters for attribution\. A Chain gives each alert a single upstream path, so candidates are few and mostly on one branch; a Star concentrates traffic through a hub whose events are ancestors of almost everything; a Hierarchy adds depth, which increases the hop distance between an injected source and the event where it becomes visible; and a Dense template maximizes the number of ancestors within the hop limitHH, so magnitude\-based ranking has the most opportunity to pick a symptom\.
Trace\-Masconsistently outperforms AgentSafe, G\-Safeguard, and A\-Trust across these structures because attribution scores the violation drop obtained by restoring a candidate rather than the violation level of an event \(Appendix[A\.6\.3](https://arxiv.org/html/2611.23362#A1.SS6.SSS3)\)\. By the locality ofRestore\\mathrm\{Restore\}\(Property 4 in Appendix[D\.4](https://arxiv.org/html/2611.23362#A4.SS4)\), candidates that are not upstream of the corrupted branch contribute no drop and are ranked out automatically, which is what keeps the candidate set manageable in the Star and Dense templates where the raw ancestor count is largest\.
Figure 11:Localization under varying MAS topologies\. Hit@1 on four benchmarks over Chain, Star, Hierarchical, and Dense structures\.
### C\.3Rollout Fidelity under Real Re\-execution
Repair selection ranks the operators in𝒰\(c⋆\)\\mathcal\{U\}\(c^\{\\star\}\)by the rollout estimate𝒥^\(u\)\\hat\{\\mathcal\{J\}\}\(u\)instead of executing each of them\. This subsection tests that substitution directly by executing every candidate\.
Paired pool\.Secs\.[C\.3](https://arxiv.org/html/2611.23362#A3.SS3)and[C\.4](https://arxiv.org/html/2611.23362#A3.SS4)share one*paired ablation pool*𝒫\\mathcal\{P\}: attack\-successful trajectories from the Q3 repair pool \(Sec\.[B\.6](https://arxiv.org/html/2611.23362#A2.SS6)\), with\|𝒫\|=6\|\\mathcal\{P\}\|\{=\}6trajectories, theE2\-litecommit path, i\.e\. the repair stage of Sec\.[A\.7](https://arxiv.org/html/2611.23362#A1.SS7)run at a budget ofB=1B\{=\}1committed operator per trajectory with LLM regeneration restricted to the edited branch, the deployment defaultsK=1K\{=\}1and Appendix[A\.9](https://arxiv.org/html/2611.23362#A1.SS9), and seed 0\. Because both subsections need every candidate operator re\-executed by the trajectory LLM,𝒫\\mathcal\{P\}is sized for exhaustive re\-execution rather than for the per\-benchmark resolution of the main tables, and all numbers below are single\-seed\. This pool is smaller than the full attacked\-test splits behind Table[2](https://arxiv.org/html/2611.23362#S6.T2)and is used only to pair localization, rollout, and re\-execution under identical inputs; it isnota re\-report of Table[2](https://arxiv.org/html/2611.23362#S6.T2)\.
Procedure\.For each trajectory in𝒫\\mathcal\{P\}the attributed eventc⋆c^\{\\star\}is fixed\. For everyu∈𝒰\(c⋆\)u\\in\\mathcal\{U\}\(c^\{\\star\}\)we compute \(i\)𝒥^\(u\)\\hat\{\\mathcal\{J\}\}\(u\)from Appendix[A\.7\.2](https://arxiv.org/html/2611.23362#A1.SS7.SSS2)and \(ii\)𝒥\(u\)\\mathcal\{J\}\(u\)after committinguuand re\-executingDesc\(c⋆\)\\mathrm\{Desc\}\(c^\{\\star\}\)with the same decoding and template steps\. Every candidate is executed once offline; deployment still commits onlyu⋆=argminu𝒥^\(u\)u^\{\\star\}=\\arg\\min\_\{u\}\\hat\{\\mathcal\{J\}\}\(u\)\.
Reported quantities\.*Match*is the fraction of trajectories on which re\-execution under everyuuyields the sameKKwindow events as the rollout \(Property 7 precondition\)\.*Agr*is the fraction withu⋆=uoptu^\{\\star\}=u^\{\\mathrm\{opt\}\}foruopt=argminu𝒥\(u\)u^\{\\mathrm\{opt\}\}=\\arg\\min\_\{u\}\\mathcal\{J\}\(u\)\. Spearmanρ\\rhois the rank correlation between𝒥^\\hat\{\\mathcal\{J\}\}and𝒥\\mathcal\{J\}over𝒰\(c⋆\)\\mathcal\{U\}\(c^\{\\star\}\), averaged over trajectories; it measures agreement of the induced*ordering*, which is all that selection uses, and not the size of\|𝒥^−𝒥\|\\lvert\\hat\{\\mathcal\{J\}\}\-\\mathcal\{J\}\\rvert\. Onceu⋆=uoptu^\{\\star\}=u^\{\\mathrm\{opt\}\}on every trajectory, the regret of Property 6 andΔ\\DeltaTCR are zero by definition\.
Table 10:Rollout fidelity under real LLM re\-execution on the paired ablation pool \(offline exhaustive re\-execution per candidate; deployed cost remains one commit\)\.Metric \(paired pool𝒫\\mathcal\{P\},K=1K\{=\}1, E2\-lite,B=1B\{=\}1\)ValueMatch: rollout window==re\-execution window \(%\)↑\\uparrow100Agr:u⋆=uoptu^\{\\star\}=u^\{\\mathrm\{opt\}\}\(%\)↑\\uparrow100Spearman\(𝒥^,𝒥\)\\bigl\(\\hat\{\\mathcal\{J\}\},\\mathcal\{J\}\\bigr\)↑\\uparrow1\.00Δ\\DeltaTCR: TCR\(u⋆u^\{\\star\}\)−\-TCR\(uoptu^\{\\mathrm\{opt\}\}\) \(points\)0Three readings follow, and they are deliberately limited to what the table measures\. First, the precondition of Property 7 holds throughout: atK=1K\{=\}1no operator in𝒰\(c⋆\)\\mathcal\{U\}\(c^\{\\star\}\)added or removed a window event under re\-execution, so the matched\-window form of Eq\. \([53](https://arxiv.org/html/2611.23362#A4.E53)\) applies on every trajectory\. Second, the rollout orders the operators exactly as re\-execution does \(ρ=1\.00\\rho\{=\}1\.00\) and selects the same operator on every trajectory, so the conclusion of Property 6 and Corollary 1 holds here with zero regret, and the task cost of ranking by𝒥^\\hat\{\\mathcal\{J\}\}instead of executing all candidates is zero\. Third, this is evidence about the*ordering*rather than about the magnitude ofν\(u\)\\nu\(u\)andθ\(u\)\\theta\(u\): a rank correlation of1\.001\.00is compatible with a non\-zero value gap between𝒥^\\hat\{\\mathcal\{J\}\}and𝒥\\mathcal\{J\}, and what the result shows is that whatever gap remains is smaller than the separation between operators, which is the condition Corollary 1 requires\. Since the deployed rule uses only the ordering, this is the property the repair stage depends on\. Both tables are measured on𝒫\\mathcal\{P\}; the Q3 numbers in Tables[3](https://arxiv.org/html/2611.23362#S6.T3)and[9](https://arxiv.org/html/2611.23362#A2.T9)remain those of the full test splits\.
### C\.4Localization and Repair under the Same Input, Operators, and Budget
Tables[3](https://arxiv.org/html/2611.23362#S6.T3)and[9](https://arxiv.org/html/2611.23362#A2.T9)evaluate each defense with its native response \(retry, quarantine, sanitization, or our repair\), so they compare complete defenses\. This subsection separates the two stages on the paired pool𝒫\\mathcal\{P\}of Sec\.[C\.3](https://arxiv.org/html/2611.23362#A3.SS3)\.
Protocol\.*Same input:*every row localizes on the same six trajectories in𝒫\\mathcal\{P\}, whether or not its own detector would have fired\.*Same operators:*each row’s top\-ranked event is passed to the identical E2\-lite repair module \(𝒰\(⋅\)\\mathcal\{U\}\(\\cdot\), rollout withK=1K\{=\}1,λ1,λ2\\lambda\_\{1\},\\lambda\_\{2\}as in Sec\.[A\.7](https://arxiv.org/html/2611.23362#A1.SS7)\)\.*Same budget:*B=1B\{=\}1committed operator per trajectory and the same regeneration scope\. Hit@1 is the fraction withc⋆=cgtc^\{\\star\}=c^\{\\mathrm\{gt\}\}on𝒫\\mathcal\{P\}only; because\|𝒫\|=6\|\\mathcal\{P\}\|\{=\}6, percentages appear in steps of100/6≈16\.7100/6\{\\approx\}16\.7andmust not be comparedto Table[2](https://arxiv.org/html/2611.23362#S6.T2), which aggregates the full attacked\-test protocol\.
Localizers \(Table[11](https://arxiv.org/html/2611.23362#A3.T11)\)\.Each baseline supplies its own ranking;*Full monitoring*is contract violation alerting withargmaxtV\(et\)\\arg\\max\_\{t\}V\(e\_\{t\}\)localization, i\.e\. the “w/o CVA” diagnostic of Fig\. 2, in which counterfactual violation attribution \(CVA\) is replaced by max\-violation ranking, so neitherRestore\\mathrm\{Restore\}norR\(c\)R\(c\)is used;*Trace\-Mas\(CVA\)*is the full rulec⋆=argmaxcR\(c\)c^\{\\star\}=\\arg\\max\_\{c\}R\(c\)of Sec\. 5\.3\. TCR uses the definition of Sec\.[B\.6](https://arxiv.org/html/2611.23362#A2.SS6), evaluated on𝒫\\mathcal\{P\}, whose trajectories are attack\-successful by construction\.
Selection rules \(Table[12](https://arxiv.org/html/2611.23362#A3.T12)\)\.Withc⋆c^\{\\star\}fixed, we vary only howuuis chosen over𝒰\(c⋆\)\\mathcal\{U\}\(c^\{\\star\}\): the fixed operator used in the w/o Predictive Repair ablation, a uniform random operator, rollout ranking \(argminu𝒥^\(u\)\\arg\\min\_\{u\}\\hat\{\\mathcal\{J\}\}\(u\)\), and exhaustive re\-execution ranking \(argminu𝒥\(u\)\\arg\\min\_\{u\}\\mathcal\{J\}\(u\), the reference from Sec\.[C\.3](https://arxiv.org/html/2611.23362#A3.SS3)\)\.
Table 11:Paired ablation on pool𝒫\\mathcal\{P\}\(\|𝒫\|=6\|\\mathcal\{P\}\|\{=\}6\): localizer varied, repair module and budget fixed \(Hit@1 and TCR in %, single seed\)\. One trajectory is16\.716\.7points, so single\-trajectory gaps are within the resolution of the pool and no entry is bolded; the paper’s method comparisons are Tables[2](https://arxiv.org/html/2611.23362#S6.T2)and[9](https://arxiv.org/html/2611.23362#A2.T9), to which these values are not comparable\.Table 12:Paired ablation on𝒫\\mathcal\{P\}: selection rule varied \(TCR in %, single seed\)\. Rollout selection commits the same operator as exhaustive re\-execution, consistent with Table[10](https://arxiv.org/html/2611.23362#A3.T10)\.On𝒫\\mathcal\{P\}, sharing the repair module isolates*where*to act from*how*to act\. The pool is small enough that a one\-trajectory difference \(16\.716\.7points\) is within its resolution, so we read only the larger gaps\. Read with that caveat, responsibility attribution recovers the most tasks of any localizer in the table: two trajectories more than max\-violation ranking \(66\.766\.7vs\.33\.333\.3\) and than the trust\- and topology\-centric localizers G\-Safeguard and A\-Trust, three more than the activation\-centric AcMAS \(16\.716\.7\), and one more than AgentSafe \(50\.050\.0\)\. The comparison with Max\-VVis the informative one, because that row shares our violation score and our repair module and differs only in replacingR\(c\)R\(c\)withargmaxtV\(et\)\\arg\\max\_\{t\}V\(e\_\{t\}\); the gap is the direction Obs\. 2 and Property 5 predict, namely that the event with the largest violation is not the event whose repair restores the task\. Two entries should not be over\-read\. Max\-VVis one trajectory above CVA on Hit@1 here, which this pool cannot resolve and which the full attacked\-test protocol of Table[2](https://arxiv.org/html/2611.23362#S6.T2)settles in the other direction; and the one\-trajectory gap to AgentSafe is at the resolution of the pool\. What the pool adds over Table[9](https://arxiv.org/html/2611.23362#A2.T9)is that Hit@1 and TCR are measured on identical inputs through an identical repair module at an identical budget, so a difference between rows is attributable to the localization stage alone; it is not itself a method ranking, and the paper’s recovery claims remain those of Tables[3](https://arxiv.org/html/2611.23362#S6.T3)and[9](https://arxiv.org/html/2611.23362#A2.T9)\.
Two features of the table follow from the pool rather than from the methods and are worth stating so they are not read as inconsistencies\. First, every Hit@1 here is far below the corresponding column of Table[2](https://arxiv.org/html/2611.23362#S6.T2):𝒫\\mathcal\{P\}contains only attack\-successful trajectories at a single seed, i\.e\. the cases in which the corruption defeated the undefended workflow, and six such trajectories are not a localization measurement\. This is why the localization claims of the paper are made on the full protocol and why we read only TCR differences here\. Second, TCR exceeds Hit@1 for every row, which is expected rather than contradictory: recovery does not require the exact initiating event, since committing an operator on the corrupted branch near the source already restores many tasks, the effect quantified by the hop buckets of Fig\. 3 and by the tolerance to bounded amplification in Property 5\. Hit@1 and TCR therefore answer different questions on the same inputs, which is what makes the paired design useful\.
Table[12](https://arxiv.org/html/2611.23362#A3.T12)isolates the selection rule at a fixedc⋆c^\{\\star\}, so its first row is the same configuration as theTrace\-Mas\(CVA\) row of Table[11](https://arxiv.org/html/2611.23362#A3.T11)and carries the same value by construction\. Rollout selection equals exhaustive re\-execution, which is forced by Table[10](https://arxiv.org/html/2611.23362#A3.T10): at Agr=100%=100\\%the two rules commit the same operator on every trajectory, so they cannot differ in TCR\. It is one trajectory above the fixed operator and two above random selection, in the direction of the w/o Predictive Repair ablation, whose effect is quantified on the full splits in Table[4](https://arxiv.org/html/2611.23362#S6.T4)\. The point of the table is the pair of equalities and inequalities together: choosing the operator by𝒥^\\hat\{\\mathcal\{J\}\}costs no task recovery relative to executing all candidates, while ranking by anything cheaper than the rollout does\.
## Appendix DAnalytical Support
This appendix explains, at the level of the quantitiesTrace\-Mascomputes, why the three stages of Sec\. 5 are built the way they are\. Sec\.[D\.2](https://arxiv.org/html/2611.23362#A4.SS2)shows that the violation score of Sec\. 5\.2 is the training objective of that section evaluated at test time, that the benign quantile threshold of Eq\. \([27](https://arxiv.org/html/2611.23362#A1.E27)\) controls false alarms without attack labels, and that the detectable margin of a corruption is exactly the Mahalanobis norm of the deviation it induces\. Sec\.[D\.3](https://arxiv.org/html/2611.23362#A4.SS3)derives why ranking events by that margin does not localize the source\. Sec\.[D\.4](https://arxiv.org/html/2611.23362#A4.SS4)shows how the locality ofRestore\\mathrm\{Restore\}makes the responsibility score of Sec\. 5\.3 separate an initiating event from its symptoms, and states the one behavioral condition under which the separation holds\. Sec\.[D\.5](https://arxiv.org/html/2611.23362#A4.SS5)gives the stability of the repair\-selection rule of Sec\. 5\.4 under rollout error and bounds that error for the rollout of Appendix[A\.7\.2](https://arxiv.org/html/2611.23362#A1.SS7.SSS2)in terms of the calibrated thresholdτ\\tauand the depthKK, and Sec\.[D\.6](https://arxiv.org/html/2611.23362#A4.SS6)accounts for the cost of the pipeline\. Sec\.[D\.7](https://arxiv.org/html/2611.23362#A4.SS7)states what is not claimed\.
All statements below are properties of the model we fit and the scores we report; none of them is used to substitute for the empirical results in Sec\. 6\.
### D\.1Setup and Notation Bridge
We reuse the notation of Appendix[A](https://arxiv.org/html/2611.23362#A1)\. For eventete\_\{t\}with encoded contextctc\_\{t\}, the contract is the Gaussianpθ\(Δet∣ct\)=𝒩\(μt,Σt\)p\_\{\\theta\}\(\\Delta e\_\{t\}\\mid c\_\{t\}\)=\\mathcal\{N\}\(\\mu\_\{t\},\\Sigma\_\{t\}\)with diagonalΣt≻0\\Sigma\_\{t\}\\succ 0\(Eq\. \([23](https://arxiv.org/html/2611.23362#A1.E23)\)\), and the violation score is the Mahalanobis deviationV\(et\)V\(e\_\{t\}\)of Eq\. \([25](https://arxiv.org/html/2611.23362#A1.E25)\) between the observed transitionΔe~t\\widetilde\{\\Delta e\}\_\{t\}andμt\\mu\_\{t\}\. Since the channel weights\(β,γ\)\(\\beta,\\gamma\)of Eq\. \([25](https://arxiv.org/html/2611.23362#A1.E25)\) are equivalent to the rescaled diagonal covarianceΣ~t=diag\(Σth,Σtm/β,Σts/γ\)\\tilde\{\\Sigma\}\_\{t\}=\\mathrm\{diag\}\(\\Sigma^\{h\}\_\{t\},\\Sigma^\{m\}\_\{t\}/\\beta,\\Sigma^\{s\}\_\{t\}/\\gamma\), we keepΣt\\Sigma\_\{t\}for the trained covariance and writeΣ~t\\tilde\{\\Sigma\}\_\{t\}for the scoring covariance, so thatV\(et\)=∥Δe~t−μt∥Σ~t−12V\(e\_\{t\}\)=\\lVert\\widetilde\{\\Delta e\}\_\{t\}\-\\mu\_\{t\}\\rVert^\{2\}\_\{\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}\}; the two coincide atβ=γ=1\\beta=\\gamma=1\. Withdh,dm,dsd\_\{h\},d\_\{m\},d\_\{s\}the channel dimensions \(dz=dh\+dm\+dsd\_\{z\}=d\_\{h\}\+d\_\{m\}\+d\_\{s\}\), we writed¯=tr\(Σ~t−1Σt\)=dh\+βdm\+γds\\bar\{d\}=\\mathrm\{tr\}\(\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}\\Sigma\_\{t\}\)=d\_\{h\}\+\\beta d\_\{m\}\+\\gamma d\_\{s\}, which equalsdzd\_\{z\}atβ=γ=1\\beta=\\gamma=1\. The residual shrinkage of Appendix[A\.3](https://arxiv.org/html/2611.23362#A1.SS3)multiplies every violation term by the same constantγres2\\gamma\_\{\\mathrm\{res\}\}^\{2\}\. This changes no alert and notΩ\\Omega, and rescales the margins of Property 3; inR\(c\)R\(c\)and in the repair objective it rescales the violation terms relative toλpen\\lambda\_\{\\mathrm\{pen\}\},λ1\\lambda\_\{1\}, andλ2\\lambda\_\{2\}, so the statements below, written for the unshrunk score, hold with these weights read asλ/γres2\\lambda/\\gamma\_\{\\mathrm\{res\}\}^\{2\}\. We write∥b∥A2=b⊤Ab\\lVert b\\rVert^\{2\}\_\{A\}=b^\{\\top\}A\\,b,dzd\_\{z\}for the dimension ofΔet\\Delta e\_\{t\},d\(c,e\)d\(c,e\)for the hop distance in the partial\-order graph,Desc\(c\)\\mathrm\{Desc\}\(c\)for the strict descendants ofcc\(excludingcc\), and
Δc\(e\)=V\(e\)−Vcres\(e\)\\Delta\_\{c\}\(e\)\\;=\\;V\(e\)\-V^\{\\mathrm\{res\}\}\_\{c\}\(e\)\(40\)for the violation drop ateeafter restoring candidatecc, where the sum in Eq\. \([32](https://arxiv.org/html/2611.23362#A1.E32)\) runs overcctogether with its descendants\. BecauseRestorec\\mathrm\{Restore\}\_\{c\}writes the contract meanμc\\mu\_\{c\}while holding the contextccc\_\{c\}at its pre\-restoration value \(Appendix[A\.6\.2](https://arxiv.org/html/2611.23362#A1.SS6.SSS2)\),Vcres\(c\)=0V^\{\\mathrm\{res\}\}\_\{c\}\(c\)=0and henceΔc\(c\)=V\(c\)\\Delta\_\{c\}\(c\)=V\(c\)\. SinceV\(e\)−V~c\(e\)=ωΔc\(e\)V\(e\)\-\\tilde\{V\}\_\{c\}\(e\)=\\omega\\,\\Delta\_\{c\}\(e\), the responsibility score separates into a counterfactual term and the validity penalty,
R\(c\)=ωRcf\(c\)−λpen𝒫\(c\),Rcf\(c\)=∑e∈\{c\}∪Desc\(c\)ψd\(c,e\)Δc\(e\),R\(c\)\\;=\\;\\omega\\,R\_\{\\mathrm\{cf\}\}\(c\)\\;\-\\;\\lambda\_\{\\mathrm\{pen\}\}\\,\\mathcal\{P\}\(c\),\\qquad R\_\{\\mathrm\{cf\}\}\(c\)\\;=\\;\\sum\_\{e\\in\\\{c\\\}\\cup\\mathrm\{Desc\}\(c\)\}\\psi^\{\\,d\(c,e\)\}\\,\\Delta\_\{c\}\(e\),\(41\)so the gateω\\omegaonly rescalesRcfR\_\{\\mathrm\{cf\}\}against𝒫\\mathcal\{P\}\. All comparisons below are statements aboutRcfR\_\{\\mathrm\{cf\}\}and about the penalty difference between two candidates, so they hold for anyω\>0\\omega\>0\.
Throughout, a corruption at eventeeis described by the deviation it induces in contract space: the realized residual becomes
Δe~t=μt\+bt\+εt,εt∼𝒩\(0,Σt\),\\widetilde\{\\Delta e\}\_\{t\}\\;=\\;\\mu\_\{t\}\+b\_\{t\}\+\\varepsilon\_\{t\},\\qquad\\varepsilon\_\{t\}\\sim\\mathcal\{N\}\(0,\\Sigma\_\{t\}\),\(42\)wherebtb\_\{t\}is the induced shift \(bt=0b\_\{t\}=0on benign events\) andεt\\varepsilon\_\{t\}is the benign variability the contract already accounts for\. This description is not an assumption about the attacker: any edit to a logged field produces somebtb\_\{t\}, andbtb\_\{t\}is exactly the object our score sees\. It does assume that the contract is well specified on benign data, i\.e\. that benign residuals follow𝒩\(0,Σt\)\\mathcal\{N\}\(0,\\Sigma\_\{t\}\)with the trainedΣt\\Sigma\_\{t\}; Property 3 and Sec\.[D\.3](https://arxiv.org/html/2611.23362#A4.SS3)rely on this, whereas Properties 1, 2, 4, and 6 do not, and Property 7\(b\) uses instead the exchangeability assumption stated there\.
### D\.2From Benign Training to the Violation Score
Property 1 \(the score is the training objective\)\.For the scoring Gaussian𝒩\(μt,Σ~t\)\\mathcal\{N\}\(\\mu\_\{t\},\\tilde\{\\Sigma\}\_\{t\}\),
−log𝒩\(Δe~t;μt,Σ~t\)=12\[V\(et\)\+logdetΣ~t\+dzlog2π\],\-\\log\\mathcal\{N\}\(\\widetilde\{\\Delta e\}\_\{t\};\\mu\_\{t\},\\tilde\{\\Sigma\}\_\{t\}\)\\;=\\;\\tfrac\{1\}\{2\}\\Bigl\[V\(e\_\{t\}\)\+\\log\\det\\tilde\{\\Sigma\}\_\{t\}\+d\_\{z\}\\log 2\\pi\\Bigr\],\(43\)soV\(et\)=−2log𝒩\(Δe~t;μt,Σ~t\)−logdetΣ~t−dzlog2πV\(e\_\{t\}\)=\-2\\log\\mathcal\{N\}\(\\widetilde\{\\Delta e\}\_\{t\};\\mu\_\{t\},\\tilde\{\\Sigma\}\_\{t\}\)\-\\log\\det\\tilde\{\\Sigma\}\_\{t\}\-d\_\{z\}\\log 2\\pi\.
*Support\.*Substitute𝒩\(μt,Σ~t\)\\mathcal\{N\}\(\\mu\_\{t\},\\tilde\{\\Sigma\}\_\{t\}\)into the Gaussian density; sinceΣ~t−1=diag\(\(Σth\)−1,β\(Σtm\)−1,γ\(Σts\)−1\)\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}=\\mathrm\{diag\}\\bigl\(\(\\Sigma^\{h\}\_\{t\}\)^\{\-1\},\\beta\(\\Sigma^\{m\}\_\{t\}\)^\{\-1\},\\gamma\(\\Sigma^\{s\}\_\{t\}\)^\{\-1\}\\bigr\), the quadratic form isVh\+βVm\+γVsV\_\{h\}\+\\beta V\_\{m\}\+\\gamma V\_\{s\}, i\.e\. Eq\. \([25](https://arxiv.org/html/2611.23362#A1.E25)\)\.□\\square
Property 1 is an identity, not an approximation\. Atβ=γ=1\\beta=\\gamma=1it states that detection does not introduce a new criterion at test time: the score is the quadratic term of the negative log\-likelihood in Eq\. \([24](https://arxiv.org/html/2611.23362#A1.E24)\), evaluated on the test transition\. With\(β,γ\)=\(1,0\.5\)\(\\beta,\\gamma\)=\(1,0\.5\)the scored quantity is the same likelihood with the completion channel’s variance doubled, i\.e\. a fixed reweighting of the trained contract rather than a different model\. The implemented training loss additionally weights the per\-channel likelihoods by\(λh,λm,λs\)\(\\lambda\_\{h\},\\lambda\_\{m\},\\lambda\_\{s\}\)and adds two regularizers \(Appendix[A\.4](https://arxiv.org/html/2611.23362#A1.SS4)\); the identity therefore ties the score to the Gaussian model that training fits \(the sameμt\\mu\_\{t\}andΣt\\Sigma\_\{t\}\), not to the exact value of the implemented loss\. It also explains why the spread must be predicted rather than fixed: normalizing byΣ~t−1\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}is what makes the residual comparable across roles with different benign variability, and thelogdet\\log\\detterm of the training likelihood is what prevents the learned spread from growing to absorb large residuals\.
Property 2 \(benign calibration controls false alarms\)\.LetV1,…,VnV\_\{1\},\\dots,V\_\{n\}be the violation scores of the benign validation events and letV∗V^\{\\ast\}be the score of a fresh benign event, and suppose the calibration and test benign events are exchangeable and the score function is fixed before calibration \(the contract is fit on the disjoint training split\)\. Ifτ\\tauis the empiricalδ\\delta\-quantile of\{Vi\}\\\{V\_\{i\}\\\}as in Eq\. \([27](https://arxiv.org/html/2611.23362#A1.E27)\) withα=1\\alpha\{=\}1, then
Pr\[V∗\>τ\]≤1−δ\+1n\+1,\\Pr\\bigl\[V^\{\\ast\}\>\\tau\\bigr\]\\;\\leq\\;1\-\\delta\+\\tfrac\{1\}\{n\+1\},\(44\)and for a benign trajectory with\|𝒱\|\|\\mathcal\{V\}\|events the alarm probability obeys
Pr\[∃t:V\(et\)\>τ\]≤\|𝒱\|\(1−δ\+1n\+1\)\.\\Pr\\bigl\[\\exists\\,t:\\ V\(e\_\{t\}\)\>\\tau\\bigr\]\\;\\leq\\;\|\\mathcal\{V\}\|\\,\\bigl\(1\-\\delta\+\\tfrac\{1\}\{n\+1\}\\bigr\)\.\(45\)
*Support\.*The first inequality is the standard exchangeability \(conformal\) bound\([Vovk et al\., 2005](https://arxiv.org/html/2611.23362#bib.bib34);[Angelopoulos and Bates, 2021](https://arxiv.org/html/2611.23362#bib.bib35)\)for an empirical quantile threshold; the second follows by a union bound over the events of the trajectory, which requires no independence between events\.□\\square
Property 2 is the reason the calibration protocol of Sec\.[A\.5](https://arxiv.org/html/2611.23362#A1.SS5)needs no attack labels: the nominal false\-alarm level is a property ofδ\\deltaand the benign calibration sample, soτ\\taucan be fixed before any attack is observed\. It also quantifies the choiceδ=0\.99\\delta\{=\}0\.99, since the trajectory\-level bound degrades linearly with trajectory length and is informative only when\|𝒱\|\(1−δ\)\|\\mathcal\{V\}\|\(1\-\\delta\)is small; for long trajectories it is a worst\-case statement rather than a prediction of the observed alarm rate\. Raising the threshold toα⋅Quantileδ\\alpha\\cdot\\mathrm\{Quantile\}\_\{\\delta\}withα\>1\\alpha\>1can only lower the alarm probability, so the bound continues to hold, whereasα<1\\alpha<1is not covered by it\. The bound is one\-sided by design; it says nothing about detection power, which is the content of Property 3 and of Sec\. 6\.
Property 3 \(detectable margin of a corruption\)\.Under the description of Eq\. \([42](https://arxiv.org/html/2611.23362#A4.E42)\),
𝔼\[V\(et\)\]=d¯\+∥bt∥Σ~t−12,\\mathbb\{E\}\\bigl\[V\(e\_\{t\}\)\\bigr\]\\;=\\;\\bar\{d\}\+\\lVert b\_\{t\}\\rVert^\{2\}\_\{\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}\},\(46\)so a benign event has𝔼\[V\]=d¯\\mathbb\{E\}\[V\]=\\bar\{d\}and the expected margin of a corrupted event over a benign one is exactly∥bt∥Σ~t−12\\lVert b\_\{t\}\\rVert^\{2\}\_\{\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}\}\. Atβ=γ=1\\beta=\\gamma=1this reads𝔼\[V\]=dz\+∥bt∥Σt−12\\mathbb\{E\}\[V\]=d\_\{z\}\+\\lVert b\_\{t\}\\rVert^\{2\}\_\{\\Sigma\_\{t\}^\{\-1\}\}, andVVis non\-centralχdz2\\chi^\{2\}\_\{d\_\{z\}\}withVar\[V\]=2dz\+4∥bt∥Σt−12\\mathrm\{Var\}\[V\]=2d\_\{z\}\+4\\lVert b\_\{t\}\\rVert^\{2\}\_\{\\Sigma\_\{t\}^\{\-1\}\}\.
*Support\.*Withx=bt\+εtx=b\_\{t\}\+\\varepsilon\_\{t\}andεt∼𝒩\(0,Σt\)\\varepsilon\_\{t\}\\sim\\mathcal\{N\}\(0,\\Sigma\_\{t\}\),𝔼\[x⊤Σ~t−1x\]=tr\(Σ~t−1Σt\)\+bt⊤Σ~t−1bt\\mathbb\{E\}\[x^\{\\top\}\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}x\]=\\mathrm\{tr\}\(\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}\\Sigma\_\{t\}\)\+b\_\{t\}^\{\\top\}\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}b\_\{t\}\. Atβ=γ=1\\beta=\\gamma=1,Σt−1/2x∼𝒩\(Σt−1/2bt,I\)\\Sigma\_\{t\}^\{\-1/2\}x\\sim\\mathcal\{N\}\(\\Sigma\_\{t\}^\{\-1/2\}b\_\{t\},I\), and the variance is that of a non\-centralχ2\\chi^\{2\}withdzd\_\{z\}degrees of freedom and non\-centrality∥bt∥Σt−12\\lVert b\_\{t\}\\rVert^\{2\}\_\{\\Sigma\_\{t\}^\{\-1\}\}\.□\\square
Property 3 turns a design question into a measurable one\. Whether a corruption is visible depends not on its textual size but on the Mahalanobis norm of the deviation it induces*relative to the benign spread of that context*, the same quantity that Mahalanobis\-based out\-of\-distribution detectors threshold\([Lee et al\., 2018](https://arxiv.org/html/2611.23362#bib.bib36)\)\. This has three consequences for our design\. First, conditioning the contract on role and relation type \(Sec\.[A\.2](https://arxiv.org/html/2611.23362#A1.SS2)\) shrinksΣt\\Sigma\_\{t\}for a given edit and therefore increases∥bt∥Σ~t−12\\lVert b\_\{t\}\\rVert^\{2\}\_\{\\tilde\{\\Sigma\}\_\{t\}^\{\-1\}\}: the same injected message is more visible against a role\-specific expectation than against a global one\. Second, modeling transitions rather than absolute embeddings \(Sec\.[A\.3](https://arxiv.org/html/2611.23362#A1.SS3)\) removes benign content variation that would otherwise inflateΣt\\Sigma\_\{t\}\. Third, it explains Obs\. 1 without assuming anything about the attacker: a coordination\-level \(L3\) edit can leave the state channel almost unchanged, so monitors restricted to agent activations see a smallbtb\_\{t\}in the only channel they observe, while the same edit produces a large shift in the message and completion channels the contract covers\. We therefore do not assume a separation margin between attacked and benign transitions; Property 3 identifies what such a margin would consist of, and Table[1](https://arxiv.org/html/2611.23362#S6.T1)measures whether it materializes\.
### D\.3Why Magnitude Ranking Does Not Localize
Detection asks whether some event deviates; attribution asks which event started it\. These are different questions because the deviation propagates\.
Consider a corruption atcgtc^\{\\mathrm\{gt\}\}and a descendantvvreached alongEmsg∪EdepE\_\{\\mathrm\{msg\}\}\\cup E\_\{\\mathrm\{dep\}\}\. The contextcvc\_\{v\}that the contract conditions on is computed from the \(now corrupted\) fields of the events upstream ofvv, so both the observed residual atvvand the predictionμv\\mu\_\{v\}change\. Writing the induced shift atvvto first order in the shift at the source,
bv≈Jv←cgtbcgt,Jv←cgt=∂\(Δe~v−μv\)∂bcgt,b\_\{v\}\\;\\approx\\;J\_\{v\\leftarrow c^\{\\mathrm\{gt\}\}\}\\,b\_\{c^\{\\mathrm\{gt\}\}\},\\qquad J\_\{v\\leftarrow c^\{\\mathrm\{gt\}\}\}\\;=\\;\\frac\{\\partial\\bigl\(\\widetilde\{\\Delta e\}\_\{v\}\-\\mu\_\{v\}\\bigr\)\}\{\\partial b\_\{c^\{\\mathrm\{gt\}\}\}\},\(47\)Property 3 gives the resulting margins, and their ratio is
𝔼\[V\(v\)\]−d¯𝔼\[V\(cgt\)\]−d¯≈∥Jv←cgtbcgt∥Σ~v−12∥bcgt∥Σ~cgt−12,\\frac\{\\mathbb\{E\}\[V\(v\)\]\-\\bar\{d\}\}\{\\mathbb\{E\}\[V\(c^\{\\mathrm\{gt\}\}\)\]\-\\bar\{d\}\}\\;\\approx\\;\\frac\{\\lVert J\_\{v\\leftarrow c^\{\\mathrm\{gt\}\}\}b\_\{c^\{\\mathrm\{gt\}\}\}\\rVert^\{2\}\_\{\\tilde\{\\Sigma\}\_\{v\}^\{\-1\}\}\}\{\\lVert b\_\{c^\{\\mathrm\{gt\}\}\}\\rVert^\{2\}\_\{\\tilde\{\\Sigma\}\_\{c^\{\\mathrm\{gt\}\}\}^\{\-1\}\}\},\(48\)where the approximation is only the first\-order one above\. Nothing forces this ratio to be smaller than one\. It exceeds one whenever the propagation operator amplifies in theΣ~\\tilde\{\\Sigma\}\-metric, which happens in exactly the situations our benchmarks contain: a downstream role with tighter benign spread than the injecting role \(smallΣv\\Sigma\_\{v\}\), or a corrupted payload that a downstream agent expands into a longer, more confidently expected step\. This is the formal content of Obs\. 2 and of the mean\-hop column of Table[2](https://arxiv.org/html/2611.23362#S6.T2): the largest\-violation event is frequently a symptom rather than the origin, soargmaxtV\(et\)\\arg\\max\_\{t\}V\(e\_\{t\}\)is not guaranteed to returncgtc^\{\\mathrm\{gt\}\}, the same gap that motivates counterfactual root\-cause analysis of outliers in causal models\([Budhathoki et al\., 2022](https://arxiv.org/html/2611.23362#bib.bib37)\)\. Throughout Secs\.[D\.3](https://arxiv.org/html/2611.23362#A4.SS3)–[D\.4](https://arxiv.org/html/2611.23362#A4.SS4),cgtc^\{\\mathrm\{gt\}\}is the true initiating event, and the question is whetherc⋆=argmaxcR\(c\)c^\{\\star\}=\\arg\\max\_\{c\}R\(c\)recovers it\.
We stress that we do*not*posit an attenuating\-propagation condition of the formV\(v\)≤rd\(cgt,v\)V\(cgt\)V\(v\)\\leq r^\{d\(c^\{\\mathrm\{gt\}\},v\)\}V\(c^\{\\mathrm\{gt\}\}\)withr<1r<1\. Such a condition would make magnitude ranking correct by fiat and would contradict our own measurements\. The attribution rule of Sec\. 5\.3 is designed for the regime in which the ratio above can be large, and the next subsection shows why it survives there\.
### D\.4Why Counterfactual Responsibility Separates Source from Symptom
Two facts aboutRestore\\mathrm\{Restore\}carry the argument; only the second involves the behavior of the learned contract\.
Property 4 \(locality of restoration\)\.Restore\(G~,c,⋅\)\\mathrm\{Restore\}\(\\tilde\{G\},c,\\cdot\)modifies the fields ofccand the contexts ofDesc\(c\)\\mathrm\{Desc\}\(c\)only\. HenceΔc\(e\)=0\\Delta\_\{c\}\(e\)=0for everye∉\{c\}∪Desc\(c\)e\\notin\\\{c\\\}\\cup\\mathrm\{Desc\}\(c\), andRcf\(c\)R\_\{\\mathrm\{cf\}\}\(c\)is a sum over\{c\}∪Desc\(c\)\\\{c\\\}\\cup\\mathrm\{Desc\}\(c\)only\.
*Support\.*Immediate from the definition ofRestore\\mathrm\{Restore\}\(Sec\.[A\.6\.2](https://arxiv.org/html/2611.23362#A1.SS6.SSS2)\) and from the encoder being causal: the context of an event depends only on that event and its ancestors\.□\\square
Property 4 already removes a large class of candidates from contention\. Ifccis unrelated to the corrupted branch, then no corrupted event lies in\{c\}∪Desc\(c\)\\\{c\\\}\\cup\\mathrm\{Desc\}\(c\), soRcf\(c\)R\_\{\\mathrm\{cf\}\}\(c\)collects only its own termΔc\(c\)=V\(c\)\\Delta\_\{c\}\(c\)=V\(c\)and benign\-level changes on its descendants, all at the scale of benign variability; such a candidate cannot outrank one that explains real violation mass except through the validity penalty\. The remaining competition is therefore between the true source and the symptoms on its own branch, and that is where the hop weights and the source’s own term act\.
Condition 1 \(restoration at the origin is at least as effective\)\.Letv∈Desc\(cgt\)v\\in\\mathrm\{Desc\}\(c^\{\\mathrm\{gt\}\}\)be a symptom such that every path fromcgtc^\{\\mathrm\{gt\}\}to an event ofDesc\(v\)\\mathrm\{Desc\}\(v\)passes throughvv\. We use the condition
Δcgt\(e\)≥Δv\(e\)for alle∈Desc\(v\)\.\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(e\)\\;\\geq\\;\\Delta\_\{v\}\(e\)\\qquad\\text\{for all \}e\\in\\mathrm\{Desc\}\(v\)\.\(49\)
This is the single behavioral condition of this appendix, and it has a direct reading: on the part of the branch that lies strictly belowvv, replacing the corrupted transition at its origin removes at least as much violation as replacing it atvv, because restoringvvleaves the corrupted context that feeds the path fromcgtc^\{\\mathrm\{gt\}\}tovvin place\. The condition is not imposed atvvitself, whereΔv\(v\)=V\(v\)\\Delta\_\{v\}\(v\)=V\(v\)holds by construction and restoring the origin need not clearvvcompletely\. It is also checkable rather than hypothetical: on labeled trajectories in which bothcgtc^\{\\mathrm\{gt\}\}andvvare among the restored candidates, both sides are quantities computed during attribution\.
Property 5 \(responsibility margin\)\.WriteS=Desc\(v\)S=\\mathrm\{Desc\}\(v\)for the shared sub\-branch,X=\(\{cgt\}∪Desc\(cgt\)\)∖\(\{v\}∪S\)X=\(\\\{c^\{\\mathrm\{gt\}\}\\\}\\cup\\mathrm\{Desc\}\(c^\{\\mathrm\{gt\}\}\)\)\\setminus\(\\\{v\\\}\\cup S\)for the exclusive segment \(which containscgtc^\{\\mathrm\{gt\}\}itself with weightψ0=1\\psi^\{0\}=1and own termΔcgt\(cgt\)=V\(cgt\)\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(c^\{\\mathrm\{gt\}\}\)=V\(c^\{\\mathrm\{gt\}\}\)\), andζ=ψd\(cgt,v\)\\zeta=\\psi^\{\\,d\(c^\{\\mathrm\{gt\}\},v\)\}\. Under Condition 1 and Property 4,
Rcf\(cgt\)−Rcf\(v\)≥∑e∈Xψd\(cgt,e\)Δcgt\(e\)⏟explained only by the origin−\[V\(v\)−ζΔcgt\(v\)\]⏟symptom’s own term−\(1−ζ\)∑e∈Sψd\(v,e\)Δcgt\(e\)⏟shared sub\-branch\.R\_\{\\mathrm\{cf\}\}\(c^\{\\mathrm\{gt\}\}\)\-R\_\{\\mathrm\{cf\}\}\(v\)\\;\\geq\\;\\underbrace\{\\sum\_\{e\\in X\}\\psi^\{\\,d\(c^\{\\mathrm\{gt\}\},e\)\}\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(e\)\}\_\{\\text\{explained only by the origin\}\}\\;\-\\;\\underbrace\{\\bigl\[V\(v\)\-\\zeta\\,\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(v\)\\bigr\]\}\_\{\\text\{symptom's own term\}\}\\;\-\\;\(1\-\\zeta\)\\underbrace\{\\sum\_\{e\\in S\}\\psi^\{\\,d\(v,e\)\}\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(e\)\}\_\{\\text\{shared sub\-branch\}\}\.\(50\)ConsequentlyR\(cgt\)\>R\(v\)R\(c^\{\\mathrm\{gt\}\}\)\>R\(v\)whenever the right\-hand side exceeds the penalty differenceλpen\(𝒫\(cgt\)−𝒫\(v\)\)/ω\\lambda\_\{\\mathrm\{pen\}\}\\bigl\(\\mathcal\{P\}\(c^\{\\mathrm\{gt\}\}\)\-\\mathcal\{P\}\(v\)\\bigr\)/\\omega\.
*Support\.*SplitRcf\(cgt\)R\_\{\\mathrm\{cf\}\}\(c^\{\\mathrm\{gt\}\}\)overXX,\{v\}\\\{v\\\}, andSS\. The term atvvisζΔcgt\(v\)\\zeta\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(v\), andRcf\(v\)R\_\{\\mathrm\{cf\}\}\(v\)contributesΔv\(v\)=V\(v\)\\Delta\_\{v\}\(v\)=V\(v\)at weightψ0=1\\psi^\{0\}=1\. Fore∈Se\\in Severy path fromcgtc^\{\\mathrm\{gt\}\}passes throughvv, sod\(cgt,e\)=d\(cgt,v\)\+d\(v,e\)d\(c^\{\\mathrm\{gt\}\},e\)=d\(c^\{\\mathrm\{gt\}\},v\)\+d\(v,e\)andψd\(cgt,e\)=ζψd\(v,e\)\\psi^\{\\,d\(c^\{\\mathrm\{gt\}\},e\)\}=\\zeta\\,\\psi^\{\\,d\(v,e\)\}; Condition 1 then givesζΔcgt\(e\)−Δv\(e\)≥−\(1−ζ\)Δcgt\(e\)\\zeta\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(e\)\-\\Delta\_\{v\}\(e\)\\geq\-\(1\-\\zeta\)\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(e\)onSS\. SubtractingRcf\(v\)R\_\{\\mathrm\{cf\}\}\(v\)and collecting the three parts gives Eq\. \([50](https://arxiv.org/html/2611.23362#A4.E50)\)\.□\\square
Property 5 is the analytical counterpart of the design decisions in Sec\.[A\.6\.3](https://arxiv.org/html/2611.23362#A1.SS6.SSS3), and it makes explicit both what the rule gains over magnitude ranking and where it can still fail\. Summing over the candidate itself as well as its descendants is what putsV\(cgt\)V\(c^\{\\mathrm\{gt\}\}\)into the exclusive segment at full weight\. The symptom’s own violation does enter the margin: sinceVcgtres\(v\)≥0V^\{\\mathrm\{res\}\}\_\{c^\{\\mathrm\{gt\}\}\}\(v\)\\geq 0we haveΔcgt\(v\)≤V\(v\)\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(v\)\\leq V\(v\), so the middle term is at least\(1−ζ\)V\(v\)\(1\-\\zeta\)V\(v\)\. What changes relative to magnitude ranking is its weight\. Magnitude ranking selectscgtc^\{\\mathrm\{gt\}\}only ifV\(cgt\)\>V\(v\)V\(c^\{\\mathrm\{gt\}\}\)\>V\(v\); when restoring the origin clears the symptom \(Δcgt\(v\)≈V\(v\)\\Delta\_\{c^\{\\mathrm\{gt\}\}\}\(v\)\\approx V\(v\)\), responsibility chargesV\(v\)V\(v\)only at weight1−ζ1\-\\zeta\(0\.50\.5for a one\-hop symptom at the defaultψ=0\.5\\psi\{=\}0\.5\) and credits the origin with the rest of the exclusive segment\. The rule therefore tolerates a bounded amount of amplification, and this covers part of the regime of Sec\.[D\.3](https://arxiv.org/html/2611.23362#A4.SS3)in which magnitude ranking already fails\. It does not tolerate arbitrary amplification: ifV\(v\)V\(v\)or the mass on the shared sub\-branch is large relative to the exclusive segment, or if restoring the origin leaves much ofvv’s violation in place, the right\-hand side can be negative and the symptom can outrank the source\. This is one source of the non\-zero mean hop distances in Table[2](https://arxiv.org/html/2611.23362#S6.T2)\. The Hit@1 and mean\-hop results in Table[2](https://arxiv.org/html/2611.23362#S6.T2)and the comparison withTrace\-Mas\(w/o CVA\) in Fig\. 2 are the empirical test of this mechanism\.
### D\.5Stability of Repair Selection and Size of the Rollout Error
Repairs are ranked by the rollout estimate of Sec\. 5\.4 rather than by executing every candidate, so two questions arise: how selection behaves under rollout error, and how large that error is for the rollout we actually use\. Write𝒥^\(u\)\\hat\{\\mathcal\{J\}\}\(u\)for the rollout estimate of the repair objective and𝒥\(u\)\\mathcal\{J\}\(u\)for its realized value after committinguuand re\-executingDesc\(c⋆\)\\mathrm\{Desc\}\(c^\{\\star\}\), both defined in Appendix[A\.7\.2](https://arxiv.org/html/2611.23362#A1.SS7.SSS2), andu⋆=argminu∈𝒰\(c⋆\)𝒥^\(u\)u^\{\\star\}=\\arg\\min\_\{u\\in\\mathcal\{U\}\(c^\{\\star\}\)\}\\hat\{\\mathcal\{J\}\}\(u\),uopt=argminu∈𝒰\(c⋆\)𝒥\(u\)u^\{\\mathrm\{opt\}\}=\\arg\\min\_\{u\\in\\mathcal\{U\}\(c^\{\\star\}\)\}\\mathcal\{J\}\(u\)\.
Property 6 \(selection is stable up to twice the offset\-free error\)\.Suppose there is a constantb¯\\bar\{b\}, which may depend on the trajectory but not onuu, such that
supu∈𝒰\(c⋆\)\|𝒥^\(u\)−𝒥\(u\)−b¯\|≤ϵ′\.\\sup\_\{u\\in\\mathcal\{U\}\(c^\{\\star\}\)\}\\bigl\|\\hat\{\\mathcal\{J\}\}\(u\)\-\\mathcal\{J\}\(u\)\-\\bar\{b\}\\bigr\|\\;\\leq\\;\\epsilon^\{\\prime\}\.\(51\)Then𝒥\(u⋆\)≤𝒥\(uopt\)\+2ϵ′\\mathcal\{J\}\(u^\{\\star\}\)\\leq\\mathcal\{J\}\(u^\{\\mathrm\{opt\}\}\)\+2\\epsilon^\{\\prime\}\.
*Support\.*Selection is unchanged ifb¯\\bar\{b\}is subtracted from every𝒥^\(u\)\\hat\{\\mathcal\{J\}\}\(u\), so𝒥\(u⋆\)≤𝒥^\(u⋆\)−b¯\+ϵ′≤𝒥^\(uopt\)−b¯\+ϵ′≤𝒥\(uopt\)\+2ϵ′\\mathcal\{J\}\(u^\{\\star\}\)\\leq\\hat\{\\mathcal\{J\}\}\(u^\{\\star\}\)\-\\bar\{b\}\+\\epsilon^\{\\prime\}\\leq\\hat\{\\mathcal\{J\}\}\(u^\{\\mathrm\{opt\}\}\)\-\\bar\{b\}\+\\epsilon^\{\\prime\}\\leq\\mathcal\{J\}\(u^\{\\mathrm\{opt\}\}\)\+2\\epsilon^\{\\prime\}\.□\\square
Corollary 1 \(exact selection under a rollout margin\)\.Under Eq\. \([51](https://arxiv.org/html/2611.23362#A4.E51)\), if𝒥^\(u\)−𝒥^\(u⋆\)\>2ϵ′\\hat\{\\mathcal\{J\}\}\(u\)\-\\hat\{\\mathcal\{J\}\}\(u^\{\\star\}\)\>2\\epsilon^\{\\prime\}for everyu≠u⋆u\\neq u^\{\\star\}, thenu⋆=uoptu^\{\\star\}=u^\{\\mathrm\{opt\}\}\.
*Support\.*Foru≠u⋆u\\neq u^\{\\star\},𝒥\(u\)≥𝒥^\(u\)−b¯−ϵ′\>𝒥^\(u⋆\)−b¯\+ϵ′≥𝒥\(u⋆\)\\mathcal\{J\}\(u\)\\geq\\hat\{\\mathcal\{J\}\}\(u\)\-\\bar\{b\}\-\\epsilon^\{\\prime\}\>\\hat\{\\mathcal\{J\}\}\(u^\{\\star\}\)\-\\bar\{b\}\+\\epsilon^\{\\prime\}\\geq\\mathcal\{J\}\(u^\{\\star\}\)\.□\\square
Property 6 needs no assumption about which operator is correct, and the offsetb¯\\bar\{b\}makes it insensitive to any error shared by all operators on a trajectory;b¯=0\\bar\{b\}=0recovers the uniform form\. Corollary 1 turns the premise into a certificate that can be checked per trajectory onceϵ′\\epsilon^\{\\prime\}is known\. What remains is to show thatϵ′\\epsilon^\{\\prime\}is small for the rollout of Appendix[A\.7\.2](https://arxiv.org/html/2611.23362#A1.SS7.SSS2), which the next property does by tracing the error to the two places where rollout and re\-execution differ\.
For eachuu, let𝒜\(u\)\\mathcal\{A\}\(u\)be the \(event, channel\) pairs that the rollout sets to the contract mean \(the edited channel ofc⋆c^\{\\star\}and all channels of the regenerated window events\), andℬ\(u\)\\mathcal\{B\}\(u\)the remaining pairs in the window, i\.e\. the two unedited channels ofc⋆c^\{\\star\}and all channels of the carry\-over events\. For a pair\(i,ch\)\(i,\\mathrm\{ch\}\), letV^i,ch\\hat\{V\}\_\{i,\\mathrm\{ch\}\}andVi,chreV^\{\\mathrm\{re\}\}\_\{i,\\mathrm\{ch\}\}be its weighted channel term \(VhV\_\{h\},βVm\\beta V\_\{m\}, orγVs\\gamma V\_\{s\}\) in the rollout and in the re\-execution, and define
ν\(u\)=∑\(i,ch\)∈ℬ\(u\)\|V^i,ch−Vi,chre\|,θ\(u\)=\|ℒ^task\(u\)−ℒtask\(u\)\|∈\[0,1\]\.\\nu\(u\)=\\sum\_\{\(i,\\mathrm\{ch\}\)\\in\\mathcal\{B\}\(u\)\}\\bigl\|\\hat\{V\}\_\{i,\\mathrm\{ch\}\}\-V^\{\\mathrm\{re\}\}\_\{i,\\mathrm\{ch\}\}\\bigr\|,\\qquad\\theta\(u\)=\\bigl\|\\hat\{\\mathcal\{L\}\}\_\{\\mathrm\{task\}\}\(u\)\-\\mathcal\{L\}\_\{\\mathrm\{task\}\}\(u\)\\bigr\|\\in\[0,1\]\.\(52\)
Property 7 \(rollout error ofTrace\-Mas\)\.Suppose re\-execution underuuproduces the sameKKwindow events as the rollout \(matched event by event\), which holds for any operator that does not add or remove events among the firstKKdescendants ofc⋆c^\{\\star\}\. \(a\) For every suchuu,
\|𝒥^\(u\)−𝒥\(u\)\|≤∑\(i,ch\)∈𝒜\(u\)Vi,chre\+ν\(u\)\+λ1θ\(u\)\.\\bigl\|\\hat\{\\mathcal\{J\}\}\(u\)\-\\mathcal\{J\}\(u\)\\bigr\|\\;\\leq\\;\\sum\_\{\(i,\\mathrm\{ch\}\)\\in\\mathcal\{A\}\(u\)\}V^\{\\mathrm\{re\}\}\_\{i,\\mathrm\{ch\}\}\\;\+\\;\\nu\(u\)\\;\+\\;\\lambda\_\{1\}\\,\\theta\(u\)\.\(53\)\(b\) Suppose that each re\-executed regenerated window event is a benign event of its context, and that the re\-executed edited channel ofc⋆c^\{\\star\}is distributed as that channel of a benign event of its context, in both cases exchangeable with the benign calibration events of Eq\. \([27](https://arxiv.org/html/2611.23362#A1.E27)\)\. Letτ\\taube the threshold on the scale ofVV\(Sec\.[D\.1](https://arxiv.org/html/2611.23362#A4.SS1)\) withα≥1\\alpha\\geq 1\. Then, with probability at least1−\|𝒰\(c⋆\)\|\(K\+1\)\(1−δ\+1n\+1\)1\-\|\\mathcal\{U\}\(c^\{\\star\}\)\|\\,\(K\{\+\}1\)\\bigl\(1\-\\delta\+\\tfrac\{1\}\{n\+1\}\\bigr\),
supu∈𝒰\(c⋆\)\|𝒥^\(u\)−𝒥\(u\)\|≤\(K\+1\)τ\+maxuν\(u\)\+λ1maxuθ\(u\),\\sup\_\{u\\in\\mathcal\{U\}\(c^\{\\star\}\)\}\\bigl\|\\hat\{\\mathcal\{J\}\}\(u\)\-\\mathcal\{J\}\(u\)\\bigr\|\\;\\leq\\;\(K\{\+\}1\)\\,\\tau\\;\+\\;\\max\_\{u\}\\nu\(u\)\\;\+\\;\\lambda\_\{1\}\\max\_\{u\}\\theta\(u\),\(54\)so Eq\. \([51](https://arxiv.org/html/2611.23362#A4.E51)\) holds withb¯=0\\bar\{b\}=0andϵ′\\epsilon^\{\\prime\}equal to the right\-hand side\.
*Support\.*\(a\) The costκ\(u\)\\kappa\(u\)is the same deterministic quantity in both, so it cancels\. The rollout scores every pair in𝒜\(u\)\\mathcal\{A\}\(u\)as zero \(Eq\. \([35](https://arxiv.org/html/2611.23362#A1.E35)\)\), whereas re\-execution scores it asVi,chre≥0V^\{\\mathrm\{re\}\}\_\{i,\\mathrm\{ch\}\}\\geq 0; pairs inℬ\(u\)\\mathcal\{B\}\(u\)contribute at mostν\(u\)\\nu\(u\); and the task terms differ byλ1θ\(u\)\\lambda\_\{1\}\\theta\(u\)\. The triangle inequality gives Eq\. \([53](https://arxiv.org/html/2611.23362#A4.E53)\)\. \(b\) For eachuu, the first term of Eq\. \([53](https://arxiv.org/html/2611.23362#A4.E53)\) is a sum of at mostK\+1K\{\+\}1quantities: the full score of each of the at mostKKregenerated window events, and the edited channel term ofc⋆c^\{\\star\}, which is at most the full score of a benign event with that channel\. By Property 2 andα≥1\\alpha\\geq 1, each exceedsτ\\tauwith probability at most1−δ\+1/\(n\+1\)1\-\\delta\+1/\(n\+1\); a union bound over the at most\|𝒰\(c⋆\)\|\(K\+1\)\|\\mathcal\{U\}\(c^\{\\star\}\)\|\(K\{\+\}1\)quantities bounds the first term by\(K\+1\)τ\(K\{\+\}1\)\\taufor everyuusimultaneously\.□\\square
Property 7 ties the error to the design choices of Appendix[A\.7\.2](https://arxiv.org/html/2611.23362#A1.SS7.SSS2)and to the operating point of Sec\.[A\.9](https://arxiv.org/html/2611.23362#A1.SS9)\. First, the only term that grows with the depth is\(K\+1\)τ\(K\{\+\}1\)\\tau, and the failure probability grows withKKas well, so deeper rollouts can only loosen the guarantee; at the deployedK=1K\{=\}1the first term is2τ2\\tau, and withδ=0\.99\\delta\{=\}0\.99andα=1\\alpha\{=\}1the bound holds with probability at least1−2\|𝒰\(c⋆\)\|\(0\.01\+1/\(n\+1\)\)1\-2\|\\mathcal\{U\}\(c^\{\\star\}\)\|\\,\(0\.01\+1/\(n\+1\)\), e\.g\.1−6\(0\.01\+1/\(n\+1\)\)1\-6\\,\(0\.01\+1/\(n\+1\)\)with one candidate per operator type\. Deeper rollouts thus buy no tighter guarantee, which is consistent with TCR being unchanged fromK=1K\{=\}1toK=6K\{=\}6in Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)\(c\)\. Second, the first term is on the benign scale:τ\\tauis the level below which a benign event stays with probability at leastδ−1/\(n\+1\)\\delta\-1/\(n\+1\), whereas an operator that leaves a corrupted field in place keeps that field’s carry\-over violation in𝒥^\\hat\{\\mathcal\{J\}\}, whose expected size is, by the channel\-wise form of Property 3, the benign mean of that channel plus∥b∥Σ~−12\\lVert b\\rVert^\{2\}\_\{\\tilde\{\\Sigma\}^\{\-1\}\}, withbbthe shift the field induces relative to the repaired context\. By Corollary 1, rollout selection is therefore exact whenever the rollout objective of every other operator, which contains the carry\-over violation that operator leaves in place, exceeds that ofu⋆u^\{\\star\}by more than2ϵ′2\\epsilon^\{\\prime\}\. Third,θ\(u\)\\theta\(u\)is zero whenever re\-execution invokes the template steps the rollout predicts, andν\(u\)\\nu\(u\)is zero whenever the carry\-over events reproduce their logged transitions under the same contexts as in the rollout; neither is controlled analytically, which is why Appendix[C\.3](https://arxiv.org/html/2611.23362#A3.SS3)measures both on the paired pool𝒫\\mathcal\{P\}\. There, the matched\-window precondition holds on every trajectory and rollout selection coincides with exhaustive re\-execution, so whatever value gapν\\nuandθ\\thetaleave is smaller than the separation between operators, which is what Corollary 1 needs; the experiment bounds the gap through its effect on the ordering rather than measuring it directly\. The assumption in \(b\) is the one the rollout itself makes, namely that an event whose inputs are repaired behaves benignly; it can fail for an operator that does not remove the corruption, in which case𝒥\(u\)\\mathcal\{J\}\(u\)exceeds the bound for thatuu\. The cost termλ2κ\(u\)\\lambda\_\{2\}\\kappa\(u\)biases selection in a definite direction: between operators with similar violation and task terms, the rule prefers the smaller intervention, which is consistent with the low operator cost reported in Table[9](https://arxiv.org/html/2611.23362#A2.T9)\.
### D\.6Cost Accounting
The pipeline of Sec\.[A\.8](https://arxiv.org/html/2611.23362#A1.SS8)has a cost that follows from the definitions above rather than from measurement\. Detection evaluates the contract once per event, atO\(\|𝒱\|dz2\)O\(\|\\mathcal\{V\}\|\\,d\_\{z\}^\{2\}\)time after context encoding\. Attribution restores the topCCcandidates and rescores their descendants, atO\(C⋅maxc\|Desc\(c\)\|⋅dz2\)O\\bigl\(C\\cdot\\max\_\{c\}\|\\mathrm\{Desc\}\(c\)\|\\cdot d\_\{z\}^\{2\}\\bigr\); without gating onΩ\\Omegaand onCC, scoring every ancestor of every violated event would scale with\|𝒱\|⋅maxc\|Desc\(c\)\|\|\\mathcal\{V\}\|\\cdot\\max\_\{c\}\|\\mathrm\{Desc\}\(c\)\|, which is the comparison theCCsweep in Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)makes concrete\. Repair selection addsO\(\|𝒰\(c⋆\)\|⋅\(K\+1\)⋅dz2\)O\\bigl\(\|\\mathcal\{U\}\(c^\{\\star\}\)\|\\cdot\(K\{\+\}1\)\\cdot d\_\{z\}^\{2\}\\bigr\)for the candidate operators atc⋆c^\{\\star\}\(the edited event andKKwindow events per operator, Appendix[A\.7\.2](https://arxiv.org/html/2611.23362#A1.SS7.SSS2)\)\. The re\-executions of every candidate in Appendix[C\.3](https://arxiv.org/html/2611.23362#A3.SS3)are an offline validation and are not part of this cost\.
Two structural points follow\. Counterfactual scoring and rollout are executed in contract space, so the number of LLM calls added byTrace\-Masis the number of*committed*repairs, not the number of candidates considered; and becauseCC,KK, and\|𝒰\(c⋆\)\|\|\\mathcal\{U\}\(c^\{\\star\}\)\|are small constants, the added non\-LLM work is linear in trajectory length\. This is why the wall\-clock profile in Fig\.[6](https://arxiv.org/html/2611.23362#S6.F6)is reported excluding bulk generation: the design moves the search off the generation path by construction\.
### D\.7Scope
The statements above support the components of Sec\. 5 and are deliberately narrow\. Properties 1–3 characterize what the detection score measures and what its benign calibration guarantees; they do not claim that every corruption produces a large margin, and Property 3 makes the dependence on the induced shift explicit instead of assuming separability\. Sec\.[D\.3](https://arxiv.org/html/2611.23362#A4.SS3)derives why magnitude ranking is not localization but does not predict the amount of amplification for a given workflow\. Properties 4–5 compare the true source against symptoms on its own branch under one checkable condition, and they apply only whencgtc^\{\\mathrm\{gt\}\}enters the candidate set, i\.e\. lies inΩ\\Omegaor withinHHhops above it and survives the top\-CCpre\-ranking; they do not establish identifiability against an adversary that corrupts several events, nor optimality over the whole candidate set when Condition 1 fails, and Eq\. \([50](https://arxiv.org/html/2611.23362#A4.E50)\) can be negative under strong amplification at a symptom\. Property 6 and Corollary 1 bound the suboptimality of repair selection given rollout error, and Property 7 bounds that error for our rollout only under a matched window and the benign\-regeneration assumption of Property 7\(b\), with the carry\-over and template terms left to measurement \(Appendix[C\.3](https://arxiv.org/html/2611.23362#A3.SS3)\); none of them covers sequences of several committed edits or the completeness of the operator space𝒰\(c⋆\)\\mathcal\{U\}\(c^\{\\star\}\)\. The quantitative behavior of all these mechanisms is established empirically in Sec\. 6 and Appendix[C](https://arxiv.org/html/2611.23362#A3)\.相似文章
基于蒙特卡洛树搜索的多智能体系统自主修复
本文提出MARS,一种基于蒙特卡洛树搜索的多智能体系统自主修复框架,以及StateMAS,一个包含1,310条故障轨迹的基准。实验表明,MARS在修复准确率上 consistently 优于现有方法,且 token 成本相当。
Traceable Multi-Agent System for Knowledge-Based Forecasting
This paper introduces TraceMAS, an interactive demo system for traceable multi-agent forecasting that organizes agent outputs around causal-loop diagrams to make the evidence-to-forecast process inspectable, demonstrated on crude oil price forecasting.
超越共识:混合智能体中的轨迹级综合
本文揭示,聚合多个LLM智能体的完整推理轨迹(而非仅其最终答案)即使在所有智能体一致同意的情况下也能纠正错误,引入了“聚合悖论”以及Self-Consistent Mixture of Agents方法。
TMAS:通过多智能体协同扩展测试时计算
TMAS 引入了一种多智能体框架,通过结构化协作与分层记忆系统扩展测试时计算,从而增强大语言模型的推理能力。该方法采用专用智能体、跨轨迹信息流以及混合奖励强化学习,有效提升了模型在复杂推理基准上的迭代扩展性能与稳定性。
TraceDance:一个从真实世界代理部署轨迹构建代理行为基准的自动化系统
TraceDance是一个自动化系统,它从真实世界的代理部署轨迹中构建针对性基准,以评估大语言模型(LLMs)中的不良行为,实现了高构建率并揭示了当前前沿模型的显著弱点。