acceptodds
Under review as a conference paper at ICLR 2027

Natural Code Transformation Confuses Agents in Vulnerability Analysis

Abstract

Having demonstrated a strong potential for automating vulnerability discovery, AI agents can also be used to attack software systems at scale. Today's software systems need mechanisms to level the playing field by slowing down potential attacks, giving them time to patch vulnerabilities and strengthen software. Along this line, our study of agent trajectories in vulnerability analysis shows a surprising finding: agents produce dramatically different results across real-world code commits that carry the same functionality and the same vulnerability. This phenomenon appears consistently in multiple code domains and vulnerability categories. It motivates us to study natural and functionality-preserving code transformations derived from real-world software development, and their potential as a defense against attacker agents. We build a corpus of natural transformations by mining recurring development patterns from real-world code commits, and apply them to evaluate impact on agentic vulnerability analysis. Our results show that even a single form of transformation can effectively "confuse" frontier agents, e.g., Codex with GPT-6 Sol, reducing successes in vulnerability discovery. We also study different agent failures, whether transformations can be composed to provide stronger protection, and adaptive attackers who seek to reverse them. Overall, our study of natural code transformation significantly expands the research space of using code transformations to defend against malicious agents.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
code-transformation, vulnerability-detection, software-security, software-testing

Reviews

Among:
Shape:
1234this paper, Top 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.33 over 3 reviews, above 51% of the others.
Reviewer_UyVcOpenReview ↗
Rating
2
Confidence
3
Informativeness
1
Presentation
3
Soundness
2
Read review
Paper summary

This paper studies the natural transformation's impact on AI agents' capability on vulnerability analysis. The authors observe that agents can produce different results across code versions containing the same vulnerability. Motivated by this observation, they mined common transformation patterns from real-wolrd commits. They select 21 common transformations for evaluation and apply these transformations on agentic vulnerability analysis. The results show that transformation generally reduce agents' success rates.

Critical strengths
  • The studies question is practical as it conerns about whether vulnerability analysis agents remain reliable
  • The evaluated dataset is based on real-world repositories and executable PoC validation. It also include multiple models and harnesses.
Critical weaknesses
  • The novelty is limited. The findings are consistent with prior studies on robustness and semantics-perserving code transformations. This paper does not establish the novel or unique benefits of mining natural transformations from real commits.
  • The checking of semantic preservation is based on existing tests and ground-truth PoC replay, while this paper does not manual validation.
  • The paper does not report the confidence intervalas and paired significance tests on the original vs. transformed code.
Questions for authors
  1. What is the unique benefit of mining transformations from real commits over manually specified refactorings or directly prompint an LLM to restructure code?
  2. Have the authors manually inspect a sample of the transformed repositories to assess semantic preservation beyong existing tests and PoC replay?
6 comments
AuthorsOpenReview ↗

Thank you for the constructive comments!

Thank you so much for taking the time and effort to read our paper and leave constructive comments. We have uploaded the revised PDF, with additions marked in blue and deletions in red. Some deletions in the main text are not shown due to the limited space.

AuthorsOpenReview ↗

Q1, W1: What is the unique benefit of mining transformations from real commits over manually specified refactorings or directly prompint an LLM to restructure code?

Prior work has studied manually designed syntactic perturbations and code obfuscation techniques [1, 2]. These transformations rely on predefined rules that leave recognizable patterns that are easier to identify and reverse, as existing reasoning LLMs have demonstrated [3, 4]. Our evaluation shows that these simple transformations are not robust when the adaptive attacker agents are allowed to proactively transform the code, and quickly become ineffective when the attacker agents are explicitly told the code is transformed so they can identify and reverse the transformations (Section 4.2).

