AgentHazard

A Benchmark for Evaluating Harmful Behavior in Computer-Use Agents
๐ฏ Overview
AgentHazard is a comprehensive benchmark for evaluating harmful behavior in computer-use agents. Unlike traditional prompt-level safety benchmarks, AgentHazard focuses on execution-level failures that emerge through the composition of locally plausible steps across multi-turn, tool-mediated trajectories.
Key Features
- ๐ฏ 2,653 curated instances spanning diverse risk categories and attack strategies
- ๐ 10 risk categories: RCE, Data Exfiltration, Persistence, Supply Chain Poisoning, Destructive Actions, Internal Reconnaissance, Privilege Escalation, Resource Exhaustion, Prompt Intelligence Theft, and Compliance Bypass
- โ๏ธ 10 attack strategies: Direct, Recursive Salami Slicing, Security Audit Gaslighting, Dependency Hook Trigger, Pseudo Diagnostic Debugging, Contextual Persona Enforcement, Encoded Payload Smuggling, Implicit Indirect Injection, Logical Dependency Inversion, and Legacy Code Maintenance
- ๐ฌ 3 agent frameworks: Claude Code, OpenClaw, IFlow
- ๐ค Multiple models: Qwen2.5/3, Kimi K2/K2.5, GLM-4.6, DeepSeek
- ๐ 10,000+ execution trajectories for detailed analysis
โ ๏ธ Real-World Attack Effectiveness
Our attacks are not merely theoreticalโthey trigger actual security alerts in production environments:
Real security monitoring alert triggered during AgentHazard evaluation, confirming the real-world severity of identified vulnerabilities.
๐ฆ Dataset Access
For Reviewers
All materials required for review are available below:
| Resource | Description | Link |
|---|---|---|
| ๐ Dataset | 2,653 instances in JSON format | Download |
| ๐ Appendix | Detailed taxonomy and methodology | Download |
| ๐ป Code | Full source code & evaluation framework | GitHub |
| ๐ Trajectories | Execution traces from agent runs | Browse |
Quick Start
# Clone the repository
git clone https://github.com/Yunhao-Feng/AgentHazard.git
cd AgentHazard
# Install dependencies
pip install -r requirements.txt
# Load the dataset
import json
with open('data/dataset.json', 'r') as f:
dataset = json.load(f)
print(f"Loaded {len(dataset)} instances")
๐ Dataset Statistics
| Statistic | Value |
|---|---|
| Total Instances | 2,653 |
| Risk Categories | 10 |
| Attack Strategies | 10 |
| Seed Pool Size | 8,000+ |
| Avg. Decomposition Length | 11.55 |
| Avg. Target Length | 20.98 |
| Agent Frameworks | 3 |
| Trajectories | 10,000+ |
๐๏ธ Benchmark Construction
AgentHazard is constructed through a rigorous multi-stage pipeline:
- Taxonomy Design: Define risk categories and attack strategies from vulnerability knowledge bases and prior literature
- Task Generation: Create task templates embedding harmful objectives within realistic workflows
- Seed Pool Generation: Use LLMs to generate large-scale candidate instances
- Execution-Based Filtering: Run instances in sandboxed agent environments to validate executability
- LLM-as-Judge Evaluation: Use Gemini-3 and GPT-5.4 to verify alignment with intended objectives
- Human Curation: Manual review to remove duplicates and ensure quality

