Secure Agentic Coding through Counterexample-Grounded Feedback
On the map: LLM agents and tool use → Agent threats, guardrails and governance
Abstract (arXiv)
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 falcon, 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, falcon 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, falcon also outperforms static-analysis and learned rewards on held-out functional-security, even when all policies successfully optimize their respective training rewards. Combining falcon 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.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 53 of its 63 references that are in the map. Submitted 19 Oct 2026.
Builds on
53 of 63 references.
Closest ancestors · 4
Same direction, newest first
- 2025Is Vibe Coding Safe? Benchmarking Vulnerability of Agent-Generated Code in Real-World Tasks2 Dec
- 2025BlueCodeAgent: A Blue Teaming Agent Enabled by Automated Red Teaming for CodeGen AI20 Oct
- 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflows8 Jun
- 2024AutoSafeCoder: A Multi-Agent Framework for Securing LLM Code Generation through Static Analysis and Fuzz Testing16 Sep
Other references · 49
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 10,542
- 2025Qwen3 Technical Reportcited by 9,994
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,789
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,871
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,799
- 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 2,255
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 2,069
- 2016Concrete Problems in AI Safetycited by 1,771
- 2024Qwen2.5-Coder Technical Reportcited by 1,301
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,241
- 2022Scaling Laws for Reward Model Overoptimizationcited by 1,188
- 2023Teaching Large Language Models to Self-Debugcited by 1,049
37 more
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 603
- 2018Scalable agent alignment via reward modeling: a research directioncited by 469
- 2024Training Software Engineering Agents and Verifiers with SWE-Gymcited by 414
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 377
- 2025SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks?cited by 363
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 287
- 2023Reward Model Ensembles Help Mitigate Overoptimizationcited by 252
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 162
- 2023RLTF: Reinforcement Learning from Unit Test Feedbackcited by 124
- 2026Qwen3-Coder-Next Technical Reportcited by 83
- 2025SWE-EVO: Benchmarking Coding Agents in Long-Horizon Software Evolution Scenarioscited by 80
- 2024Instruction Tuning for Secure Code Generationcited by 75
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 71
- 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoningcited by 64
- 2018The Art, Science, and Engineering of Fuzzing: A Surveycited by 63
- 2023Goodhart's Law in Reinforcement Learningcited by 51
- 2024Can We Trust Large Language Models Generated Code? A Framework for In-Context Learning, Security Patterns, and Code Evaluations Across Diverse LLMscited by 22
- 2024PromSec: Prompt Optimization for Secure Generation of Functional Source Code with Large Language Models (LLMs)cited by 22
- 2025PurpCode: Reasoning for Safer Code Generationcited by 20
- 2024HexaCoder: Secure Code Generation via Oracle-Guided Synthetic Training Datacited by 19
- 2023Enhancing Large Language Models for Secure Code Generation: A Dataset-driven Study on Vulnerability Mitigationcited by 17
- 2024Artificial-Intelligence Generated Code Considered Harmful: A Road Map for Secure and High-Quality Code Generationcited by 14
- 2025Training Language Models to Generate Quality Code with Program Analysis Feedbackcited by 14
- 2024An Exploratory Study on Fine-Tuning Large Language Models for Secure Code Generationcited by 11
- 2025Static Analysis as a Feedback Loop: Enhancing LLM-Generated Code Beyond Correctnesscited by 10
- 2024Helping LLMs Improve Code Generation Using Feedback from Testing and Static Analysiscited by 9
- 2026Secure Code Generation via Online Reinforcement Learning with Vulnerability Reward Modelcited by 9
- 2026How Secure is Secure Code Generation? Adversarial Prompts Put LLM Defenses to the Testcited by 7
- 2026Execution-Grounded Credit Assignment for GRPO in Code Generationcited by 7
- 2025CodeWiki: Evaluating AI's Ability to Generate Holistic Documentation for Large-Scale Codebasescited by 6
- 2026Learning to Generate Secure Code via Token-Level Rewardscited by 4
- 2026Documentation-Guided Agentic Codebase Migration from C to Rustcited by 4
- 2026Enhancing Reliability in LLM-Based Secure Code Generationcited by 4
- 2026SecureCodeRL: Security-Aware Reinforcement Learning for Code Generation with Partial-Credit Rewardscited by 3
- 2026SecCodeBench-V2 Technical Reportcited by 3
- 2026SecCodePRM: A Process Reward Model for Code Securitycited by 2
- 2026Beyond Repository Boundaries: Cross-Repository Graph Retrieval for Code Generationcited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026SoK: AI Secure Code Generation: Progress, Pitfalls, and Paths Forward
- 2026TaPR: Test-Aware Policy Refinement for Feedback-Conditioned Code Generation
- 2026PRECEPT: Security Self-Improvement of Coding Agents via Evolving Principles
- 2025The Double Life of Code World Models: Provably Unmasking Malicious Behavior Through Execution Traces
- 2026The Verification Horizon: No Silver Bullet for Coding Agent Rewards
- 2026MalSkillBench: A Runtime-Verified Benchmark of Malicious Agent Skills
- 2026SpecGuard: Proving a Task Is Broken Before the Agent Cheats
- 2026hacktrace: behavior-supervised detection of reward hacking during code generation