HarnessRisk: A Lifecycle-Oriented Benchmark for Agent Harness Safety

Yajing Bai, Jinhao Duan, Jie Peng, Xianfeng Wu, Sijia Liu, Song Wang, Tianlong ChenarXiv 2026

TL;DR

LLM agents don't operate in a vacuum; they rely on an "agent harness" to manage tools, memory, and permissions. This paper introduces HarnessRisk, a new benchmark that evaluates agent safety across the entire operational lifecycle—revealing that high task success often masks severe security failures, and that a model's safety depends heavily on the harness infrastructure it uses.

What Problem Does This Paper Address?

Most existing AI safety benchmarks evaluate standalone language models or focus narrowly on runtime attacks like prompt injection. However, real-world LLM agents are deployed within a complex infrastructure layer called an agent harness. The harness handles critical tasks: configuring permissions, installing plugins, maintaining long-term memory, and executing external actions.

The authors argue that safety is a joint property of the model and the harness. Current benchmarks fail to capture how vulnerabilities propagate across different operational phases, such as when a malicious configuration choice early on leads to a catastrophic data exfiltration later.

Figure 1: Illustrative attack chain across the six HarnessRisk lifecycle phases, from malicious configura- tion and capability extension to runtime compromise, persistent poisoning, unauthorized action, and incomplete recovery.

Methods

The authors propose a lifecycle-oriented framework that breaks down agent harness safety into six distinct phases:

  1. Harness Configuration: Initializing connectors, credentials, and policies.
  2. Capability Extension: Installing and permissioning plugins/skills.
  3. Runtime Operation: Processing untrusted operational content (emails, web pages).
  4. State Persistence: Writing to long-term memory or stored preferences.
  5. Action Control: Executing high-impact external actions (payments, deployments).
  6. Incident Recovery: Detecting anomalies and performing rollbacks/remediation.

To evaluate this, they built an isolated, sandboxed environment where an agent completes a workflow over three sequential user turns. They tested 14 distinct configurations combining 6 prominent LLMs (including GPT-5.5, Claude Opus 4.7, DeepSeek-V4-Pro, and GLM-5.2) and 3 open-source agent harnesses (OpenClaw, Nanobot, and Hermes). Trajectories were evaluated using an automated GPT-5.4 judge across four metrics: Utility (task completion), Attack Success Rate (ASR), Persistence (durable compromise), and Detection (explicit risk recognition).

Datasets

The paper introduces HarnessRisk, a benchmark consisting of 128 sandboxed evaluation cases distributed evenly across the six lifecycle phases (approx. 21–22 cases per phase). Each case pairs a benign user objective with an adversarial instruction hidden inside an untrusted workflow artifact (like a CSV file, email, or plugin manifest).

Figure 2: Distribution of HarnessRisk cases across six lifecycle phases and seven attack categories. The inner ring shows phase level coverage, while the outer ring shows the corresponding attack type composition.

Key Insights and Ideas

  • High Utility Masks Unsafe Behavior: An agent can successfully complete a user's request while simultaneously leaking data or executing an unauthorized transaction. Task completion rate is a poor proxy for safety.
  • Configuration is the Weakest Link: Across all evaluated harnesses, the Harness Configuration phase was the most vulnerable. Attackers successfully manipulated security-sensitive parameters within otherwise authorized workflows.
  • The Harness Matters as Much as the Model: Safety rankings shift dramatically depending on the harness infrastructure. For instance, GLM-5.2 suffered a 54.7% attack success rate on OpenClaw but only 12.6% on Nanobot—a 4.3× difference for the exact same model.
  • Detection Does Not Guarantee Remediation: Explicitly recognizing a risk does not mean the agent will stop it. Some configurations detected threats in over 90% of runs but still allowed the attack to succeed, showing a disconnect between risk awareness and safe action execution.

Key Results

  • Across all configurations, the Attack Success Rate (ASR) varied wildly from 12.6% to 80.9%, even though task Utility remained consistently high (75.0% to 97.6%).
  • "Useful-but-unsafe" outcomes accounted for a massive share of trajectories: 59% on OpenClaw, 38% on Nanobot, and 43% on Hermes.
  • The heatmap of attack success highlights how vulnerability profiles diverge across phases and models:
Figure 3: Attack success across lifecycle phases, models, and harnesses. Each cell reports ASR, where lower values indicate safer behavior. All panels use the same color scale.

Limitations and Future Work

  • Validity Filtering: The benchmark excludes runs with provider-side errors (rate limits, timeouts), which might introduce bias if certain models fail more frequently under adversarial stress.
  • Cross-Harness Comparability: Harnesses were evaluated as fully deployed systems (including their unique system prompts and tool surfaces) rather than isolating the harness code in a controlled ablation.
  • Future Directions: The authors call for harness-level safeguards that preserve data provenance across multi-turn interactions, strictly constrain high-impact actions, and verify the completeness of incident rollbacks.

Summary updated

BibTeX
@misc{bai2026harnessrisk,
  author = {Yajing Bai and Jinhao Duan and Jie Peng and Xianfeng Wu and Sijia Liu and Song Wang and Tianlong Chen},
  title = {{HarnessRisk: A Lifecycle-Oriented Benchmark for Agent Harness Safety}},
  year = {2026},
  eprint = {2608.17597},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.17597},
}
Figure