In contrast, we take a data-driven approach by mining natural transformations from real-world software commits. By extracting transformation patterns from real code commits, we can capture a much more diverse set of subtle coding patterns that expand significantly beyond manually designed rules. Natural transformations are far more stealthy because they resemble routine software development patterns, and leave fewer predictable cues for LLMs to identify and reverse. Our experiments in Section 4.2 show that natural transformations remain effective even when an adaptive agent attempts to reverse the changes before vulnerability analysis. Therefore, we consider natural transformation as complementary to existing approaches using fixed transformations.

Our proposed natural transformation differs from existing works that directly prompt an LLM to restructure a codebase. Such transformations give the user zero control and cannot ensure that changes reflect common software development practices. In contrast, we use cluster-based mining to identify recurring transformations in real code, and distill them into reusable skills that guide LLM code transformations. This provides a systematic basis to evaluate how different transformations affect agentic vulnerability discovery.

That said, we are also intrigued by the finding that natural transformation, which is supposed to be much less out-of-distribution for existing models extensively pre-trained on real-world commits [5] and should thus be more amenable (and less disruptive) for agents to analyze, still effectively confuses the state-of-the-art agents, including Claude Mythos 5.2 + Claude Code (see our results below). Therefore, with this surprising effectiveness, we hope to share the potential of leveraging them to build more robust defense (exactly because of the stealthy nature of natural transformations) against attacker agents, and complement existing adversarial evaluations of agentic vulnerability analysis.

References

[1] Xiao Li, Yue Li, Hao Wu, Yue Zhang, Yechao Zhang, Fengyuan Xu, and Sheng Zhong. A systematic study of code obfuscation against llm-based vulnerability detection. arXiv preprint arXiv:2512.16538, 2025.

[2] Shiqi Wang, Zheng Li, Haifeng Qian, Chenghao Yang, Zijian Wang, Mingyue Shang, Varun Kumar, Samson Tan, Baishakhi Ray, Parminder Bhatia, et al. Recode: Robustness evaluation of code generation models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13818–13843, 2023.

[3] David Beste, Grégoire Menguy, Hossein Hajipour, Mario Fritz, Antonio Emanuele Cinà, Sébastien Bardin, Thorsten Holz, Thorsten Eisenhofer, and Lea Schönherr. Exploring the potential of llms for code deobfuscation. In International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment, pages 267–286. Springer, 2025.

[4] Shan Jiang, Pranoy Kovuri, David Tao, and Zhixun Tan. Cascade: Llm-powered javascript deobfuscator at google. In Proceedings of the IEEE/ACM 48th International Conference on Software Engineering: Software Engineering in Practice, pages 292–302, 2026.

[5] Niklas Muennighoff, Qian Liu, Armel Zebaze, Qinkai Zheng, Binyuan Hui, Terry Yue Zhuo, Swayam Singh, Xiangru Tang, Leandro Von Werra, and Shayne Longpre. Octopack: Instruction tuning code large language models. In International Conference on Learning Representations, volume 2024, pages 7604–7623, 2024.

AuthorsOpenReview ↗

Q2, W2: Have the authors manually inspected a sample of the transformed repositories to assess semantic preservation beyond existing tests and PoC replay?

Thanks for this question, which prompted us to look into the transformations more closely. We agree manual inspection would strengthen our validation of semantic preservation.

To answer this question, we selected three repositories (skcms, sndfile, and c-blosc2) that we are familiar with for manual inspection. We organized the transformations by file and manually reviewed each modified region against its original implementation, including the surrounding code and relevant call sites. For each change, we inspected the affected control flow and data dependencies, checking whether branch conditions, return values, side effects, or error-handling behavior could alter the program’s functionality. We found no semantic differences in these inspections.

To further validate our inspection, we applied fuzzing-based checks for all evaluated programs. Specifically, we fuzzed each original program for 48 hours to collect input-output pairs, then replayed the same inputs on the transformed version and compared the outputs to detect potential semantic differences. The fuzzing scripts and all collected input-output pairs have been uploaded to our anonymous GitHub repository to support reproducibility.

We have added these validation procedures to the revised paper (Section 4.1).

Reviewer_29G9OpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
3
Read review
Paper summary

