paper-with-me

홈 › Papers

MACGen: Toward Functionally Correct and Secure Code Generation via Multi-Agent Collaboration

2026-08-26 · Miseon Yu, Jaehoon Choi, Younghan Lee, Yunheung Paek arxiv

Despite their strong ability to generate code, large language models often fail to produce secure code, as their outputs frequently contain security vulnerabilities. Secure code generation is inherently challenging because it requires solving a multi-objective problem: functional correctness and security. Existing approaches address this challenge by injecting external security knowledge or by using agentic feedback and iterative refinement. However, guideline retrieval often leaves the generator to translate generic advice into task-specific secure implementations, while shared-dialogue multi-agent feedback can blur role boundaries and suffer from context bloat. We present MACGen, a multi-agent framework that integrates planning, security analysis, code synthesis and refinement to jointly optimize security and functionality. A planner constructs a step-by-step plan to satisfy functional requirements. A security advisor identifies likely CWEs and synthesizes task-specific guidelines, a coder then generates code grounded in these artifacts, and a reviewer issues perspective-separated feedback. Rather than sharing full dialogue histories, each agent receives only structured artifacts from upstream stages, enforcing role specialization and reducing uncontrolled context growth. On CWEval and BaxBench, MACGen improves F&S@1 over direct prompting by 19.61 and 10.57 percentage points (pp) on average, respectively.

📄 PDF Abstract BibTeX arXiv:2608.25457

Code (2)

Aaron617/agent-arXiv-daily ★ 9
Mishuni/macgen-secure-code

Tasks

Code Generation

Similar Papers 제목 키워드 기반

SALLM: Security Assessment of Generated Code

2023-11-01 · Mohammed Latif Siddiq, Joanna C. S. Santos, Sajith Devareddy, Anna Muller

With the growing popularity of Large Language Models (LLMs) in software engineers' daily practices, it is important to ensure that the code generated by these tools is not only functionally correct but also free of vulne…

Code Generation

Security-by-Design for LLM-Based Code Generation: Leveraging Internal Representations for Concept-Driven Steering Mechanisms

2026-03-11 · Maximilian Wendlinger, Daniel Kowatsch, Konstantin Böttinger, Philip Sperl arxiv

Large Language Models (LLMs) show remarkable capabilities in understanding natural language and generating complex code. However, as practitioners adopt CodeLLMs for increasingly critical development tasks, research reve…

Code Generation

DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents

2025-11-24 · Rupam Patir, Keyan Guo, Suvadra Barua, Abhijeet Pathak 외 arxiv

Large language models (LLMs) and LLM-based coding agents are now used to generate code from natural-language specifications, yet ensuring such code is both functionally correct and secure remains a challenge. We present …

Code Generation

Benchmarking Correctness and Security in Multi-Turn Code Generation

2025-10-13 · Ruchit Rawal, Jeffrey Yang Fan Chiang, Chihao Shen, Jeffery Siyuan Tian 외 arxiv

AI coding assistants powered by large language models (LLMs) have transformed software development, significantly boosting productivity. While existing benchmarks evaluate the correctness and security of LLM-generated co…

Code Generation

CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generation

2025-01-14 · Jinjun Peng, Leyi Cui, Kele Huang, Junfeng Yang 외

Large Language Models (LLMs) have significantly aided developers by generating or assisting in code writing, enhancing productivity across various tasks. While identifying incorrect code is often straightforward, detecti…

Code Generation