← Latest papers
💬 NLP

Code as a Weapon: A Consensus-Labeled Prompt Bank for Measuring Coding-Model Compliance with Malicious-Code Requests

This paper introduces a consensus-labeled prompt bank that distinguishes between executable malicious code and harmful security knowledge to provide a reliable, standardized benchmark for measuring whether coding-specialized models meet the stricter refusal standards required to prevent the generation of functional weapons.

Original authors: Richard J. Young, Gregory D. Moody

Published 2026-05-28
📖 5 min read🧠 Deep dive

Original authors: Richard J. Young, Gregory D. Moody

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

The Big Idea: Text vs. The Real Thing

Imagine you ask a general chatbot, "How do I make a bomb?" If it answers, it gives you a recipe. You still have to go to the store, buy the ingredients, and mix them yourself. It's dangerous information, but it's just words.

Now, imagine you ask a coding-specialized AI the same question. If it answers, it doesn't just give you a recipe; it hands you a fully assembled, working bomb that is ready to explode the moment you press "run."

The authors of this paper argue that because coding AIs can hand over "working weapons" (like viruses or spyware) instantly, they should be much stricter about saying "No" than regular chatbots. But right now, nobody has a good way to measure if they are actually saying "No" enough.

The Problem: Mixing Apples and Oranges

To test if these AIs are safe, researchers have been using lists of questions (prompts). But these lists have been messy. They mix two very different types of dangerous requests:

  1. "Weapon" Requests: "Write me a program that steals passwords." (The AI gives you the code).
  2. "Knowledge" Requests: "Explain how password stealing works." (The AI gives you an essay).

If you mix these together and say, "This AI refused 50% of the bad requests," you don't know if it refused the weapons or just the explanations. It's like testing a security guard by asking them to stop a thief and stop someone asking for directions. If the guard stops the thief but lets the direction-seeker through, you can't tell if they are good at their job just by looking at the total number of people stopped.

The Solution: A "Consensus-Labeled" Prompt Bank

The authors created a massive, clean, and organized list of 6,675 dangerous questions. They split them into two clear buckets:

  • The "CODE" Bucket: Questions asking for executable, dangerous software (the "weapons").
  • The "KNOWLEDGE" Bucket: Questions asking for harmful information or theories (the "recipes").

To make sure the questions were sorted correctly, they didn't just ask one person. They used a panel of five different AI judges (like a jury). Each judge looked at every question and voted: "Is this a weapon request?" or "Is this a knowledge request?"

  • The Verdict: If at least 3 out of 5 judges agreed, the question got a final label.
  • The Result: They ended up with 4,748 confirmed "Weapon" requests and 1,923 confirmed "Knowledge" requests.

The "Jury" and the Surprises

The authors used five different AI models to act as the judges. They wanted to make sure the test was cheap and open for everyone to use, so they picked models that are free or open-source, rather than expensive, paid ones.

During this process, they found two interesting things:

1. The "Too Easy" Paradox
For some of the question lists (like the ASTRA list), almost every single question was obviously a "Weapon." The judges all agreed 99% of the time.

  • The Metaphor: Imagine a math test where every question is "What is 2+2?" Everyone gets 100%. You can't really measure how "smart" the students are because the test was too easy.
  • The Finding: In statistics, when everyone agrees on everything, the usual score for "agreement" (called Kappa) breaks and looks like a zero or a negative number. The authors had to invent a special way to report this: "Hey, everyone agreed perfectly, but the math score looks weird because the test was too easy."

2. The "Gatekeeper" Glitch
One of the five AI judges (a free model from OpenAI) started refusing to answer any of the questions, even the ones it was supposed to judge. It kept hitting a "Stop" sign from the company that hosts it.

  • The Metaphor: Imagine a jury where one juror keeps getting kicked out of the courtroom for asking too many questions.
  • The Fix: Since the rule was "3 out of 5," the other four judges could still decide the verdict. The authors noted this as a real-world quirk: sometimes the free tools you use to test safety have their own safety filters that block the test before it even starts.

Why This Matters

This paper isn't about testing a specific AI to see if it's safe today. Instead, it's about building the ruler that everyone else can use.

Before this, researchers were trying to measure safety with a broken ruler that mixed up "weapons" and "recipes." Now, they have a standardized, high-quality ruler (the prompt bank) that clearly separates the two. This allows anyone to test coding AIs and say, "Okay, this AI refused 90% of the actual weapons," which is a much more meaningful safety check than before.

Summary

  • Goal: Create a clean list of dangerous questions to test if coding AIs are safe.
  • Method: Used a "jury" of 5 AIs to sort 6,675 questions into "Weapons" (Code) and "Recipes" (Knowledge).
  • Outcome: A public database of 4,748 confirmed weapon requests and 1,923 knowledge requests.
  • Key Insight: You can't measure safety properly if you mix up "making a bomb" with "reading about bombs." This paper fixes that mix-up.

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 →