This paper investigates whether natural, functionality-preserving code transformations can reduce the effectiveness of AI vulnerability-analysis agents. The authors mine common transformation patterns from different real software commits, apply them to vulnerable code while preserving functionality and the underlying vulnerability, and evaluate the transformed code on a selected subset of 186 CyberGym tasks using six model-framework combinations. The main contribution is the finding that natural code transformations substantially reduce vulnerability-discovery success rates, often more than traditional obfuscation techniques. The authors validate this result through experiments on 21 transformation types and additional analyses of transformation composition, budget scaling, repeated runs, reasoning effort, adaptive rewriting, reverse-direction transformations, and failure modes. Overall, the paper shows that current vulnerability-analysis agents are highly sensitive to semantically equivalent changes in code organization and representation, revealing an important robustness limitation.

Critical strengths
  1. The authors' main findings are grounded in realistic code changes. The paper demonstrates that ordinary software-development transformations can substantially reduce agentic vulnerability-discovery success while preserving the tested functionality and target vulnerability. By mining transformations from real-world commits rather than relying solely on synthetic obfuscation, the study evaluates robustness in a realistic and practically relevant setting. Across multiple transformation families and six model-framework combinations, the results reveal an important limitation in current agentic vulnerability-analysis systems. This finding is both novel and practically relevant, and it highlights a robustness issue that may be overlooked by evaluations that consider only a single code representation.

  2. Broad empirical evaluations support the central finding. The paper presents a broad empirical evaluation spanning 21 transformation types, six model-framework combinations, and a selected subset of 186 vulnerability-analysis tasks. In addition to the main experiments, the authors perform sensitivity analyses covering budget, repeated trials, reasoning effort, adaptive rewriting, reverse-direction transformations, and transformation composition. The observed degradation persists across these settings, increasing confidence that the effect is not merely an artifact of randomness, insufficient resources, or a particular evaluation configuration. This breadth of evaluation provides strong evidence for the paper's core empirical claim.

Critical weaknesses
  1. Robustness of differences across systems is limited: The consistent evaluation demonstrates performance degradation across multiple model-framework combinations but provides limited understanding why some systems are robust to natural code transformations. Some evaluated models are proprietary, limiting access to architectural and training parameters, a more notable limitation is that each model is evaluated using only a single framework. Consequently, model and framework effects are intertwined, making it difficult to determine whether the observational differences arise from the underlying model, the agent framework, or their interaction. The paper convincingly establishes this pattern but offers less understanding of the factors that drive susceptibility to these transformations.



2. Generalization is limited because of dependence on a GPT-selected evaluation subset: The sampling procedure was thoughtful, and Appendix A demonstrates that the selected 186-task subset preserves important characteristics of the original benchmark. However, the evaluation subset is additionally restricted to tasks successfully solved by GPT-5.6 Sol with Codex before transformation. While this choice is well motivated for studying robustness on initially solvable tasks, the results may depend on the task-selection procedure, that may limit the generality of the conclusions. A subset that is solvable by GPT-5.6 Sol is not necessarily representative of the task distribution faced by the other evaluated agents. Analyzing robustness on tasks initially solved by each individual agent or providing a sensitivity analysis using an alternative task-selection strategy would strengthen the paper. The paper clearly demonstrates degradation on the selected subset, but it is not clear how broadly the observed effects extend beyond that evaluation setting.

Questions for authors
  1. How sensitive are the results to the GPT-5.6 Sol + Codex solvability filter? Have you evaluated an alternative task-selection strategy?
  2. Do you have evidence that the observed robustness differences are driven by the underlying models rather than the agent frameworks?
  3. Beyond passing tests and replaying the original PoC, what additional validation was performed to ensure that transformations did not alter vulnerability of exploitability characteristics?
5 comments
AuthorsOpenReview ↗

We appreciate your time and efforts.

We really appreciate your valuable comments and we have revised our paper. We have uploaded the revised PDF, with additions marked in blue and deletions in red. Some deletions in the main text are not shown due to the limited space.

