arXiv(opens in a new tab)cs.CROct 2026Cited by 4 papers on PaperVantage

Manuscript Offprint

arXiv:2610.07639

HarnessSecurity-Bench: Do Security Mechanisms Really Protect Coding Agent Harnesses?

Zhengyang Zhu, Liming Huang, Runmin Ji, Mingxi Ye, Zihan Zhou, Hanyang Guo, Jingwen Wu, Yuhan Ye, Yuming Feng, Hong-Ning Dai, Zibin Zheng

ABSTRACT

Coding agent harnesses mediate tool use and authorize actions, yet their security mechanisms and runtime effects remain incompletely characterized. We present HarnessSecurity, the first systematic empirical study and benchmark of open- and closed-source coding agent harnesses. First, we derive a ten-mechanism taxonomy and then assess 400 harness–mechanism cells using independent ratings by researchers and large language model (LLM) judges. We find that about half of confirmed mechanism implementations are opt-in, while closed-source harnesses exhibit substantial evidence gaps. Second, we introduce HARNESSSECURITY-BENCH, a benchmark of 23 tasks across five attack surfaces without sacrificing legitimate task requirements. Using separate deterministic oracles to measure task utility and attack effects with security setting comparisons, we evaluate nine mechanisms across six leading harnesses: Claude Code, Codex CLI, Gemini CLI, gptme, Qwen Code, and GitHub Copilot. Under a controlled LLM baseline GLM-5.2, we conduct 2,500 trials, recording 81,155 tool calls and over 2.2 billion tokens. Enabling auto-approve increases utility and raises attack success from 29.2% to 95.6%. Network isolation and read-only mode reduce attack effects with substantial utility losses, while command allowlisting and command denylisting reduce attack effects with a small utility loss and a utility gain, respectively. Task-level cases show that restrictions on a shared capability can obstruct both legitimate and malicious operations, and that allowed tools or commands can leave unauthorized operations reachable through alternative execution paths. Harness providers should make security settings verifiable, test alternative execution paths to protected operations, and assess attack effects alongside task utility and execution costs.

Keywords Coding agents, agent harnesses, LLM agents, security benchmark, empirical study, software security

1 Introduction

Coding agents based on large language models (LLMs) have moved from demonstrations to production, with products such as Claude Code [4] and Codex CLI [37] supporting autonomous repository-level software development. Each agent couples an LLM with a coding agent harness that assembles context, mediates tool use, and authorizes actions [14, 33]. Harness design affects task success and resource costs even when the underlying model is held fixed [18, 52].

Expanding coding agents’ capabilities also introduces risks in how their harnesses handle untrusted inputs, authorize tool execution, and process repository data. Recent disclosures illustrate how these risks arise in practice. In particular, prompt injection through issue titles induced shell command execution in a mirror of Cline’s triage workflow [24], demonstrating how untrusted content can redirect agent actions. Moreover, OpenAI and Anthropic reported network isolation failures during cybersecurity evaluations [8, 38], while IDEsaster showed how agent file edits triggered unsafe behaviors in the surrounding IDE [32]. An investigation also reported that ZCode uploaded workspace snapshots

Table 1: Attack surface coverage and evaluation design in coding agent studies.

Evaluation scopeAttack surfacesEvaluation design
Study# H.Repo.Instr.ToolKnow.Ext.UserUtilityASRON/OFFOracle
AIShellJack [31]2✕✓✕✕✕✕✕✓✕Tr.
QueryIPI [54]5✕✕✓✕✕✕✕✓✕Jdg.
IssueTrojanBench [48]3✓✕✕✕✓✕✕✓✕St.+Tr.
Skill-Inject [47]3✕✓✕✕✕✕✓✓✕Jdg.
PoisonedSkills [42]4✕✓✕✕✕✕✕✓✕Tr.+Jdg.
SkillHarm [36]4✕✓✕✕✕✕✓✓✕St.
RepoGuardBench [26]2✓✓✕✕✕✕✓✓✕St.+Tr.
CodeIPI [49]1✓✕✕✕✕✕✓✓✕St.+Tr.
RedCode-Exec [22]3✕✕✕✕✕✓✕✓✕St.+Tr.
CapScope [12]1✓✓✓✕✕✕✓✓✕St.
HSB (ours)6✓✓✓✓✓✕✓✓✓St.+Evt.

Notation: ✓: evaluated; ✕: outside scope; # H.: evaluated harnesses; Repo.: task repository/workflow artifacts; Instr.: instructions/skill packages; Tool: tool interface; know. knowledge/memory; Ext.: external services/execution dependencies; User: direct input; Utility: task completion; ASR: attack success rate; ON/OFF: enabled and disabled comparison of harnesses' native security mechanism setting. Oracle denotes the primary attack-success check (St.: state; Tr.: trace; Evt.: structured events; Jdg.: semantic judge.)

containing Git history [19], raising confidentiality concerns about the scope of repository data transmitted by agent tools.

