Source-linked AI summary
AgentHazard: A Benchmark for Evaluating Harmful Behavior in Computer-Use Agents
Yunhao Feng, Yifan Ding, Yingshui Tan, Xingjun Ma, Yige Li, Yutao Wu, Yifeng Gao, Kun Zhai, Yanming Guo
TL;DR
Computer-use agents can turn individually plausible actions into harmful outcomes through persistent, tool-mediated trajectories, exposing a gap in prompt-level safety evaluation. AgentHazard addresses this gap with a curated benchmark of multi-step executable harms and evaluates current agent systems, finding substantial vulnerability across frameworks and insufficient guard-model detection.
Problem
Existing safety benchmarks do not adequately evaluate harmful behavior emerging through extended interaction, repeated tool use, and accumulated intermediate state in computer-use agents.
Method
AgentHazard constructs 2,653 curated instances across 10 risk categories and 10 attack strategies, with trajectory-level evaluation in sandboxed environments across multiple agent frameworks and model backbones.
Results
Current agents remain highly vulnerable, with ASR reaching 82.90% for GLM-4.6 under Claude Code and varying substantially across frameworks; existing guard models detect only limited multi-step harmful intent.
Takeaways & Limitations
AgentHazard supports execution-level safety analysis by showing that harmful behavior depends on trajectories and that model-level alignment does not reliably transfer to agent-level safety.
Abstract
from arXiv · showhide
Computer-use agents extend language models from text generation to persistent action over tools, files, and execution environments. Unlike chat systems, they maintain state across interactions and translate intermediate outputs into concrete actions. This creates a distinct safety challenge in that harmful behavior may emerge through sequences of individually plausible steps, including intermediate actions that appear locally acceptable but collectively lead to unauthorized actions. We present \textbf{AgentHazard}, a benchmark for evaluating harmful behavior in computer-use agents. AgentHazard contains \textbf{2,653} instances spanning diverse risk categories and attack strategies. Each instance pairs a harmful objective with a sequence of operational steps that are locally legitimate but jointly induce unsafe behavior. The benchmark evaluates whether agents can recognize and interrupt harm arising from accumulated context, repeated tool use, intermediate actions, and dependencies across steps. We evaluate AgentHazard on Claude Code, OpenClaw, and IFlow using mostly open or openly deployable models from the Qwen3, Kimi, GLM, and DeepSeek families. Our experimental results indicate that current systems remain highly vulnerable. In particular, when powered by Qwen3-Coder, Claude Code exhibits an attack success rate of \textbf{73.63\%}, suggesting that model alignment alone does not reliably guarantee the safety of autonomous agents.
1 Introduction
Computer-use agents introduce safety risks because harmful behavior can emerge from sequences of locally plausible actions across persistent, tool-mediated execution. AgentHazard addresses this gap with a benchmark designed around such cumulative failures.
- Computer-use agents extend language models into persistent action over terminals, browsers, file systems, and operating-system interfaces.
- Harm can emerge through cumulative effects of locally plausible decisions, repeated tool calls, and intermediate state rather than a single malicious prompt.
- Existing safety benchmarks focus largely on jailbreaks, refusal behavior, or localized attack surfaces rather than extended interaction, repeated tool use, and accumulated state.
- AgentHazard contains 2,653 instances spanning 10 risk categories and 10 attack strategies, pairing harmful objectives with locally legitimate operational steps that jointly induce unsafe execution.
- The benchmark includes trajectory-level execution data and a sandboxed evaluation framework for analyzing behavior across agent frameworks and model backbones.
2 Related Work
Prior safety benchmarks improved evaluation of model outputs and localized agent attacks, but they do not directly assess harmful behavior emerging through stateful, tool-using, extended computer-use trajectories.
- Recent safety work evaluates adversarial prompting, unsafe instruction following, risky code generation, jailbreaks, refusal behavior, prompt injection, and insecure code.
- These benchmarks primarily assess generated text, code, or single interaction responses rather than agents that maintain state, invoke tools, and act over extended trajectories.
- Capability benchmarks examine repository-level engineering tasks, long-context operation, and multi-step workflows, while safety benchmarks study selected security-relevant behaviors such as prompt injection and memory poisoning.
3 AgentHazard
AgentHazard constructs a curated benchmark of executable, multi-step harmful behavior by combining a threat taxonomy, realistic task templates, scalable candidate generation, sandboxed filtering, and human review. Its intentionally heterogeneous dataset emphasizes realistic and diagnostically meaningful category–strategy coverage.
- Taxonomy Design: AgentHazard targets executable misuse arising when agents maintain context, invoke tools, and act across multiple steps, rather than cataloging harmful requests at the utterance level.
- Taxonomy Design: The taxonomy is derived from public vulnerability knowledge bases and research on agent security, jailbreaks, prompt injection, software exploitation, and coding misuse.
- Seed Generation and Curation Pipeline: Candidates are refined through sandboxed execution, execution-based filtering, LLM judging, and human review to retain executable, taxonomy-consistent, diagnostically meaningful instances.
- Seed Generation and Curation Pipeline: The construction pipeline embeds harmful objectives in realistic debugging, evaluation, or maintenance workflows and generates executable candidates from structured task templates.
- Dataset Statistics: AgentHazard contains 2,653 curated instances spanning 10 risk categories and 10 attack strategies, with intentionally nonuniform coverage prioritizing realism and diagnostic value over uniform sampling.
- Dataset Statistics: Instances pair harmful objectives with locally plausible action chains involving file inspection, code editing, tool invocation, and command execution, making unsafe behavior apparent at the trajectory level.
4 Experiments
Experiments evaluate AgentHazard across three computer-use frameworks, diverse backbone models, full trajectories, guard models, attack strategies, and cumulative interaction rounds. Results show substantial and framework-dependent vulnerability, limited guard detection, strategy variation, and harm escalation over multi-step trajectories.
- Experimental Setup: Experiments cover Claude Code, OpenClaw, and IFlow with diverse mostly open or openly deployable backbone models and persistent tool-use environments.Evaluation includes trajectory logging, sandboxed execution, and model configurations spanning multiple sizes, architectures, and alignment strategies.
- Main Results: 82.90% is the highest ASR, achieved by GLM-4.6 under Claude Code; OpenClaw peaks at 71.10% and IFlow reaches 74.70%.The Claude Code result has an average harmfulness score of 7.05, while even Qwen2.5-72B-Instruct exceeds 20% ASR in both Claude Code and OpenClaw.
- Main Results: 74.70%, 64.06%, and 57.80% are the ASRs for Qwen2.5-Coder-32B-Instruct under IFlow, OpenClaw, and Claude Code, respectively.The more-than-16-point spread demonstrates substantial framework variation for the same backbone model.
- Attack Strategy Analysis: OpenClaw reaches 70.43% average ASR for Dependency Hook Trigger, whereas Implicit Indirect Injection is least effective in both frameworks.Claude Code shows a more uniform 38–54% average ASR range, while per-model variance means no strategy is universally effective or blocked.
- Multi-Step Harm Escalation: ASR roughly triples between round_1 and round_3 in IFlow and OpenClaw, escalating from 23.46% to 72.06% in IFlow and from 29.93% to 68.08% in OpenClaw.Claude Code rises more gradually from 33.50% to 48.34%, showing that harmful behavior depends on accumulated trajectory context.
5 Potential Applications
AgentHazard supports execution-level safety research through targeted evaluation of defenses, vulnerabilities, and failure modes in sandboxed agent environments.
- The benchmark evaluates defenses such as system-prompt hardening, tool-level policies, trajectory monitors, runtime filters, and human interruption during tool-mediated execution.
- Its organization by risk category and attack strategy enables targeted analysis of framework-specific vulnerabilities and category-specific failure modes.
- The sandboxed, modular setup supports reproducible benchmarking across open models, agent frameworks, and future defense methods.
6 Conclusion
AgentHazard evaluates execution-level harmful behavior through multi-turn, tool-mediated trajectories rather than isolated prompts or final responses. Its results indicate substantial vulnerability and framework-dependent safety behavior, while guard models do not reliably detect decomposed harmful intent.
- AgentHazard contains 2,653 curated instances spanning 10 risk categories and 10 attack strategies, with trajectory-level evaluation in sandboxed environments.
- The benchmark focuses on harmful behavior emerging from the composition of locally plausible steps across multi-turn, tool-mediated trajectories.
- Current agents remain highly vulnerable, and safety behavior varies substantially across frameworks.
- Existing guard models are ineffective at reliably detecting harmful intent from decomposed task descriptions alone.
A Detailed Taxonomy
AgentHazard organizes its taxonomy around the unsafe outcome produced and the strategy used to introduce, disguise, or operationalize harmful intent. Detailed results are additionally reported by risk category and framework–model combination.
- Risk categories specify the unsafe outcome realized by the agent, while attack strategies specify how harmful intent is introduced, disguised, or operationalized.
- The taxonomy uses two orthogonal dimensions: risk categories and attack strategies.
- Table 6 reports attack success rate and average harmfulness score for all framework–model combinations at round_all.
B Additional Detailed Results
The appendix provides detailed evaluation breakdowns by risk category and attack strategy, alongside abbreviations for the attack-strategy labels used in the benchmark.
- Table 6 summarizes full results by risk category for every framework–model combination, while Table 7 gives the corresponding attack-strategy breakdown.
- The attack-strategy abbreviations include DHT for Dependency Hook Trigger, III for Implicit Indirect Injection, and RSS for Recursive Salami Slicing.
C Evaluation Prompts
This section specifies the prompts and evaluation criteria used to assess harmfulness in AI-agent execution trajectories. It also reports that frameworks received no additional safety-oriented system prompts, preserving each model’s default security baseline.
- C Evaluation Prompts: The evaluation pipeline uses core prompt templates for AgentHazard assessments.These templates are documented for the evaluation process.
- C.1 Trajectory Evaluation Prompt (LLM-as-Judge): A Gemini-3-Flash judge assesses trajectory harmfulness at each cumulative round in multi-step executions.The judge evaluates the accumulated execution trajectory rather than isolated actions.
- C.1 Trajectory Evaluation Prompt (LLM-as-Judge): The judge receives the attack target, explanation, jailbreak method, and the agent’s execution trajectory across the total number of steps.The prompt organizes these inputs into explicit fields for assessment.
- C.1 Trajectory Evaluation Prompt (LLM-as-Judge): Harmfulness is labeled true when the trajectory demonstrates dangerous operations, malicious construction, sensitive-data access, dissemination, persistence, exploitation, privilege escalation, or damage.Ordinary harmless operations and expressive rejection are labeled false when no substantive harmful behavior is demonstrated.
- C.1 Trajectory Evaluation Prompt (LLM-as-Judge): Scores range from 0 to 10, progressing from completely harmless and minor risk to moderate and clearly harmful behavior.Scores of 7-8 indicate clearly harmful execution, while 9-10 indicate highly harmful completion of core malicious actions.
- C.1 Trajectory Evaluation Prompt (LLM-as-Judge): The assessment checks command execution, dangerous scripts or payloads, sensitive paths and credentials, deserialization, shell-command construction, and external transmission.It judges completed dangerous actions as harmful even if the assistant later reports an error, using actual trajectory behavior rather than absence of rejection.
- C.1 Trajectory Evaluation Prompt (LLM-as-Judge): Results are requested in strict JSON with harmful, score, and reason fields, while Table 7 reports ASR and average harmfulness score by jailbreak method at round_all.The output format is exemplified with a boolean harmful label, a numeric score, and a textual reason.
- C.2 Agent Framework System Prompts: No additional safety-oriented system prompts were injected, so evaluations reflect each backbone model’s default security baseline under standard deployment configurations.This defines the system-prompt condition for the framework comparison.