NeurIPS 2026QuestionsPapersAreasAboutMarkdown

MOSAIC-Bench: Measuring Compositional Vulnerability Induction in Coding Agents

Jonathan Steinberg, Oren Gal

NeurIPS page · Open on the map

Category: AI Safety, Security & Alignment › Agent Security Benchmarks · Type: benchmark or dataset · Keywords: coding agents, compositional vulnerability, safety evaluation, benchmark, code generation security

Areas: Code & Coding Agents › Code Verification › Coding agent benchmarks; AI Agents › Agent Robustness › Agent Security Benchmarks; Safety & Security › Cybersecurity › Offensive Cyber Agent Benchmarks; Evaluation & Benchmarks › Language Model and Agent Safety › Agent Security Benchmarks; Benchmarks for LLMs & Agents › Agent Trustworthiness Benchmarks › Agent Security Benchmarks

Summary

MOSAIC-Bench is a benchmark of 199 three-stage attack chains that reveals compositional vulnerabilities in coding agents, showing high exploit success when tasks are broken into innocuous tickets.

Explained to a 5-year-old

Coding helpers sometimes say "yes" to small requests, but when you ask many small yeses, they can accidentally create something dangerous. The researchers made a big set of tricky tasks that hide attacks inside many small steps. They tested many helpers and found that most of the time they still say yes, even though the final result is bad. They also showed that if the person checking the work pretends to be a detective, they catch more of the bad results. This helps make coding tools safer.

Explained to a 5-year-old, longer

Imagine a robot that writes computer code when you ask it nicely. Usually, you ask it one thing, like "make a button that opens a menu." But sometimes people break a big job into many tiny jobs, like first make a button, then add a label, then connect it to a server. The robot might say "yes" to each tiny job because each looks harmless. However, when all the tiny jobs are put together, the final code can have a secret door that lets bad people get in. The researchers noticed that most safety tests only ask the robot one big question, so they never see this hidden danger. So they created a new test called MOSAIC-Bench that has 199 groups of three tiny steps that hide attacks. Each group has a clear way to know if the attack worked, like a special checker. They ran the test on many coding helpers from big companies and found that most of them still let the attacks succeed. They also tried making the person who reviews the code act like a detective, and that helped catch many more attacks. The researchers released the test and the checking tool so other people can use them to make coding helpers safer.

For a technical reader

The paper introduces a benchmark that evaluates coding agents on multi-step attack chains to uncover compositional vulnerabilities missed by single-prompt safety tests. It reports high exploit rates (53-86%) on staged requests and lower rates (0-20.4%) on direct prompts, highlighting the importance of context in safety evaluation. The authors also demonstrate that reframing reviewers as adversarial pentesters significantly reduces evasion, providing a practical mitigation. The benchmark and evaluation framework are publicly released for community use.

Problem

Coding agents often appear safe when evaluated on individual prompts, but can produce exploitable code when tasks are decomposed into a sequence of seemingly harmless requests. Existing safety evaluations fail to capture these compositional attacks.

Method

The authors construct a benchmark comprising 199 three-stage attack chains with deterministic exploit oracles across multiple substrates, programming languages, and CWE classes, and evaluate both exploit success and downstream reviewer behavior. They also test mitigation strategies such as reframing reviewers as adversarial pentesters.

Results

Nine production coding agents achieved 53-86% end-to-end exploit success across staged attacks with only two refusals, while direct prompts reduced vulnerable outputs to 0-20.4%. Reviewer agents approved 25.8% of vulnerable diffs, and reframing reviewers as pentesters lowered evasion to 3.0-17.6% with an open-weight reviewer detecting 88.4% of attacks at a 4.6% false-positive rate.

Contributions

The work identifies a critical blind spot in safety evaluation by demonstrating how innocuous ticket sequences can induce exploitable code, and it provides a large-scale benchmark with deterministic exploit oracles and an adaptable evaluation framework to measure compositional vulnerabilities. It also proposes a simple mitigation by framing reviewers as adversarial pentesters.

Practical relevance

The benchmark and framework enable developers to test coding agents for compositional vulnerabilities and improve safety review processes.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction