As Large Language Models (LLMs) evolve into autonomous agents capable of executing multi-step tasks, a critical new vulnerability has emerged: the decomposition attack. Attackers can bypass standard safety filters by breaking down a malicious goal into a sequence of seemingly harmless steps. This paper introduces a lightweight, sequential monitoring framework that evaluates cumulative conversation history to catch these attacks in real-time, proving that carefully prompted small models can block 93% of attacks while slashing costs.
The Threat of Decomposition Attacks
Modern LLMs are heavily fine-tuned to refuse explicitly harmful requests (e.g., "How do I build a bomb?"). However, current safety filters typically evaluate prompts in isolation—a "shallow alignment" approach. They fail to recognize overarching malicious intent when a task is decomposed into stateful, benign subtasks.
For example, an attacker might ask an agent to "search for recent controversial posts," then "filter for specific users," and finally "repost to increase visibility." Individually, these commands are benign; together, they achieve a harmful outcome. Standard guardrails, such as Llama-Guard-4-12B, perform poorly against these multi-step attacks, highlighting a massive blind spot in current safety classifiers.
The Solution: Lightweight Sequential Monitoring
To combat this, the authors propose a Sequential Monitoring Framework. Instead of relying solely on the agent's internal safety filters, an external "monitor" LLM observes the conversation. At each step, this monitor reviews the cumulative prompt history. If the sequence of benign-looking steps suddenly reveals a harmful trajectory, the monitor flags it and halts the agent.
To make this practical for real-world deployment, the monitor must be fast and cheap. The researchers optimized lightweight models (like GPT-4o-mini and Llama-3.1-8B) using advanced prompt engineering techniques, specifically task-specific In-Context Learning (ICL) and Chain-of-Thought (CoT) reasoning.
Evaluating the Threat: The DecomposedHarm Dataset
To rigorously test their framework, the authors introduce DecomposedHarm, the largest dataset for evaluating stateful decomposition attacks. It contains 4,634 harmful-benign task pairs across three domains:
- General Agent Tasks: Multi-step tool use for cybercrime or fraud.
- Text-to-Image Generation: Multi-turn prompts that incrementally build up to a policy-violating image.
- Question-Answering (QA): Sequences of benign questions that combine to reveal harmful information.
Key Results: High Vulnerability, Stellar Defense
The study reveals that decomposition is highly effective against unprotected models. On GPT-4o, decomposition attacks achieved an average Attack Success Rate (ASR) of 87%. For image generation specifically, refusal rates plummeted from 83.5% (original prompt) to just 2.25% (decomposed prompts).
However, the proposed defense proved highly capable. The optimized lightweight monitor (GPT-4o-mini with QA ICL prompting) achieved a 93% Defense Success Rate (F1 score of 0.918).
Surprisingly, providing a lightweight model with task-specific ICL examples makes it vastly superior to zero-shot prompting on much larger, more expensive models. This setup outperformed expensive reference models like o3-mini and GPT-4o, cutting inference costs by ~90% and reducing latency by ~50%. Furthermore, the lightweight monitor remained robust even when attackers injected massive amounts of random subtasks or used automated red-teaming to iteratively rewrite prompts.
Limitations and Future Work
While highly effective against stateful attacks (where context is maintained in a single session), this framework does not address stateless attacks—where an attacker queries different models or isolated sessions and manually pieces the answers together. The monitor also currently acts as a binary classifier without built-in explainability. Future work will explore fine-tuning monitors to generate detailed explanations for their flagging decisions and developing technical solutions, such as cross-session embedding tracking, to combat stateless attacks.
Summary updated