AuthorsOpenReview ↗

Q1, W2: How sensitive are the results to the GPT-5.6 Sol + Codex solvability filter? Have you evaluated an alternative task-selection strategy?

Thanks for pointing this out. During the rebuttal period, we ran an additional experiment to test the impact our filter has on our results. We do not observe a noticeable effect. Specifically, we evaluated on eight additional randomly selected CyberGym tasks. In these tasks, natural transformations still decrease attack success rates across all three tested model harness combinations, with an attack success rate decrease of 45.2% for GPT-5.6 Sol, 52.7% for DeepSeek V4.1 Flash, and 68.9% for Claude Opus 5. We have added these results to Appendix F.

We applied the GPT-5.6 Sol + Codex filter in our original paper because we were evaluating level 0 in CyberGym, which has a relatively low baseline success rate. Before applying our solvability filter, we made sure we were sampling from a representative sample of tasks (see Appendix A), but we know this does not guarantee unbiased sampling. We acknowledge that we selected for tasks with higher success rates because we cannot measure a decrease if the baseline is already zero. We accept this sampling bias because our main metric is not absolute success, but a relative change in success rate, which is not biased by our sampling rate.

AuthorsOpenReview ↗

Q2, W1: Do you have evidence that the observed robustness differences are driven by the underlying models rather than the agent frameworks?

Good point. In our original submission, each model is paired with a single harness, so their effects are confounded. We thus ran an additional experiment to test how the choice of model or harness impacted the overall agent performance. Here, when we say agent, we mean a model and harness combination. To evaluate the models and harnesses separately, we fixed the choice of model or harness and varied the other.

  • Same model, different harness. We evaluated GPT-6 Sol with Codex, Claude Code, and DeepSeek Harness. The relative impact of natural transformations remains effective, with mean relative drops of 39.6%, 44.5%, and 42.5%.

  • Same harness, different models. We evaluated five models with Claude Code. The relative impact of natural transformations varies across models, with mean relative drops ranging from 30.1% (Claude Sonnet 5) to 55.3% (Claude Mythos 5.2).

This is consistent with expectations. For any given model, the choice of harness can greatly impact its ability to succeed in agentic tasks (e.g. some models are fine-tuned for certain harnesses). In the updated version of the text, we report the results in Section 4.1, with a more detailed analysis in Appendix B.

Reviewer_rdTgOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper explores whether natural code transformations can hinder AI agents' vulnerability discovery. The authors identify common code transformation patterns in real-world commits and turn them into reusable skills. They evaluate 21 transformation types on CyberGym while checking that the original vulnerabilities remain present, and report reduced PoC-generation success rates. They also examine composition, larger budgets, and an adaptive code-rewriting attacker.

Critical strengths
  1. The paper is clearly written and easy to follow, with a coherent narrative connecting observations across real-world commits to transformation mining and evaluation.

  2. The authors provide a code artifact, which supports transparency and could facilitate reproducing and extending the experiments.

  3. The study highlights the sensitivity of vulnerability-analysis agents to code representation. Evaluating success through executable PoCs, while checking that the original vulnerabilities remain present, provides useful evidence about agent robustness.

