Secure Agentic Coding through Counterexample-Grounded Feedback
Tue Le, Anh Nguyen Hoang, Gabriel Sasseville, Doseok Jang, Pierre-Luc Bacon, Nghi D. Q. Bui
Abstract
As coding models and agent harnesses become more capable, reliable security verification is becoming a central bottleneck. Improving secure code generation requires a signal whose reported progress remains aligned with actual program behavior under optimization; otherwise, an optimizer can improve the signal's verdict without removing the underlying vulnerability. Existing model-based approaches require models to either infer program behavior from source code or specify correct outcomes for adversarial tests, placing substantial reasoning demands on the security signal. We introduce , a counterexample-grounded verification framework that separates attack exploration from behavioral verification and connects them through execution traces of the program under test. In test-time repair, yields substantially stronger held-out functional-security gains than alternative security signals across secure code generation benchmarks, while preserving or improving functionality. As an RL reward, also outperforms static-analysis and learned rewards on held-out functional-security, even when all policies successfully optimize their respective training rewards. Combining with either proxy reward further improves held-out performance, suggesting that execution-grounded feedback can mitigate reward overoptimization while preserving useful guidance from existing security signals.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI
Related papers
How Effectively Do Security Skills Guide Coding Agents in Vulnerability Detection in Linux Kernel?
Shared title terminologycs.CRHaoran Xue, Nikta Akbarpour, Gias Uddin et al.
CAT-RAG: Improving Secure Code Generation with Category-Aware Agentic Retrieval
Shared title terminologycs.CRMahdieh Abazar, Lorenzo De Carli, Benjamin Tan
ParseGap: Testing What Coding Agents Authorize and What Shells Execute
Shared title terminologycs.CRJieyu Li
Who Is Prompt-Injecting Coding Agents? An Empirical Study of Hidden AI-Directed Text on GitHub
Shared title terminologycs.CRGabi Nakibly, Zvika Babo
Who Grades the Agent? Privilege Separation for Coding-Agent Benchmarks
Shared title terminologycs.CRNathan Nour Houlamy, Mattia Favretto, Earlence Fernandes et al.
Mjolnir: Finding and Reproducing Vulnerabilities in Root-of-Trust Firmware and RTL with Project-Grounded Agents
Shared title terminologycs.CRCollin MacDonald, Carl Lundin, Stephen Herwig et al.