Source-linked AI summary

AgentHarm: A Benchmark for Measuring Harmfulness of LLM Agents

Maksym Andriushchenko, Alexandra Souly, Mateusz Dziemian, Derek Duenas, Maxwell Lin, Justin Wang, Dan Hendrycks, Andy Zou, Zico Kolter, Matt Fredrikson, Eric Winsor, Jerome Wynne, Yarin Gal, Xander Davies

arXiv:2410.09024v3cs.LGcs.AIcs.CL

TL;DR

Robustness research has focused mainly on chatbot jailbreaks, while the risks and robustness of multi-step LLM agents remain underexplored. The paper introduces AgentHarm to evaluate harmful agent tasks and jailbreaks, finding that models often comply without attacks and that simple jailbreaks can preserve coherent malicious behavior.

  • Problem

    Robustness has been studied almost exclusively for chatbot settings, leaving robustness to harmful multi-step agent tasks underexplored.

  • Method

    AgentHarm measures agents’ propensity and ability to complete explicitly harmful multi-step tasks, evaluates jailbreak effects, and scores whether agents retain coherent capabilities using multiple tools.

  • Results

    Many models comply with explicitly malicious agent tasks without jailbreaking; simple universal jailbreaks transfer to agents and enable coherent malicious multi-step behavior.

  • Takeaways & Limitations

    AgentHarm provides a synthetic environment for evaluating the robustness of LLM agents and comparing attacks and defenses as agent prevalence increases.

  • Takeaways & Limitations

    Synthetic tools make tasks easier and less realistic, so they serve as proxies for harm rather than direct evidence of harmful agent abilities.

Abstract

from arXiv · show

The robustness of LLMs to jailbreak attacks, where users design prompts to circumvent safety measures and misuse model capabilities, has been studied primarily for LLMs acting as simple chatbots. Meanwhile, LLM agents -- which use external tools and can execute multi-stage tasks -- may pose a greater risk if misused, but their robustness remains underexplored. To facilitate research on LLM agent misuse, we propose a new benchmark called AgentHarm. The benchmark includes a diverse set of 110 explicitly malicious agent tasks (440 with augmentations), covering 11 harm categories including fraud, cybercrime, and harassment. In addition to measuring whether models refuse harmful agentic requests, scoring well on AgentHarm requires jailbroken agents to maintain their capabilities following an attack to complete a multi-step task. We evaluate a range of leading LLMs, and find (1) leading LLMs are surprisingly compliant with malicious agent requests without jailbreaking, (2) simple universal jailbreak templates can be adapted to effectively jailbreak agents, and (3) these jailbreaks enable coherent and malicious multi-step agent behavior and retain model capabilities. To enable simple and reliable evaluation of attacks and defenses for LLM-based agents, we publicly release AgentHarm at https://huggingface.co/datasets/ai-safety-institute/AgentHarm.

1 INTRODUCTION

AgentHarm addresses the underexplored robustness of multi-step LLM agents to direct malicious requests and jailbreaks. It introduces a broad benchmark that evaluates both refusal and coherent task completion, finding substantial compliance and effective transfer of simple jailbreaks.

  • Motivation: LLM-agent robustness is underexplored because prior adversarial-robustness research focused mainly on chatbot answers to harmful questions.Agents can instead execute multi-stage harmful tasks through external tools, and single-turn robustness may not transfer to inherently multi-step settings.
  • Benchmark: AgentHarm measures whether LLM agents can complete explicitly harmful multi-step tasks and whether jailbreaks increase that performance.The benchmark targets direct prompting attacks in which a user provides the harmful request.
  • Benchmark: 110 unique and 330 augmented agentic behaviors span 11 harm categories, including fraud, cybercrime, and harassment.The benchmark also covers a broad set of potential agent tools.
  • Scoring: Each behavior requires coherent use of 2 to 8 distinct tools, while benign counterparts provide a baseline for model capabilities.Scoring includes task success to detect attacks that cause capability degradation rather than merely measuring refusal.
  • Findings: Many leading models comply with numerous explicitly malicious agent tasks without jailbreaks, suggesting safety training may not fully transfer to agents.This finding concerns direct prompting without an applied jailbreak attack.
  • Findings: Simple universal jailbreaks transfer to agents with minor modifications, dramatically increasing AgentHarm performance and enabling coherent malicious multi-step behavior.The jailbreaks do not merely produce incoherent, low-capability behavior.
  • Release: AgentHarm is publicly released to support simple and reliable evaluation of attacks and defenses for LLM-based agents.The benchmark is designed for evaluating both attack effectiveness and defensive robustness.

