Manuscript Offprint

arXiv:2611.01966

Launder-Bench: Can Repository-Level Agentic Code Laundering Be Detected?

Yuntong Hu, Hongji Pu, Zimo Li, Ruomeng Li, Xiaotong Liu, Ziyuan Qin, Qiyue Li, Liang Zhao

ABSTRACT

Coding agents can now rewrite repository-scale codebases while preserving tested behavior, creating a new challenge for plagiarism detection, license auditing, and software provenance. We ask whether such rewrites can still be traced to their source. Existing clone benchmarks emphasize fragments and bounded edits, while repository-transformation benchmarks evaluate functional correctness rather than provenance. Moreover, ranking the most similar source does not establish derivation when independent implementations can be similarly close. We define repository-level agentic code laundering and introduce Launder-Bench, to our knowledge the first repository-level benchmark for provenance under agentic rewriting, constructed from 282 real-world repositories. A source-hidden reconstruction protocol decomposes source behavior, reconstructs modules and repository structure, and retains rewrites only after execution-based verification. We evaluate the same provenance problem in two complementary settings: Launder-Bench-Pair contains 1,128 pairwise instances asking whether two repositories share provenance, while Launder-Bench-Attr contains 229 source-attribution instances asking which candidate is the source, with abstention when evidence is insufficient. Measured same-domain independent repositories establish how much similarity can arise without shared provenance and provide detector-specific reference bands. Existing methods remain far from saturating Launder-Bench: the strongest static method reaches only 0.66 AUROC on pairwise detection, while repository encoders rank the true source first on up to 22% of attribution queries but earn calibrated attribution credit on only 1–2%. These results reveal a systematic gap between relative code similarity and source-specific provenance evidence, providing a reproducible target for provenance detection under agentic rewriting. https://github.com/HuieL/Launder-Bench

1 INTRODUCTION

Coding agents can now rewrite repository-scale code while preserving tested behavior. Agentic rewriting can rename identifiers, restructure module boundaries, reimplement algorithms, and translate implementations across programming languages. Yet the resulting repository remains derived: these transformations can obscure source-specific provenance evidence without removing the underlying provenance relation.

This creates a new threat we call repository-level agentic code laundering: producing a derived implementation that retains the tested capabilities of a codebase while reducing the similarity evidence used to distinguish derivation from independent work. Figure 1a illustrates the setting. It matters for plagiarism detection (Aiken, 1994; Prechelt et al., 2002), license-compliance auditing (Inoue & Roy, 2021), and software forensics, where similarity provides evidence of reuse.

Existing clone benchmarks primarily test fragments and bounded edits (Svajlenko et al., 2014; Roy & Cordy, 2018), and adversarial perturbations test model robustness within existing programs (Yefet et al., 2020). Repository transformation benchmarks evaluate whether an agent can produce a func-

Figure

(a) Repository-scale agentic rewriting

Figure

(b) Pairwise provenance detection (AUROC)

Figure 1: (a) Repository-level agentic code laundering: a coding agent transforms a source repository into a rewrite that preserves tested behavior while obscuring source-specific provenance evidence. (b) Existing methods on our pairwise provenance detection task (AUROC). Light bars denote dedicated clone detectors with supported-input coverage; these records are provisional and have incomplete coverage. StoneDetector, TACC, and Oreo support only Java→Java. Dark bars denote pretrained code encoders evaluated on the full benchmark. The dashed line indicates chance-level discrimination (AUROC = 0.5). The provenance relation remains even when detection is difficult.

tionally valid implementation (Wang et al., 2026; Li et al., 2026), but do not establish whether the resulting repository can still be traced to its source. Existing semantic-clone detectors degrade substantially under semantics-preserving transformations (Xu et al., 2026), suggesting an even greater challenge under repository-scale agentic reconstruction.

Nearest-source ranking alone does not answer that question either. Independently developed repositories in the same domain can share interfaces, vocabulary, and implementation patterns. A detector may rank the true source first without distinguishing it from such independent code. Provenance evaluation therefore needs behavior-verified rewrites, controlled non-source comparisons, and an evidence requirement that permits abstention.

We introduce Launder-Bench, a repository-level provenance benchmark with execution-verified rewrites across same-language and cross-language axes. Launder-Bench-Pair tests shared provenance between repositories; Launder-Bench-Attr tests source recovery among candidates with an evidence requirement. These are complementary views of the same provenance records. Measured same-domain independent repositories provide a source- and detector-specific reference for similarity without known derivation. This design separates relative retrieval from evidence that exceeds the independent-code reference.

Our contributions are as follows:

  • Problem formulation (Section 2.1). We formulate repository-level agentic code laundering as a provenance problem: derivation persists even when rewriting obscures the evidence available to a detector.

  • Benchmark (Section 2.2). We construct complementary Pair and Attribution tasks from behavior-verified agentic rewrites, with measured same-domain references and fixed candidate sets.

  • Empirical findings (Section 3). The strongest full-coverage static detector reaches AUROC 0.661 and best F1 0.394. Encoders retain up to 22% Rank@1 but only 1–2% calibrated attribution, exposing a gap between relative similarity and source-specific evidence.

References (49)