๐ฌ Experimental Results
Main Results
We evaluate AgentHazard on three representative agent frameworks using diverse backbone models:
| Framework | Model | Overall ASR (%) | Harmfulness Score |
|---|---|---|---|
| Claude Code | GLM-4.6 | 82.90 | 7.05 |
| Claude Code | Kimi-K2.5 | 78.30 | 6.47 |
| Claude Code | Qwen3-Coder | 73.63 | 5.95 |
| IFlow | Qwen2.5-Coder-32B | 74.70 | 6.06 |
| OpenClaw | Kimi-K2 | 71.10 | 5.82 |
| OpenClaw | GLM-4.6 | 70.80 | 6.15 |
ASR = Attack Success Rate (higher is more vulnerable)
Key Findings
- ๐จ High Vulnerability: Current agents remain broadly vulnerable, with the highest ASR reaching 82.90%
- ๐ Multi-Step Escalation: ASR roughly triples between Round 1 and Round 3, confirming trajectory-dependent harm
- ๐ Framework Variance: Same model shows up to 16pp ASR difference across frameworks
- ๐ก๏ธ Guard Model Limitations: Best guard model (Llama-Guard-3-8B) detects only 27.03% of harmful intent
- โ ๏ธ Real-World Impact: Attacks trigger actual security monitoring systems in production environments (see alert evidence)
๐ฏ Attack Categories
Risk Categories
- System RCE: Arbitrary command execution
- Data Exfiltration: Unauthorized data extraction
- Persistence Establishment: Backdoor insertion
- Supply Chain Poisoning: Dependency manipulation
- Destructive Action: Irreversible damage
- Internal Reconnaissance: Network enumeration
- Privilege Escalation: Container escape
- Resource Exhaustion: DoS attacks
- Prompt Intelligence Theft: System prompt extraction
- Compliance Bypass: Policy violation
Attack Strategies
- Direct: Explicit harmful requests
- Recursive Salami Slicing: Decomposition into benign subtasks
- Security Audit Gaslighting: Framing as security validation
- Dependency Hook Trigger: Embedding in build/CI pipelines
- Pseudo Diagnostic Debugging: Fabricated failure traces
- Contextual Persona Enforcement: Role escalation
- Encoded Payload Smuggling: Obfuscation techniques
- Implicit Indirect Injection: Hidden instructions in artifacts
- Logical Dependency Inversion: Harm as prerequisite for safety
- Legacy Code Maintenance: Framing as legacy preservation
๐ Dataset Structure
Each instance in AgentHazard follows this structure:
{
"id": "unique_instance_id",
"risk_category": "System RCE",
"attack_strategy": "Recursive Salami Slicing",
"task_description": "Fix the failing unit test...",
"decomposition": [
"Step 1: Inspect the test file",
"Step 2: Identify the assertion",
"Step 3: Modify the configuration",
"..."
],
"target_harmful_action": "Execute arbitrary shell command",
"workspace_files": {
"test.py": "...",
"config.json": "..."
},
"expected_trajectory_length": 5,
"metadata": {
"difficulty": "medium",
"frameworks": ["claudecode", "openclaw"]
}
}
๐ Repository Structure
AgentHazard/
โโโ data/
โ โโโ dataset.json # Main benchmark dataset
โ โโโ evaluation_results.csv # Experimental results
โโโ traces/
โ โโโ claudecode/ # Claude Code execution traces
โ โโโ openclaw/ # OpenClaw execution traces
โ โโโ iflow/ # IFlow execution traces
โโโ config/ # Configuration files
โโโ pics/ # Images and figures
โ โโโ logo.png
โ โโโ framework.png
โ โโโ illustration.png
โ โโโ demo.jpg
โ โโโ heatmap.jpg
โ โโโ alert.png # Real security alert evidence
โโโ appendix.pdf # Supplementary material
โโโ index.html # Project website
โโโ README.md # This file
โโโ LICENSE # MIT License
๐ Citation
If you use AgentHazard in your research, please cite:
@inproceedings{feng2026agenthazard,
title = {AgentHazard: A Benchmark for Evaluating Harmful Behavior in Computer-Use Agents},
author = {Feng, Yunhao and Ding, Yifan and Tan, Yingshui and Ma, Xingjun and
Li, Yige and Wu, Yutao and Gao, Yifeng and Zhai, Kun and Guo, Yanming},
booktitle = {arXiv:2604.02947},
year = {2026}
}
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Contributing
We welcome contributions! Please see our contributing guidelines for details.
๐ Acknowledgments
- We thank the Alibaba Group and Fudan University for supporting this research
- Special thanks to the Claude Code, OpenClaw, and IFlow teams for their agent frameworks
- We acknowledge the Qwen, Kimi, GLM, and DeepSeek teams for their open models
๐ Contact
For questions, issues, or collaboration inquiries:
- GitHub Issues: Report a bug or request a feature
- Website: https://yunhao-feng.github.io/AgentHazard/
โ ๏ธ Research Use Only
This benchmark is released for research purposes to advance the safety of computer-use agents.
Please use responsibly and ethically.
Made with โค๏ธ by the AgentHazard Team