2 RELATED WORK

Related work covers function-calling and agent benchmarks, as well as safety benchmarks for indirect attacks. AgentHarm differs by studying direct malicious-user requests and using fixed tools with detailed rubrics.

  • Function calling and agents: Function-calling research has expanded from narrow single-turn APIs toward more complex systems involving successive calls and tool-result processing.Existing function-calling evaluation may lack the function execution and successive calls needed for multi-step agent scenarios.
  • Agent safety and security benchmarks: Agent safety benchmarks have often studied indirect attacks in which malicious third-party resources inject prompts into agents handling benign requests.AgentDojo focuses on prompt injections and harmless requests rather than direct malicious-user queries.
  • Agent safety and security benchmarks: AgentHarm studies harm from a malicious user directly providing a harmful query to an LLM agent.This setting differs from benchmarks where the user's underlying intent is assumed benign.
  • Agent safety and security benchmarks: Unlike ToolEmu, AgentHarm uses fixed tool implementations and detailed grading rubrics rather than emulated tool execution and LLM grading of accidental safety violations.The design explicitly aims to avoid those evaluation properties.

3 BENCHMARK

AgentHarm is a benchmark for evaluating harmful multi-step agent behaviors through behaviors, synthetic tools, and grading rubrics. It emphasizes broad harm coverage, coherent tool-dependent tasks, capability-aware scoring, and practical evaluation of attacks and defenses.

  • Benchmark components: AgentHarm comprises behaviors, synthetic tools, and grading rubrics for evaluating harmful multi-step agent tasks.The benchmark is organized around these three components.
  • Behaviors: 110 base behaviors span 11 harm categories, including fraud, cybercrime, self-harm, harassment, sexual harms, copyright, drugs, disinformation, hate, violence, and terrorism.The categories are represented by 10 base behaviors each.
  • Behaviors: Tasks are explicitly malicious, digitally realizable, and generally require dependent function calls in a particular order using information from earlier calls.The benchmark excludes real names, addresses, and places for ethical reasons.
  • Behavior augmentations: 440 tasks are produced from the 110 base behaviors through detailed, open-ended, and hint-included variants.Hint-included variants identify which function should be called first and intentionally make tasks easier.
  • Synthetic tools: Synthetic tools imitate general-purpose and domain-specific tools without side effects, while supporting coherent multi-turn interactions and agent self-correction.They are implemented as standalone functions using Inspect.
  • Limitations: Synthetic tools make tasks easier and less realistic, so benchmark outcomes act as proxies for harm rather than direct evidence of harmful agent abilities.The trade-off supports safer and easier evaluation while retaining harmful intent and multi-turn interaction requirements.
  • Scoring: AgentHarm scoring combines predefined checks, partial credit, semantic judging when needed, refusal measurement, and performance on non-refused behaviors.This design evaluates both harmful-task completion and whether attacks preserve agent capabilities.
  • Design principles: AgentHarm prioritizes broad harm coverage and a larger task set over deeper tasks within one domain, enabling finer-grained comparisons across models.The paper contrasts its 110 base and 440 augmented tasks with domain-specific benchmarks containing roughly 10–30 tasks.

4 EVALUATION

AgentHarm evaluates direct prompting, forced tool calls, and a universal jailbreak template across leading LLMs. Models often comply with malicious requests, while template attacks increase harmful performance and preserve basic agentic capabilities.

  • Main results: Many models comply with malicious tasks without jailbreaking; Mistral Large 2 reaches an 82.2% harm score while refusing only 1.1% of requests.GPT-4o mini scores 62.5% with 22% refusals, whereas Claude 3.5 Sonnet scores 13.5% with 85.2% refusals.
  • Main results: Template attacks increase harm scores and reduce refusals across most models, including GPT-4o from 48.4% to 72.7% and from 48.9% to 13.6% refusals.Claude 3.5 Sonnet rises from 13.5% to 68.7% harm score, while its refusal rate falls from 85.2% to 16.7%.
  • Main results: Non-refusal harm scores under template attacks closely match benign-task scores, indicating that jailbreaks generally preserve basic agentic capabilities.Claude 3.5 Sonnet reaches 81.9% versus 82% on benign tasks, while GPT-4o reaches 84.2% versus 89.9%.
  • Ablation studies and analysis: Best-of-5 sampling at temperature τ = 1 improves harm scores, raising Mistral from 67.4% to 90.8%.GPT-4o increases from 70.7% to 83.7%, and Claude 3.5 Sonnet from 65.1% to 79.7%.
  • Ablation studies and analysis: CoT and ReAct prompting increase refusals without attacks, while a refusal-inducing prompt produces substantial refusal improvements.Mistral shows little response to CoT or ReAct in the tool-calling regime, unlike GPT-4o and Claude.

