← Latest papers
🤖 AI

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

The paper introduces DualGauge, an automated framework and benchmark demonstrating that current LLMs and coding agents struggle to simultaneously generate code that is both functionally correct and secure, with joint success rates remaining below 15% across multiple languages and revealing that enhanced model capabilities or iterative scaffolding do not reliably resolve these security-functionality trade-offs.

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

Published 2026-06-16
📖 5 min read🧠 Deep dive

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

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you hire a very talented, fast-talking robot chef to cook a meal based on a simple verbal description: "Make a sandwich."

For a long time, we've only checked if the robot followed the recipe. Did it put bread on the plate? Yes. Did it add ham? Yes. If the sandwich looks right, we say, "Great job!"

But this new paper, DualGauge, asks a much harder question: "Is the sandwich safe to eat?"

Maybe the robot followed the recipe perfectly, but it also accidentally sliced the ham with a rusty knife it found in the drawer, or it used a cutting board that was never washed. The sandwich looks like a sandwich, but it's dangerous.

Here is the story of what the researchers found, explained simply.

1. The Problem: The "Looks Good" Trap

The researchers discovered that current AI coding tools (like the robot chef) are great at making things that look like they work, but they are terrible at making things that are actually safe.

They built a new testing system called DualGauge. Think of this as a "Double-Check Kitchen."

  • The Old Way: You taste the sandwich. If it tastes like ham, you pass the test.
  • The DualGauge Way: You taste the sandwich (Functionality), AND you inspect the kitchen for rusty knives, dirty boards, and poison (Security).

2. The Benchmark: The "307 Sandwich Orders"

To test this, they created a massive menu of 307 different tasks.

  • Each task was just a simple sentence, like "Write a program that reads a file."
  • They didn't give the AI any hints, code snippets, or safety warnings. Just the order.
  • For every order, they created two sets of tests:
    1. The Taste Test: Does the program do what it's supposed to do?
    2. The Safety Inspection: Does the program try to steal files, crash the system, or let hackers in?

3. The Shocking Results

They asked 10 of the smartest AI models (the "chefs") to make these 307 sandwiches. Here is what happened:

  • The "Looks Good" Score was High: Many models got about 39% of the sandwiches tasting right. They followed the recipe!
  • The "Safe" Score was Low: When checking for safety, the scores dropped.
  • The "Perfect" Score was Tiny: When they asked, "Did you make a sandwich that tastes right AND is safe?" the best AI model got less than 15% right.

The Analogy: Imagine a student taking a math test. They get 90% of the answers right (Functional Correctness). But if you ask, "Did you also check your work for calculation errors?" they fail. The paper found that being good at coding does not automatically mean you are good at coding safely.

4. Why "Thinking Harder" Didn't Help

The researchers tried to fix the problem by giving the AI more tools, just like giving a chef better knives or more time to think. They tried:

  • Bigger Models: Using the "super-chefs" (larger AI brains).
  • Extended Thinking: Telling the AI, "Take your time and think step-by-step."
  • Specialized Training: Teaching the AI specifically how to be a coder.

The Result: None of these tricks reliably fixed the safety issue. Sometimes the AI got better at the recipe, but still forgot to wash the cutting board. Sometimes it got better at safety but forgot the recipe. Safety and Functionality are two different skills that don't always grow together.

5. The "Robot Assistant" Didn't Help Either

There are new AI tools that act like "agents." Instead of just writing the code once, they try to fix their own mistakes. They write code, run it, see an error, and try again.

The researchers found that on these "pure recipe" tasks, the agents didn't do any better than the simple robots.

  • Why? The agents spent all their time looking for tools in the kitchen (like searching for a specific file or setting up a server) instead of actually fixing the safety of the sandwich. They were busy "managing the kitchen" but not "cooking safely."

6. The "Hidden Danger"

The paper found a specific pattern in why the AI failed.

  • Functional Failures: The AI usually failed because it got the "shape" of the answer wrong (e.g., it returned the wrong type of data).
  • Security Failures: The AI usually did try to be safe, but it was incomplete.
    • Example: The AI put a lock on the door (a security guard), but it forgot to lock the back window. The guard looked good, but the house was still unsafe.

The Bottom Line

The paper concludes that we cannot just trust AI because it writes code that "works."

  • Functional correctness is a bad lie detector for safety. Just because code runs without crashing doesn't mean it's secure.
  • We need a new standard. We need to test for safety and function at the same time, using the same rules.
  • Current AI isn't there yet. Even the smartest models are failing to consistently produce code that is both useful and safe.

In short: Just because the robot chef made a sandwich that looks delicious, doesn't mean you should eat it. We need to check the kitchen, too.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →