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

Rupam Patir, Keyan Guo, Suvadra Barua, Jiawei Guo, Abhijeet Pathak, Dinesh Gudimetla, Hongxin Hu, Haipeng Cai


Abstract
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 DualGauge, the first fully automated framework for jointly evaluating correctness and security of specification-only code generation, supported by DualGauge-Bench, a language-agnostic benchmark of 307 coding tasks each paired with functional and security tests derived from the same specification. Evaluating 10 representative LLMs across Python, C++, and JavaScript, we find that functional correctness substantially overestimates reliable code generation: even the strongest model remains below 15% joint security-functionality success in every language. Common model-side factors—scale, extended thinking, quantization, instruction tuning, and code specialization—do not reliably improve joint performance, suggesting secure-and-correct code generation does not simply emerge from stronger coding capability. Evaluation of 3 leading agentic coding systems (Codex, OpenHands, and Claude Code) shows that iterative scaffolding provides no advantage over direct (LLM-based) generation on specification-only tasks. A qualitative audit reveals failures concentrate at the output contract boundary and in guards that exist but are insufficient—patterns that only joint benchmarking reliably exposes.
Anthology ID:
2026.findings-emnlp.1335
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
28295–28319
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.1335/
DOI:
Bibkey:
Cite (ACL):
Rupam Patir, Keyan Guo, Suvadra Barua, Jiawei Guo, Abhijeet Pathak, Dinesh Gudimetla, Hongxin Hu, and Haipeng Cai. 2026. DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 28295–28319, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents (Patir et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.1335.pdf