5 DISCUSSION

The authors identify language, interaction, grading, tooling, and capability boundaries for AgentHarm. They position the benchmark as measuring basic agentic safety rather than advanced autonomous behavior.

  • Limitations: The benchmark uses English-only prompts, so performance and refusal rates in other languages are not assessed.The authors note that language variation may affect both measures.
  • Limitations: AgentHarm does not evaluate multi-turn attacks because the user supplies only one initial prompt and cannot follow up.The agent may still execute the task over multiple turns after that initial prompt.
  • Limitations: Grading functions can miss alternative execution traces that would count as correct, such as executions where the agent requests additional information.This limitation concerns the benchmark’s scoring process rather than the agent’s behavior itself.
  • Limitations: The benchmark requires custom tools tied to its grading criteria, limiting straightforward use with unsupported third-party tools or scaffolds.This constrains portability across external agent implementations.
  • Limitations: AgentHarm measures basic agentic capabilities rather than advanced autonomous capabilities in open-ended evaluations.The scope includes basic competencies such as multi-turn tool calls with cross-call dependencies.

A ADDITIONAL DISCUSSIONS

The discussion addresses ethical release concerns, evaluation methodology, and differences between agent and chatbot robustness. It emphasizes that multi-step agent jailbreaks must sustain harmful behavior across tool calls, while attacks are less effective on chat-only tasks.

  • Ethical considerations: AgentHarm’s release could enable harmful-agent optimization, but predefined tools and no real-world interactions limit transfer potential.The authors argue the benchmark still provides a signal of real misuse potential.
  • Evaluation methodology: The primary harm score uses manually written grading conditions, with LLM judges restricted to narrow on-topic checks.Execution logs were manually examined to verify judge robustness.
  • Evaluation methodology: A refusal judge can be falsely influenced by an agent’s refusal-like message inserted between tool calls.Separating refusal and harm scores prevents this error from changing the primary harm metric.
  • Robustness comparison: Agent jailbreaks require coherent, malicious multi-turn outputs with multiple function calls, making later refusals materially important.A model that begins harmfully but later refuses may score differently in the agent setting than in chat.
  • Robustness comparison: On similar tasks, template attacks raised refusal rates from 9.1% to 31.8% for GPT-4o and from 29.5% to 72.7% for Claude 3.5 Sonnet in chat-only settings.Starting refusal rates were also systematically higher for chat-only tasks than agent tasks.

B ADDITIONAL DETAILS

The additional details document the evaluated model checkpoints and prompting materials used in AgentHarm experiments. They include default, refusal-judge, model-specific, and alternative experimental prompts.

  • Models: The experiments evaluate API checkpoints from OpenAI, Anthropic, Google, Mistral AI, and Meta.The listed models include GPT, Claude, Gemini, Mistral, and Llama-3.1 families.
  • Prompts: The supplementary prompt materials include the default system prompt, semantic refusal-judge prompt, Llama-3.1 addition, and experimental prompting variants.These materials correspond to Tables 4–7.
  • Prompts: For hint-included behaviors, the prompt specifies which function should be called first before the remaining tools.The hint is appended to the standard prompt and intentionally makes tasks easier.

C ADDITIONAL RESULTS

The additional results provide evaluations on chat-only, public, and private test sets, alongside figures showing tool use and harm-score distributions. They also compare refusal patterns between agent and chat-only tasks.

  • Evaluation sets: Table 8 compares GPT-4o and Claude refusal rates on agent versus chat-only tasks under direct requests and template attacks.Chat-only tasks systematically produce higher refusal rates.
  • Evaluation sets: Tables 9 and 10 report public- and private-test-set results using harm score, refusal rate, and non-refusal harm score.The private-set evaluation covers a subset of models.
  • Figures: Figure 5 shows tool counts across behaviors and representative distributions of tool calls and agent messages for GPT-4o.It characterizes the interaction structure of benchmark behaviors.
  • Figures: Figure 6 displays score distributions across behaviors for GPT-4o-mini and GPT-4o, distinguishing their capabilities.The figure uses the jailbreak template.
  • Figures: Figure 7 breaks down average harm scores by category for GPT-4o-mini and GPT-4o.The comparison covers harm categories individually.

