MACGen is a multi-agent framework that integrates planning, security analysis, code synthesis and refinement to jointly optimize security and functionality and improves F&S@1 over direct prompting on CWEval and BaxBench.
Abstract
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.
Multi-agent systems built on large language models (LLMs) are increasingly deployed for complex tasks requiring autonomous planning, tool use, and inter-agent coordination. However, the non-deterministic nature of LLM outputs and the emergent behavior arising from agent interactions render traditional test oracles ineffective, creating a critical gap in quality assurance for agentic AI. This work introduces MORPHAGENT, a framework designed to address the oracle problem in multi-agent LLM systems through trace-based behavioral analysis. Our contributions are threefold: (1) goal-preservation relations that verify consistent goal achievement under input perturbations, (2) coordination-consistency relations that validate inter-agent delegation and communication patterns under agent substitution and reordering, and (3) tool-use integrity relations that ensure semantic equivalence of tool invocation sequences under prompt paraphrasing. MorphAgent instruments agent execution to capture structured traces comprising planning steps, tool calls, message exchanges, and final outputs, then systematically applies metamorphic transformations and checks behavioral invariants without requiring ground-truth oracles. We evaluate the framework on four multi-agent benchmarks spanning code generation, research synthesis, customer service, and data analysis tasks, encompassing 2,840 source-followup execution pairs across three LLM backends. Results show that MORPHAGENT detects 82.0% of seeded behavioral faults, including 90.3% of coordination failures and 81.7% of goal-deviation faults, while maintaining a false positive rate of 6.1%. The framework uncovers 14 previously unreported behavioral anomalies in established multi-agent frameworks, demonstrating its practical utility for assuring agentic AI reliability. These results suggest that trace-based metamorphic testing can serve as a practical foundation for reliable validation of emerging agentic AI systems.
Gopalakrishnan Marimuthu· International Conference on...· 0 citations
SCOPE is presented, a prover-initialized subgoal critic for code generation that adapts a Lean-oriented prover model to produce three parseable feedback fields for downstream code generation: subgoals, gap analysis, and a robustness checklist.
Yueke Zhang, Yifan Zhang, Zihan Fang et al.· 0 citations
Cross-platform code generation is a critical challenge in modern software engineering, particularly for systems targeting heterogeneous instruction set architectures and operating systems. Although large language models (LLMs) have demonstrated strong capabilities in code generation, existing approaches often suffer from implicit semantic modeling, insufficient handling of platform-specific constraints, and lack of reliable validation mechanisms, leading to unstable and non-compilable outputs in real-world scenarios. To address these limitations, this paper proposes CCGMAS, a multi-agent framework for cross-platform Go code generation. The framework consists of four collaborative agents: a Platform Residue Analysis Agent that extracts platform-dependent semantics and constructs a structured platform residue profile, a Requirement Generation Agent that transforms multi-source code context into a requirement-centered semantic representation with iterative quality optimization, a Code Generation Agent that produces target-platform implementations through multi-candidate synthesis, and a Verification Agent that performs progressive validation and provides structured feedback. By introducing requirement documents as an intermediate semantic layer and incorporating platform residue modeling, CCGMAS enables more explicit semantic alignment across platforms. Furthermore, a feedback-driven refinement loop is designed to iteratively correct errors at different stages, improving both functional correctness and platform compatibility. Experiments on CCGBench demonstrate that CCGMAS reduces the platform residue rate by up to 62.2% in the best case and improves the cross-platform build pass rate by up to 45.0% compared with direct translation baselines.
As the global software infrastructure ages, the modernization of legacy systems—particularly the migration of monolithic Java 8 applications to contemporary Long-Term Support (LTS) versions like Java 17 or 21—has become a critical imperative for security, performance, and maintainability. While Large Language Models (LLMs) have demonstrated exceptional proficiency in isolated code generation tasks, their application to repository-scale migration is severely constrained by "contextual hallucinations"—a phenomenon where models generate syntactically correct but structurally invalid code due to a lack of global state awareness. Recent empirical studies (e.g., Collu-Bench [1]) indicate that determining the hallucination status of generated code remains an unsolved problem, with prediction accuracy often below 33%. In this work, we introduce TriArchitect, a novel shared-state multi-agent framework designed to bridge the gap between probabilistic reasoning and deterministic structural integrity. TriArchitect introduces three key innovations: (1) the Typed Migration Graph (TMG), a formal directed acyclic graph that serves as a persistent semantic memory of the migration state; (2) a specialized role-based multi-agent architecture comprising an Archeologist (analysis), Architect (synthesis), and Validator (verification); and (3) a rigorous Validator-Veto Protocol, which enforces a "compilation-as-consensus" rule to reject hallucinated proposals before they corrupt the codebase. We evaluate TriArchitect on J8-to-J17-Bench, a comprehensive benchmark of 1,000 method-level and class-level migration tasks. Results demonstrate a System Success Rate (SSR) of 68.4%, statistically outperforming significant baselines including OpenRewrite (62.0%), SWE-Agent (63.5%), AutoCodeRover (64.8%), and raw GPT-5.1 (65.2%), while reducing token consumption by 40% through state-aware prompting.
Neeraj Kumar Singh Beshane· International journal of com...· 0 citations
The AgentCodeReview system is presented, a multi-agent system that is able to conduct explainable code review and automated bug repair by leveraging software engineering agents with different code review tasks and its utility and extensibility to the field of explainable AI in software quality assurance are demonstrated.
B. N, T. L. Manasa· International journal of com...· 0 citations
This work proposes TraceDev, a multi-agent framework for automated software development grounded in use cases that contain multiple functional points and complex semantics, and demonstrates the effectiveness of TraceDev in repository-level code generation from requirements.
Mingyu Chen, Yakun Zhang, Zihao Xie et al.· 0 citations