Critical weaknesses
  1. The distinction from existing transformation methods is not sufficiently established. Although the 21 transformations are derived from real-world commits, some overlap with or closely resemble prior techniques, such as field reordering, scope changes, and identifier renaming. A direct comparison with existing catalogs would help clarify what is newly covered. It would also be useful to isolate whether the gains come from mining real-world commits, the selected transformations, or their agent-based implementation.

  2. The baseline comparison leaves the practical advantage unclear. In Table 1, identifier renaming and loop-to-recursion both reduce attacker success more than the average natural transformation. Averaging over 21 transformations does not clearly represent how the defense would be deployed: a practitioner could select or combine transformations instead of running 21 transformations seperately and taking average. A systematic comparison of deployable combinations, extending Table 2 to include combinations of existing methods, would be more informative and pracitcal. The paper should also better justify its baseline selection and consider broader structural transformations. Comparisons with matched modification scope and implementation budgets would make the results more convincing.

  3. The adaptive evaluation covers a limited strategy space. L0-L2 vary the attacker's knowledge, while the evaluated countermeasure centers on rewriting code before analysis. The released evaluation scripts also instruct the attacker not to build or run the project, preventing execution-based feedback during PoC construction; their correspondence to the reported experiments should be clarified. Targeted normalization, program-analysis-assisted reasoning, and feedback-driven retries would provide stronger tests of the defense. The current results support robustness against the tested strategy, but not a broader claim of resistance to adaptive attackers.

  4. The evaluation population and statistical uncertainty need clearer reporting. Appendix A describes 186 selected tasks, whereas Table 5 reports 17–18 samples per transformation, without clearly explaining their relationship to the main success-rate denominators. The artifact provides the 186-task list and initial sampling code, but the mapping to the evaluated subsets remains unclear. Selecting tasks solvable by one model–harness combination also limits generalization and may affect comparisons across agents. Exact per-condition task and run counts, subsequent exclusion criteria, and confidence intervals would make the reported effects easier to assess.

Questions for authors
  1. The paper describes the transformation agent as bug-agnostic, but the released implementation uses crash traces and fix patches to determine relevant files and reject edits outside that scope. Could the authors clarify how much vulnerability-specific information guides transformation placement, and whether the approach remains effective without this information?

  2. The released evaluation scripts instruct agents not to build or run the project, whereas Appendix D includes a prompt allowing PoC submission and testing. Which protocol was used for the reported experiments? Can the attacker receive execution feedback and revise unsuccessful PoCs, particularly in the adaptive setting?

  3. Please clarify the rewriting budget in Figure 6: Section 4.2 states that the first, code-rewriting stage receives $8, whereas the caption states $6. What budgets were used for the rewriting and vulnerability-analysis stages, respectively?

9 comments
AuthorsOpenReview ↗

Thank you!

We appreciate your time and effort in reviewing our paper and giving us constructive comments. We have uploaded the revised PDF, with additions marked in blue and deletions in red. Some deletions in the main text are not shown due to the limited space.

AuthorsOpenReview ↗

Q1: Could the authors clarify how much vulnerability-specific information guides transformation placement, and whether the approach remains effective without this information?

We thank the reviewer for checking the artifact closely. The term "bug-agnostic" is used to refer to the information available to the transformation agent. We only give the agent the transformation description, a generic one-shot example in a skill, and access to a build tool used for compilation. We did not tell the agent this codebase was designed for use in vulnerability analysis. We did not give the agent any vulnerability descriptions, crash traces, or other information about the vulnerability.

We want the code transformations to be relevant to the vulnerability, but don’t want the agent to know about the vulnerability. So we check to make sure the agent modifies at least one file in the stack trace to trigger the vulnerability. If the agent does not modify any files in the stack trace, we try again, and prompt the agent to modify at least one file (from files in the stack trace), but give no context to justify this new constraint. In our new scope sensitivity analysis (see revised paper), we find that restricting transformations to functions on the crash stack (which essentially makes the transformation agent aware of the vulnerability) further reduces the attacker’s effectiveness, even though this may also give the attacker agent more precise information about the vulnerability’s location.

AuthorsOpenReview ↗

Q2, W3: Which protocol was used for the reported experiments?

Apologies for any confusing statements. Appendix E provides the original prompt used by CyberGym, and the prompts used for our evaluation was previously only shared in our artifact. We have now added the complete evaluation prompt into the revised paper draft (allowed per author response policy in ICLR).

We strictly follow the CyberGym setting. Specifically, we do not provide the attacker agent with compilation tools, and we prompt it to write PoC to a specified location. We only made minor edits to the original prompt to accommodate our directory structure and uv-based Python environment. To evaluate success, we extract the agent-generated program inputs from the container, and replay them against two prebuilt container images containing the vulnerable and fixed versions. The attacker agent receives no feedback from the validation process.

