Securing Agent-Generated Code with Its Own Development History
Prateek Kumar Rajput, Shahzeb Khan, El-Hacen Diallo, Yewei Song, Jacques Klein, Tegawendé F. Bissyandé
Abstract
Pull requests written by coding agents can pass a project's test suite while omitting a guard or a validation step. To find the missing condition, a reviewer currently relies on static analysis of the final code. An agent-generated change, however, is accompanied by a development history that a human commit does not provide. The agent's trajectory records each edit together with the agent's stated assumptions, and structural differencing shows how each changed function evolved. We present TRACER, a workflow that uses this development history as evidence for security review. TRACER tracks changes at the symbol level, treats the agent's recorded rationale as claims to be verified against the current code, accepts a repair only after assessment and functional validation, and attaches to each accepted repair an executable check that later changes must satisfy. On the SusVibes benchmark, symbol-level tracking places the vulnerable symbol in the review scope for 94.6% of agent patches, compared with 13.4% for the primary scanner warning. With two investigator models, the configuration that includes the agent's rationale yields the largest number of verified security repairs while preserving functionality, and adding AST history to it does not increase that number. A funnel analysis identifies where the remaining candidates are lost. In a study of structural-biology software, the combination of repair memory and a boundary check allows a subsequent feature request to succeed in nine of ten tasks without reintroducing the repaired vulnerability, whereas functional feedback alone succeeds in four and reintroduces the vulnerability in three.
Create a lesson
Metadata
- Categories
- cs.SE, cs.CR
- Comments
- 12 pages, 10 main, 2 references
Related papers
How developers split roles among them and a coding agent and what "collaboration" means
Shared title terminologycs.SELinus Ververs, Helya Dadkhah, Lutz Prechelt
Static Analysis Guidance for Secure LLM Code Generation
Shared title terminologycs.SEDaniele Lunghi, Alberick Euraste Djiré, Zacharie Chenail-Larcher et al.
EmbedGym: Letting Coding Agents Develop and Debug Embedded Firmware Without Physical Hardware
Shared title terminologycs.SEMinghui Zhao, Yiming Li, Sophie Zhu et al.
YUL: Bringing Software Supply Chain Security to Coding Agents
Shared title terminologycs.SEAman Sharma, Frank Reyes, Martin Monperrus
Security Impact of Coding Agent's Memory Files
Shared title terminologycs.SEThiago Santos de Moura, Selma Güler, Yannic Noller
MulFCoder: Framework-conditioned Multi-agent for MLLM-based Multi-framework Front-end Code Generation
Shared title terminologycs.SEJie Wu, Haoran Ma, Shisong Tang et al.