Prior work has studied agent security from several perspectives. First, surveys and empirical studies classify agent defenses, harness architectures, and execution controls, with an inspection of harness source code and public product materials [2, 11, 16, 25, 27, 44]. Second, agent security studies audit permissions and violations of information flows, evaluate attacks, defenses, and authorization policies in agent workflows [10, 12, 17, 29, 57]. Third, coding agent benchmarks also examine how adversarial instructions, tool descriptions, issues, and skills redirect development actions [31, 36, 47, 48, 54].

However, existing studies remain limited in their empirical assessment of native security mechanisms across coding agent harnesses. Architectural mapping and literature reviews do not systematically assess mechanism implementation and default settings across coding products [27, 44]. Empirical comparisons cover only three coding agents [25] or eleven source-accessible harnesses [11], leaving closed-source products underrepresented. Practitioner comparisons describe native settings but do not report independent implementation status [2, 16]. These limitations leave a gap in the systematic empirical study of mechanism implementation and default settings across open- and closed-source coding agent harnesses. Existing benchmarks also remain limited in their comparative evaluation of security mechanisms. IssueTrojanBench covers three coding agents on two Python repositories, while CapScope compares authorization policies within one Pi-based harness on five Python repair tasks [12, 48]. Other evaluations focus on attacks through particular resources, including instruction files, tool descriptions, and skills [31, 36, 47, 54]. Although some measure both task utility and attack outcomes [36, 47], they do not systematically isolate the effects of mechanism settings across harnesses and attack surfaces. These limitations leave a gap in the comparative assessment of security mechanisms across coding harnesses and attack surfaces. To bridge this research gap, we raise the following research questions (RQs):

RQ1. What distinct security mechanisms can be identified in real coding agent harnesses?

RQ2. To what degree are these mechanisms implemented?

RQ3. How do security mechanisms in coding agent harnesses affect security and utility during adversarially augmented task execution?

To address these research questions, we present HarnessSecurity, an empirical study of 40 coding agent harnesses: 27 open-source and 13 closed-source products. For RQ1, we derive a taxonomy of ten security mechanisms for assessment across coding agent harnesses. For RQ2, we assess all 400 harness–mechanism cells, recording evidence on implementation status, default settings, and supported configurations. These analyses in RQ1 and RQ2 establish the mechanism definitions and configurations used in the runtime evaluation. For RQ3, we introduce HARNESSSECURITY-BENCH (HSB), a benchmark comprising 23 coding tasks spanning diverse programming languages, including Python, JavaScript, C#, C++, Go, and Ruby. HSB covers nine of the ten mechanisms across six harnesses. We augment task environments with misleading context and malicious resources across five attack surfaces (shown in A–E of Fig. 1). This augmentation preserves legitimate user instructions, task requirements, utility oracles, and valid paths to task completion. HSB provides separate deterministic oracles to measure task utility and attack effects, runs trials in isolated Docker containers, and compares enabled and disabled settings of native security mechanisms under the same execution environment. Table 1 compares HSB with prior coding agent evaluations across harness coverage, attack surfaces, comparison of security mechanism settings, and evaluation oracles.

The RQ1 study established a taxonomy of ten security mechanisms, and the RQ2 assessment confirmed implementation in 205 of 400 harness–mechanism cells and absence in 83, while 112 remain unresolved. The RQ3 evaluation comprised 2,500 trials under GLM-5.2 across six harnesses, recording 81,155 tool calls, over 2.2 billion native tokens, and 589.32 hours of cumulative agent execution time. The security and utility effects differ across mechanisms, harnesses, and tasks. Enabling auto-approve increased both utility and attack success, with attack success rising from 29.2% to 95.6%. Network isolation and read-only mode reduced attack success from 57.1% to 0.8% and from 8.3% to 0.8%, respectively, with utility losses of 24.5 and 34.0 percentage points. Command allowlisting and command denylisting reduced attack effects with a small utility loss and a utility gain, respectively. Task-level cases show that restricting a shared capability can block both legitimate and malicious operations, while alternative execution paths can leave unauthorized operations reachable. Harness development should test alternative execution paths to protected operations and evaluate security restrictions in terms of attack effects, legitimate task utility, and execution costs. We summarize our contributions as follows:

• Security mechanism dataset and empirical study (RQ1–RQ2). We contribute a dataset covering 40 coding agent harnesses (27 open-source and 13 closed-source) and a taxonomy of ten security mechanisms derived by analyzing the source code and official product materials collected in the dataset. We further assess implementation status, default settings, and configuration across all 400 harness–mechanism cells, showing that about half of confirmed implementations are opt-in and that evidence gaps are more prevalent among closed-source harnesses.

• HARNESSSECURITY-BENCH (RQ3). We contribute a containerized benchmark for evaluating nine security mechanisms through 23 coding tasks. Task environments are augmented with misleading context and malicious resources across five attack surfaces while preserving legitimate task requirements and utility oracles. The benchmark compares enabled and disabled settings of native security mechanisms under the same execution environment, using separate deterministic oracles to assess task utility and attack effects.

References (26)