The adaptive attacker experiment follows the same attacker settings described above.

Comments on the paper

1 comment
AuthorsOpenReview ↗

Response Summary

Dear PCs, SACs, ACs, and Reviewers,

We thank you for overseeing the review process for our submission. We have uploaded the revised paper, with additions marked in blue and deletions in red. Some deletions in the main text are not shown due to the limited space. We also updated our artifact.

Below, we summarize how we address the reviewer questions through additional experiments and thorough clarification.

Summary of paper findings

We study how AI agents doing vulnerability analysis are susceptible to natural code transformations commonly applied in routine development activities. We find that natural transformations, despite being more in-distribution and prevalent in LLM training data, can still confuse frontier agents like Claude Mythos with Claude Code, reducing the success rate from a 48.3% to 21.6% in vulnerability discovery. As natural transformations are more stealthy and leaves fewer predictable cues, they are more robust against adaptive attacker agents, e.g., when they are allowed to identify potential transformations and rewrite the code, the success rate rise by only 3.5% on natural transformations but 25.8% on synthetic transformations.

Clarifications

  • Unique benefit over previous transformations (rdTg W1; UyVc W1, Q1). Previous rule-based transformations leave recognizable patterns that adaptive agents can identify and reverse. Natural transformations resemble routine development and can be more stealthy. Therefore, they leave fewer predictable cues and remain effective under adaptive rewriting.

  • Protocol used for reported experiments (rdTg W3, Q2). We strictly follow the CyberGym setting and provide no build tools or execution feedback to the attacker agent.

  • Evaluation population and statistical uncertainty (rdTg W4). We select 18 tasks that can be solved by GPT-5.6 Sol with Codex from the 186-task subset to ensure a measurable results.

  • Budgets used for rewriting and vulnerability analysis (rdTg Q3). We use \8forrewritingand8 for rewriting and \\2 per attack, following CyberGym. We fixed the Figure 6 caption.

  • How much vulnerability-specific information is exposed (rdTg Q1). The transformation agent never sees vulnerability descriptions or crash traces. We only check that it touches at least one crash-stack file.

  • Confidence intervals and paired significance tests (rdTg W4; UyVc W3). We added sign-flip permutation tests and bootstrapped 95% confidence intervals. We obtained p≤0.004p \le 0.004 for every transformation family.

New Experiments

  • Three more model-harness combinations (rdTg W1, W2; 29G9 W1, Q2). We added Claude Mythos 5.2 + Claude Code and GPT-6 Sol with DeepSeek Harness and Claude Code. Natural transformations consistently reduce success rate in all nine combinations.

  • Compare with existing transformations (rdTg W1, W2). We applied all six synthetic transformations to all evaluation samples and model–harness combinations.

  • Combinations of existing methods (rdTg W2). We extended the composition experiment to apply three synthetic transformations together. Composing synthetic transformations is less effective than composing natural ones.

  • Comparison with transformation implementation (rdTg W1, W2). We implemented the same transformations with the agent and with deterministic rules. Effectiveness does not strongly depend on agent-based or rule-based implementation.

  • Comparison with transformation scope (rdTg W2, Q1). We compared unrestricted transformations with transformations limited to functions on the original crash stack. Restricting transformations to the crash stack generally weakens their impact.

  • Extra validations of functionality preservation (29G9 Q3; UyVc W2, Q2). We manually inspected all transformations in three repositories and ran 48-hour fuzzing-based differential testing on all evaluated programs. We found no semantic differences.

  • Different sample selection strategies (rdTg W4; 29G9 W2, Q1). We evaluated eight additional randomly selected tasks. Natural transformations still reduce success across all three tested agents, with relative drops of 45.2%, 52.7%, and 68.9%.

We sincerely appreciate the significant effort you put into the review process.

Thank you,

Authors of Paper #22611

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.