cs.MAOct 12, 2026

Origin Attribution for Unsafe Behavior in Self-Evolving Multi-Agent Coding Systems

Authors: Hanyi Yu, Jiaming Cui

Organizations: University of Southern California, Los Angeles, CA · Virginia Tech, Blacksburg, VA

Abstract

As language-model-based coding agents evolve their programs and reuse code from one another, safety failures can acquire a history that extends beyond the agent in which they are detected. An unsafe change may originate in one agent, propagate through intermediate recipients, and survive subsequent revisions before an audit reveals it. Understanding this history is important for identifying the introducing change and distinguishing inherited behavior from independently occurring failures. We study origin attribution in self-evolving multi-agent coding systems: recovering the agent and program version that introduced an observed unsafe behavior into the target's code lineage, or determining that it arose locally. This task is challenging because rewriting obscures textual similarity, independent occurrences confound temporal ordering, and intermediate recipients can resemble the source. We propose a method that combines behavioral fingerprint matching with historical localization and recursive tracing. It compares candidate implementations beyond the unsafe outcome, retains evidence from multiple historical versions, and follows matching candidates upstream. On 158 queries across 85 controlled scenarios, the method achieves 96.8% exact attribution accuracy, compared with 77.2% for exhaustive fingerprint matching without recursion. Component ablations and evaluation on 34 additional queries using the same method and hyperparameters demonstrate the complementary roles of multiple representatives and recursive tracing. Further checks extend the evaluation to approval-boundary and resource-owner errors. Together, these results show how behavioral and historical evidence can recover the origins of unsafe behavior through code revision and cross-agent propagation.

Figures & tables

Appendix figures & tables10 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. CodeTracer: Towards Traceable Agent States

    Apr 13, 2026Han Li, Yifan Yao, Letian Zhu +13AI Coding AgentsAgent Trajectory Analysis

  2. Coherence Collapse: Diagnosing Why Code Agents Fail After Reaching the Right Code

    Mar 25, 2026Myeongsoo Kim, Dingmin Wang, Siwei Cui +6Agent Failure AnalysisAI Coding Agents