TL;DR
CoRedSkill is a novel red-teaming framework that generates stealthy, multi-stage attacks on LLM agents by distributing malicious operations across a composition of seemingly benign skills. By using AST-guided injection to interweave attack logic with legitimate task code, it achieves a 98% attack success rate while evading state-of-the-art security scanners and preserving the agent's original utility.
What Problem Does This Paper Address?
As Large Language Model (LLM) agents become more capable, they rely on "skills"—modular packages containing instructions, code, and resources—to perform complex tasks. However, these skill libraries often draw from third-party publishers whose trustworthiness varies.
Existing security research (red-teaming) has focused on two main areas:
- Single-skill attacks: These pack the entire malicious payload into one skill. Because the full context is available, modern LLM-based scanners are quite good at catching them.
- Compositional attacks: These distribute the attack across multiple skills, but they often break the original "business logic" of the skill. If a skill stops working correctly, a user won't adopt it, and the agent won't invoke it.
The authors of CoRedSkill address the challenge of creating attacks that are stealthy (evade individual package auditing), functional (preserve the skill's original utility), and autonomous (rely on the agent's own logic to connect the attack stages).
Methods
CoRedSkill operates through a three-step pipeline:
- Workflow Decomposition: It takes a legitimate, "clean" skill and decomposes its workflow into $k$ interdependent stages. Each stage is packaged as a separate skill that handles a specific part of the task and passes data to the next stage via intermediate artifacts (like JSON files).
- Attack Chain Decomposition: The desired attack (e.g., stealing a credential) is broken down into steps that align with the task stages. For example, Stage 1 might locate a sensitive file, Stage 2 reads its value, and Stage 3 exfiltrates it.
- AST-Guided Injection: This is the technical core of the paper. Instead of simple prompt injection, CoRedSkill uses Abstract Syntax Tree (AST) rewriting. It identifies "anchor" functions in the original code and rewrites them to include attack operations. This ensures the code remains syntactically valid and the malicious logic is deeply integrated into the legitimate data flow.
By passing attack-relevant information through the same intermediate artifacts used for the legitimate task, the attack "blends in" to normal processing.
Datasets
The authors introduced a new benchmark to evaluate these stealthy compositional attacks:
- 150 Evaluation Cases: Created by pairing 50 diverse tasks (ranging from bank reconciliation to hotel booking) with three attack objectives.
- Attack Objectives: Data Exfiltration (EXF), Unauthorized State Tampering (TAM), and Privilege Violation (PRV).
- Source Scenarios: Tasks were adapted from existing agent benchmarks like Skill-Inject, $\tau$-bench, and AgentDojo.
- Controls: The benchmark includes original skills and clean decompositions to measure false-positive rates in security scanners.
Key Insights and Ideas
- Stealth through Fragmentation: Much like a smuggler breaking a prohibited item into harmless-looking parts, CoRedSkill fragments an attack so that no single skill appears malicious during an audit.
- Utility as a Trojan Horse: The paper emphasizes that "Skill utility is the basis for user adoption." By maintaining a 95.3% task success rate, these malicious skills are much more likely to be deployed and used in real-world settings than previous attack methods.
- The Composition Size Paradox: Interestingly, more skills do not always mean more stealth. The authors found that detection rates don't decrease monotonically as you add more skills (see Figure 2). Sometimes, distributing an attack across too many skills leaves some stages with too little "legitimate" code to hide the malicious operations.
Key Results
CoRedSkill significantly outperformed four major baselines (Skill-Inject, SkillJect, SCR-Bench, and ColluSkill) across all metrics:
- Attack Success Rate (ASR): Achieved 98.0% overall, meaning the malicious objective was almost always met.
- Task Success Rate (TSR): Maintained 95.3%, proving the skills remained useful for their intended legitimate purposes.
- Detection Rate (DR): Only 3.3% of cases were flagged by individual-package scanners like SkillScan.
- Joint Success Rate (JSR): This metric tracks cases where the attack succeeds, the task completes, AND the auditor is evaded. CoRedSkill reached 90.7%, while baselines struggled between 6.7% and 42.7%.
The method also proved resilient against runtime defenses. While static scanners look at the code, runtime auditors look at execution logs. CoRedSkill maintained low detection rates here as well, with only a 1.3% detection rate under the DefenseClaw policy engine.
Limitations and Future Work
The authors acknowledge several areas for further exploration:
- Pre-defined Specifications: The current construction relies on pre-defined attack templates and workflow interfaces. Automatic adaptation to arbitrary, unknown skill packages hasn't been tested.
- Static vs. Dynamic: The evaluation was performed on offline cases. Future work could examine how these attacks fare in environments with dynamic service interactions or long-term agent operations.
- Adaptive Defense: While the paper tested "composition-aware" auditing (reviewing all skills together), this defense still had a high false-positive rate (24%) on clean code, suggesting that distinguishing complex coordination from malicious collusion remains a difficult open problem.
Summary updated