Manuscript Offprint

arXiv:2610.06163

Where Did the Repair First Go Wrong? Localizing the Origins of Silent Failures in Agentic Vulnerability Repair

Wenji Bai, Muhammad Waseem, Zeeshan Rasheed, Jaakko Peltonen, Pekka Abrahamsson

WENJI BAI, Tampere University, Finland

MUHAMMAD WASEEM, Tampere University, Finland

ZEESHAN RASHEED, Tampere University, Finland

JAAKKO PELTONEN, Tampere University, Finland

PEKKA ABRAHAMSSON, Tampere University, Finland

Localizing where an LLM-based agent first fails to uphold security during a repair can show which stage of its workflow needs an additional safeguard. This is difficult for silent failures, which are patches that pass syntactic and functional checks but still contain a security vulnerability. Because such patches give no observable failure signal, existing failure attribution methods, which rely on observed task failures and labelled failure steps, are less suited to them. We propose Security Awareness Gap Evaluation (SAGE), a trace-based method that combines an assessment of the security reasoning recorded at each turn with the reconstructed code history to identify the earliest turn at which a repair diverges from the task's security intent. We evaluate SAGE on 95 confirmed silent failures drawn from 3,684 repair traces produced by six agent frameworks and six base models on SecurityEval and CVEfixes. SAGE assigned an origin in 93 cases. Most origins were an unaddressed security requirement or an inadequate defence choice, and only five coincided with the code change itself. When the agent introduced the vulnerable code, the origin preceded the write in 14 of 19 cases. Repeated scoring and a second judge reproduced the origin type more consistently than the exact turn, and agreement was lowest for traces that kept only the final file.

Additional Key Words and Phrases: Silent failures, LLM-based agents, Vulnerability repair, Failure localization

1 Introduction

Large language model (LLM)-based agents increasingly approach software repair as an iterative process of planning, tool use, code editing, and validation [8, 49]. Yet, passing the available tests does not necessarily establish that the relevant security requirements have been met [50]. Recent work has identified silent failures (SFs): patches that pass the available syntactic and functional checks while retaining or introducing a security vulnerability [6]. Confirming a silent failure shows that the delivered repair remains insecure, but not where the repair process first went wrong. The same insecure patch may stem from a plan that omits the relevant security requirement, a defence that does not close the weakness, or an implementation that applies an appropriate defence incorrectly. Such a flaw may then pass through later review stages unnoticed. Each origin may call for a different remedy, ranging from prompt refinement to an additional verification checkpoint.

We therefore ask where in the execution trace a divergence from the task’s security intent first becomes observable. We define this position as the origin of the silent failure: the earliest turn at which the recorded reasoning or artefact history shows such a divergence, as opposed to the write that eventually places the vulnerable code in the file. Figure 1 illustrates two ways in which the origin of a silent failure can differ from a code change. In case (a), the planner agent selects AES in ECB mode at turn 1, two turns before the vulnerable code is written. A diff identifies the introducing write, but only the trace reveals the earlier inadequate defence choice. In case (b), the vulnerable code is inherited from the input file and remains untouched, so there is no introducing write to locate. The trace instead records an initial plan that omits the relevant security requirement.

Authors' Contact Information: Wenji Bai, wenji.bai@tuni.fi, Tampere University, Tampere, Finland; Muhammad Waseem, muhammad.waseem@tuni.fi, Tampere University, Tampere, Finland; Zeeshan Rasheed, zeeshan.rasheed@tuni.fi, Tampere University, Tampere, Finland; Jaakko Peltonen, jaakko.peltonen@tuni.fi, Tampere University, Tampere, Finland; Pekka Abrahamsson, pekka.abrahamsson@tuni.fi, Tampere University, Tampere, Finland.

Wenji Bai, Muhammad Waseem, Zeeshan Rasheed, Jaakko Peltonen, and Pekka Abrahamsson

Figure

(a) Agent-introduced vulnerability

(b) Inherited vulnerability

Fig. 1. Examples of the two cases in silent failure origin localization.

and a subsequent review that does not revisit the omitted requirement. Final-patch analysis alone is therefore insufficient; origin localization calls for examining the recorded repair reasoning alongside the artefact history, and for separating the origin from both the introducing write and later missed detection opportunities.

Existing research provides useful starting points for analysing agent failures, but does not address the origin of a silent failure in vulnerability repair. Failure taxonomies and attribution methods have mainly been developed and evaluated on executions with an observable task failure [10, 46, 48], whereas a silent failure passes the available checks and its deficiency is established only through separate confirmation. The prior study of silent failures attributes deficiencies to agent roles and workflow stages, but does not provide a systematic rule for localizing the earliest origin turn [6].

To address this gap, we propose Security Awareness Gap Evaluation (SAGE), a trace-based method for localizing the origin of a silent failure. SAGE first normalizes framework-specific traces into a common sequence of turns. It then uses an LLM judge, given only the trace prefix available at each turn, to score the security reasoning expressed along four dimensions; every non-zero score must cite a verbatim quotation linked to the raw record (see Section 3.3.1). In parallel, it reconstructs the artefact history to determine when the vulnerable code was introduced or left in place. Finally, an explicit decision rule combines the scores and artefact history with the confirmed failure anchor to identify the earliest trace-attributable divergence from the task's security intent (see Section 3.3.2). We evaluate the resulting origin assignments through repeated scoring, cross-judge comparison, task-disjoint subsets, and human annotation of artefact-derived outputs. Three research questions (RQs) guide the study:

RQ1. Where do silent failures originate, and what trace evidence supports the assigned origins?

RQ2. How consistently does trace- and artefact-based evidence identify the same origin across repeated runs, task-disjoint data subsets, and independent judges?

RQ3. How does localization reliability vary across silent failure categories, agent frameworks, and base models, and under what conditions does the identified origin become less consistent?

We evaluate SAGE on 95 confirmed silent failures identified among 3,684 valid repair traces generated by six open-source agent frameworks and six base models on tasks from SecurityEval [33] and CVEfixes [7]. SAGE localizes an origin in 97.89% of cases (93/95). Most identified origins involve unaddressed security requirements or inadequate defence choices. Among the 19 cases in which

Where Did the Repair First Go Wrong? Localizing the Origins of Silent Failures in Agentic Vulnerability Repair

3

the agent introduced vulnerable code, the origin precedes the introducing write in 14. Repeated scoring and an independent judge model reproduce the same origin type in most cases. Agreement with human annotators on code provenance and the introducing write is moderate to substantial ( κ\kappa between 0.58 and 0.74) and varies across task subsets. Exact-turn agreement is lowest for the small group of traces that preserve only the final file.

To summarize, our main contributions are:

• A trace-based localization method SAGE. We formulate silent failure localization as identifying the earliest trace-attributable divergence from the task’s security intent in an execution that passes functional validation. We propose SAGE, which combines quotation-anchored assessment of expressed security reasoning with reconstructed artefact histories.

• A multi-source reliability evaluation. We evaluate SAGE through repeated scoring, cross-judge comparison, task-disjoint subsets, and human annotation.

• A characterization of localization boundary conditions. We examine how reliability varies across silent failure categories, agent frameworks, base models, and artefact availability, and identify conditions associated with less consistent localization.

References (12)