TL;DR
HASTE is a multi-agent framework that automatically evolves LLM agent "harnesses"—the code and prompts that govern agent behavior—to defend against new attacks using only sparse evidence, such as a brief threat report. By employing an adversarial loop between safety-specification generation and attack-case generation, HASTE extrapolates from limited data to harden agents against emerging vulnerabilities without sacrificing their ability to perform helpful tasks.
What Problem Does This Paper Address?
Large Language Model (LLM) agents are increasingly autonomous, interacting with tools and environments to complete complex tasks. However, this autonomy introduces significant safety risks, including jailbreaks, prompt injections, and tool-based exploits.
Current defenses typically operate at two levels:
- Model-level: Aligning the underlying LLM (slow and computationally expensive).
- Harness-level: Implementing execution-time constraints like safety rules and permissions (flexible, but currently relies on manual engineering).
The core challenge is that new attacks emerge rapidly and are often documented only through "sparse evidence"—a few examples in a preprint or a brief description in a threat report. Existing automated defense methods usually require comprehensive benchmarks to function, leaving a gap in how we protect agents against emerging threats where data is scarce.
Methods
The authors introduce HASTE (Harness Adaptation from Sparse Threat Evidence), a three-stage multi-agent pipeline designed to bridge the gap between sparse evidence and robust defense.
- Stage 1: Attack Specification Generation: An Attack Parser agent distills raw, sparse evidence into a structured "attack specification" that captures the core mechanism of the threat rather than just incidental details.
- Stage 2: Adversarial Co-Optimization: This is the heart of the framework. Two optimizer agents work in parallel:
- A Specification Optimizer generates safety rules to strengthen the harness.
- A Case Optimizer generates new, synthetic attack cases to probe for residual vulnerabilities and utility cases to ensure the agent remains helpful.
- A Proposer agent then revises the harness code/prompts based on the safety specification.
- Stage 3: Evaluation and Feedback: A Judge agent evaluates the updated harness on the generated cases. This feedback is fed back into the optimizers for the next round, creating an adversarial loop that progressively hardens the defense.
The authors test two versions: HASTE<sub>blind</sub>, which relies entirely on generated cases for evolution, and HASTE<sub>seen</sub>, which incorporates the few initially observed examples into the evaluation process.
Datasets
The framework was evaluated using:
- Agent-SafetyBench (ASB): A comprehensive benchmark with 2,000 tasks across eight risk categories.
- STAC: A dataset focused on sequential tool attack chaining, where individually safe tool calls lead to an unsafe outcome.
- ASB-300: A sampled subset used for detailed ablation studies and in-depth analysis.
Key Insights and Ideas
- Extrapolation via Adversarial Play: The most powerful idea in HASTE is that you don't need a massive dataset to defend against a new attack. By tasking one agent to find new ways to break a defense and another to fix it, the system "imagines" variations of the attack, effectively extrapolating from a single report to a broader class of threats.
- Harnesses as a Flexible Defense Layer: Because the harness is essentially code or a system prompt wrapping the LLM, it can be updated instantly without the need for expensive model retraining.
- Utility is a First-Class Citizen: Many safety filters make agents "too safe" (refusing benign tasks). HASTE specifically generates "safely completable" cases during optimization to ensure that the Safe and Helpful Rate (SHR) remains high.
- Transferability: Defenses evolved on one "source" backbone model (like DeepSeek) were found to be effective when transferred to different "target" models (like GPT-5.4-mini), suggesting the evolved harnesses capture general safety principles.
Key Results
HASTE consistently outperformed both unprotected agents and existing guardrail/harness baselines across multiple backbone models.
- Safety Improvement: On Agent-SafetyBench, HASTE<sub>seen</sub> reduced the average Attack Success Rate (ASR) from 51.39% (no defense) to 28.50%.
- Utility Preservation: While improving safety, HASTE<sub>seen</sub> actually increased the Safe and Helpful Rate (SHR) from 44.52% to 58.39%, outperforming baselines that often became overly restrictive.
- Comparison to Meta-Harness: HASTE outperformed Meta-Harness (a recent state-of-the-art), largely because HASTE dynamically generates new test cases rather than optimizing against a fixed, static set.
Limitations and Future Work
- Selection in Blind Settings: For HASTE<sub>blind</sub>, where no real-world examples are available for validation, the system simply returns the final iteration. The authors note that finding a better way to select the "best" harness without ground-truth data is an open challenge.
- Single vs. Multiple Threats: The current study focuses on evolving defenses against one emerging attack at a time. Real-world scenarios might involve multiple simultaneous new threats, which warrants further research.
- Computational Overhead: The multi-agent iterative process requires multiple LLM calls, which may be a factor for rapid deployment in some environments.
Summary updated