mlsanityData to 7 Oct 2026

SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflows

arXiv 2506.07313 ↗First posted 8 Jun 2025cs.CRcited by 4

On the map: LLM agents and tool use → Agent threats, guardrails and governance

Abstract (arXiv)

Large language models (LLMs) have seen widespread success in code generation tasks for different scenarios, both everyday and professional. However current LLMs, despite producing functional code, do not prioritize security and may generate code with exploitable vulnerabilities. In this work, we propose techniques for generating code that is more likely to be secure and introduce SCGAgent, a proactive secure coding agent that implements our techniques. We use security coding guidelines that articulate safe programming practices, combined with LLM-generated unit tests to preserve functional correctness. In our evaluation, we find that SCGAgent is able to preserve nearly 98% of the functionality of the base Sonnet-3.7 LLM while achieving an approximately 25% improvement in security. Moreover, SCGAgent is able to match or best the performance of sophisticated reasoning LLMs using a non-reasoning model and an agentic workflow.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 34 of its 50 references that are in the map. First posted on arXiv 8 Jun 2025.

Builds on

34 of 50 references.

Closest ancestors · 1

Same direction, newest first

  1. 2024AutoSafeCoder: A Multi-Agent Framework for Securing LLM Code Generation through Static Analysis and Fuzz Testing16 Sep

Other references · 33

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2020Scaling Laws for Neural Language Modelscited by 6,411
  4. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
  5. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
  6. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  7. 2022Training Compute-Optimal Large Language Modelscited by 2,927
  8. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  9. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,628
  10. 2025s1: Simple test-time scalingcited by 1,311
  11. 2023StarCoder: may the source be with you!cited by 790
  12. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
21 more
  1. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  2. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  3. 2022The Stack: 3 TB of permissively licensed source codecited by 354
  4. 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 251
  5. 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
  6. 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 130
  7. 2025CodeElo: Benchmarking Competition-level Code Generation of LLMs with Human-comparable Elo Ratingscited by 109
  8. 2023ChatUniTest: A Framework for LLM-Based Test Generationcited by 94
  9. 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 94
  10. 2023No More Manual Tests? Evaluating and Improving ChatGPT for Unit Test Generationcited by 82
  11. 2024Instruction Tuning for Secure Code Generationcited by 63
  12. 2025Trading Inference-Time Compute for Adversarial Robustnesscited by 60
  13. 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 55
  14. 2024RLCoder: Reinforcement Learning for Repository-Level Code Completioncited by 44
  15. 2024Constrained Decoding for Secure Code Generationcited by 35
  16. 2024Prompting Techniques for Secure Code Generation: A Systematic Investigationcited by 33
  17. 2023The FormAI Dataset: Generative AI in Software Security Through the Lens of Formal Verificationcited by 32
  18. 2023Assessing the Security of GitHub Copilot Generated Code -- A Targeted Replication Studycited by 24
  19. 2024LLM Security Guard for Codecited by 15
  20. 2024R2C2-Coder: Enhancing and Benchmarking Real-world Repository-level Code Completion Abilities of Code Large Language Modelscited by 9
  21. 2024Enhancing Security of AI-Based Code Synthesis with GitHub Copilot via Cheap and Efficient Prompt-Engineeringcited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 1; 2026: 3.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Fortifying LLM-Based Code Generation with Graph-Based Reasoning on Secure Coding Practices
  2. 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents
  3. 2025TypePilot: Leveraging the Scala Type System for Secure LLM-generated Code
  4. 2026MACGen: Toward Functionally Correct and Secure Code Generation via Multi-Agent Collaboration
  5. 2026Inference-Time Safety For Code LLMs Via Retrieval-Augmented Revision
  6. 2026STELP: Secure Transpilation and Execution of LLM-Generated Programs
  7. 2026Execution-State-Aware LLM Reasoning for Automated Proof-of-Vulnerability Generation
  8. 2026P3: Joint Program-and-Proof Planning for Verified Code Generation