Natural Code Transformation Confuses Agents in Vulnerability Analysis
Jie Zhu, Ronik Bhaskar, Heather Zheng, Ben Y. Zhao, Kexin Pei
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., Claude Mythos 5.2 with Claude Code, 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.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI, cs.LG
Related papers
Now You See It, Now You Don't: Manipulating Perception and Attention in Code Vulnerability Detection LLM Agents
Shared title terminologycs.CRShanquan Yang, Boyu Kuang, Chunyi Zhou et al.
From Vendor-Neutral Request to Paid Backend: Procurement Integrity at the Commitment Boundary of AI Coding Agents
Shared title terminologycs.CRJinqian Zhang, Haojun Xia, Shujiang Wu et al.
ProtoArena: Can AI Agents Discover and Exploit Real-World Cross-Component Protocol Vulnerabilities?
Shared title terminologycs.CRFasheng Miao, Zhaoyu Hu, Xiang Li et al.
When the Approved File Is Unchanged: Authority-Set Integrity for Deployment and Coding-Agent Approvals
Shared title terminologycs.CRMd Imran Hossen
SEEK: Agentic Knowledge Graph Retrieval for Secure Code Generation
Shared title terminologycs.CRVarun Gadey, Markus Tohn, Lichao Wu et al.
Names Are Not Objects: Object-Bound Confinement for Compromised AI Coding Agents
Shared title terminologycs.CRDaniel Commey