Capture the Flags: Family-Based Evaluation of Agentic LLMs via Semantics-Preserving Transformations
This paper introduces "Capture the Flags," a framework and tool called Evolve-CTF that generates families of semantically equivalent cybersecurity challenges to evaluate agentic LLMs, revealing that while models are robust to simple code changes, their performance degrades under complex obfuscation and that explicit reasoning offers little benefit.
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 are hiring a detective to solve a mystery. In the world of Artificial Intelligence, these "detectives" are Agentic LLMs (AI models that can think, write code, and use tools like a human would). To test if they are good detectives, researchers usually give them a series of puzzles called Capture the Flag (CTF) challenges. In these puzzles, the AI has to find a hidden secret (the "flag") inside a piece of code by exploiting a weakness.
However, there's a problem with how we usually test them. It's like giving a detective the exact same mystery 100 times, just with the names of the characters changed. If the detective memorized the solution to the first one, they might pass all 100 tests without actually understanding the mystery. They might just be recognizing patterns rather than truly solving the problem.
This paper introduces a new way to test these AI detectives called "CTF Challenge Families."
The Core Idea: The "Same Cake, Different Frosting"
Instead of giving the AI 100 different, unrelated puzzles, the researchers take one puzzle and create a whole "family" of variations from it. They use a tool called Evolve-CTF to automatically rewrite the code in ways that don't change the actual logic or the solution, but make the code look very different.
Think of it like baking a cake:
- The Original Cake: A delicious chocolate cake with a hidden cherry in the middle.
- The Transformations:
- Renaming (R): You change the label on the box from "Chocolate Cake" to "Mystery Dessert #42." The cake inside is identical.
- Inserting Loops (T1): You add a layer of decorative frosting that looks complicated but is actually empty space. It doesn't change the cake, but it makes it look bigger.
- Inserting Conditionals (T2): You add a fake "trapdoor" in the kitchen that leads nowhere. It looks like a secret passage, but it's just a dead end.
- Obfuscation (O): You wrap the whole cake in layers of aluminum foil, shrink-wrap it, and encrypt the box. The cake is still there, but it's incredibly hard to get to.
The goal is to see: Can the AI detective still find the cherry (the solution) even when the cake looks weird, confusing, or wrapped in foil?
How They Tested It
The researchers took 16 real-world cybersecurity puzzles (from existing benchmarks) and used their tool to generate 24 variations for each one. They then asked 13 different AI models (like GPT-5, Claude, Gemini, etc.) to solve these puzzles.
They watched closely to see:
- Did the AI get confused by the new names?
- Did it get lost in the fake "dead end" code?
- Did it know how to use its tools (like a screwdriver or a flashlight) to unwrap the foil?
What They Discovered
1. The AI is great at ignoring "Cosmetic" Changes
When the researchers just changed the names of variables (like changing x to banana) or added some fake, useless comments, the AIs didn't care. They solved the puzzles just as easily as the originals.
- Analogy: If you tell a detective, "The suspect is wearing a red hat," and then you change the report to say "The suspect is wearing a crimson cap," the detective still knows who to look for.
2. The AI struggles when things get "Messy"
When the researchers combined several changes at once (adding fake loops, fake dead ends, and confusing comments all together), the AIs started to fail.
- Analogy: If you give the detective a map that has 50 fake roads drawn on it, all leading to nowhere, they get overwhelmed and can't find the real path.
3. The "Foil" (Obfuscation) is a Hard Barrier
When they wrapped the code in heavy encryption and compression (using a tool called PyObfuscator), most AIs couldn't solve it.
- Analogy: It's like giving the detective a locked safe and asking them to find the key, but they don't have a safe-cracking tool. They tried to write their own tools to break the safe, but often ran out of time (or "tokens," which is like their energy budget) before they could succeed.
4. "Thinking Harder" Didn't Always Help
Some AI models have a setting to "think more" before answering. The researchers found that turning this setting on didn't really help the AIs solve these tricky puzzles.
- Analogy: It's like telling a detective to "think really hard" about a locked safe. If they don't have the right tools or skills, thinking harder just makes them tired, not smarter.
5. Some Puzzles Were Too Easy
They found that three of the original puzzles were so simple that even the "messy" versions were solved by almost every AI.
- Analogy: It's like giving a detective a puzzle where the answer is written on the back of the envelope. These puzzles weren't good tests of skill because they didn't challenge the AI enough.
Why This Matters
This research is a big step forward because it stops us from just "memorizing" the tests. It shows us that while current AIs are very good at reading code, they can get easily confused when that code is messy or hidden.
It also gives us a new tool (Evolve-CTF) to stress-test AI. Instead of asking, "Can this AI solve this puzzle?", we can now ask, "Can this AI solve any version of this puzzle, even if someone tries to trick it?"
In short, the paper teaches us that to build truly robust AI security experts, we need to test them not just on clean, clear puzzles, but on the messy, confusing, and "obfuscated" reality of the real world.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.