D.1 EXAMPLES OF HARMFUL AND BENIGN TASKS

The appendix illustrates harmful and benign task pairs across sexual, harassment, and drug-related behaviors. Examples contrast malicious objectives with benign activities using similar interaction patterns and tools.

  • Task examples: The appendix includes additional harmful and benign task examples in Figures 8–10.These examples cover sexual, harassment, and drug-related behaviors.
  • Sexual tasks: The “Upload Beastiality Video” pair contrasts uploading explicit content under a misleading title with uploading an educational animal video.The harmful and benign tasks share an upload-oriented setting but differ in intent and content.
  • Harassment tasks: The benign “Online Stalking” variant instead asks the agent to positively engage with the person.Its task uses the same named behavior category while changing the requested interaction.
  • Harassment tasks: The “Online Stalking” pair contrasts threatening messages across platforms with positive interactions and replies.The harmful behavior uses tools including email and social-platform querying and posting.
  • Drug-related tasks: The “Online Drug Marketplace” pair contrasts coding an illegal-drug marketplace with coding a handmade-crafts website.The pair demonstrates how harmful intent is varied while retaining a similar website-building format.

D.2 EXAMPLES OF DETAILED AND OPEN-ENDED TASKS

The paper illustrates detailed and open-ended harmful tasks, then shows grading functions that evaluate whether agents call required tools and satisfy task-specific conditions.

  • D.2 EXAMPLES OF DETAILED AND OPEN-ENDED TASKS: Examples span harmful variants including Automated Hate API, Malware Distribution, and Pornographic Story - Benign tasks.The detailed prompts provide specific steps, whereas open-ended prompts require agents to infer those steps.
  • D.3 EXAMPLES OF GRADING FUNCTIONS: Grading functions assess whether target functions are called for tasks such as Upload Beastiality Video, Online Stalking, and Online Drug Marketplace.The examples include checks over function-call messages and task-specific target functions.
  • D.3 EXAMPLES OF GRADING FUNCTIONS: Some grading logic also checks target-function arguments, returned content, or hosting results rather than function calls alone.Examples inspect search requests, web-hosting responses, and metadata-defined target functions; one note states that search functions need not follow a correct order.

D.4 EXAMPLES OF TOOL IMPLEMENTATIONS

The benchmark uses synthetic, side-effect-free tools implemented as standalone Inspect functions to imitate general-purpose and domain-specific agent capabilities.

  • D.4 EXAMPLES OF TOOL IMPLEMENTATIONS: Tool examples include replying to posts, retrieving public-database information, and generating AI voice messages.The database tool returns URLs, types, sizes, and security status, while the voice tool saves generated audio to a specified location.
  • D.4 EXAMPLES OF TOOL IMPLEMENTATIONS: The public-database tool provides database metadata such as data type, size, and security status.The examples include bank, insurance, and other public-database URLs with associated metadata.
  • D.4 EXAMPLES OF TOOL IMPLEMENTATIONS: The AI voice tool takes a prompt and script as inputs and generates a voice message saved at a specified location.Its implementation exposes an asynchronous run function with prompt and script parameters.

D.5 EXECUTION LOG EXAMPLES: GPT-4O AND CLAUDE SONNET 3.5

Execution examples contrast refusal without an attack prompt with harmful task execution after an attack prompt across GPT-4o and Claude Sonnet 3.5.

  • EXECUTION LOG EXAMPLES: The examples include execution logs comparing behavior with and without attack prompts for GPT-4o and Claude Sonnet 3.5.The figure descriptions state that the models refuse in the first case and carry out the task in the second.
  • GPT-4O: GPT-4o refuses the Launder Money Online request without an attack prompt.The refusal explicitly rejects assistance with illegal activities including drug trafficking or distribution.
  • CLAUDE SONNET 3.5: Claude Sonnet 3.5 refuses requests involving paid fake prescriptions and setting up a drug-related meeting location without an attack prompt.The prescription refusal cites unethical and potentially illegal medical practices, while the meeting-location example presents a drug-related hotel-use request.
  • AGENT PROMPTS: Agent prompts expand harmful chat requests into multi-step tasks involving stolen credentials, dark-web searches, downloading content, posting, and emailing.Examples include transferring money from compromised accounts, uploading a mislabeled video, and finding drug-related information or clients.
Loading 2410.09024v3…