TL;DR
HarnessSecurity-Bench is the first systematic study and benchmark designed to evaluate the native security mechanisms of coding agent harnesses (like GitHub Copilot and Claude Code). The study reveals a stark trade-off: while mechanisms like network isolation effectively block attacks, they often cripple the agent's ability to complete legitimate tasks, and many "guardrails" can be bypassed by clever attackers using permitted tools.
What Problem Does This Paper Address?
As LLM-based coding agents move from experimental demos to production tools, they are being granted increasing autonomy to read repositories, execute shell commands, and interact with external services. To manage the inherent risks, developers use "harnesses"—the software layer that mediates between the LLM and the operating system.
However, the security of these harnesses has remained a "black box." We don't fully understand which security mechanisms are actually implemented, whether they are enabled by default, or how they impact the agent's performance (utility) versus its vulnerability to attacks. This paper aims to move beyond evaluating just the LLM's "safety" and instead audits the entire execution environment.
Methods
The authors approached the problem in three phases:
- Taxonomy Development: They derived a ten-mechanism taxonomy (e.g., Auto-Approve, Network Isolation, Command Allowlisting) by analyzing 40 different open- and closed-source harnesses.
- Empirical Audit (RQ1-RQ2): They assessed 400 "harness-mechanism cells" using a combination of three LLM judges and two human experts. To ensure accuracy, they used an Evidence-of-Thought (EoT) method, requiring raters to cite specific code locations or documentation for every rating.
- Benchmarking (RQ3): They introduced HARNESSSECURITY-BENCH (HSB), a containerized environment featuring 23 tasks across six programming languages. They conducted 2,500 trials using a controlled LLM baseline (GLM-5.2) to isolate the effects of the harness settings themselves.
Datasets
- Harness Dataset: A collection of 40 coding agent harnesses, including 27 open-source (e.g., Aider, OpenHands) and 13 closed-source products (e.g., Cursor, Devin).
- HSB Benchmark: 23 original and adapted coding tasks. Unlike previous benchmarks that rely on LLM judges to determine success, HSB uses deterministic oracles—automated scripts that check the actual state of the file system or database—to measure both task utility and attack success.
Key Insights and Ideas
- The Opt-in Security Gap: About half of the confirmed security implementations are "opt-in," meaning they are disabled by default. Users are often unknowingly running agents in "YOLO mode."
- The "Shared Capability" Conflict: Mechanisms like Network Isolation and Read-Only mode are "blunt instruments." Because legitimate coding tasks and malicious attacks often require the same capabilities (e.g., downloading a library), blocking the capability to stop an attack often renders the agent useless for the task.
- The Interpreter Bypass: This is perhaps the most critical finding. Even if a harness blocks dangerous shell commands (like
rm -rf), an agent can often bypass this by using a permitted tool—such as a Python interpreter—to execute the same malicious logic (os.system('rm -rf')). - Transparency Issues: Closed-source harnesses exhibit significant "evidence gaps." It is often impossible for a researcher or user to verify if a claimed security feature is actually implemented or just marketing fluff.
Key Results
- Auto-Approve: Enabling "auto-approve" (skipping human-in-the-loop checks) increased task utility by 18.3 percentage points (pp) but caused the Attack Success Rate (ASR) to skyrocket from 29.2% to 95.6%.
- Network Isolation: Highly effective at reducing ASR (down by 56.3 pp), but at a massive utility cost (down 24.5 pp).
- Command Allowlisting: This emerged as a "sweet spot," reducing ASR by 48.1 pp with only a negligible 1.5 pp loss in utility.
- Command Denylisting: Interestingly, this actually led to a 5.2 pp utility gain in some cases because it prevented the agent from accidentally sabotaging its own environment during an attack.
Limitations and Future Work
- Model Specificity: The benchmark results are based on a single base LLM (GLM-5.2). Different models might interact with harness guardrails differently.
- Closed-Source Reproducibility: Evaluating GUI-based IDE extensions (like Cursor) remains difficult to automate reliably, leading to more "Unknown" ratings for those products.
- Static vs. Dynamic: The study focuses on native settings. Future work could explore "self-evolving" defenses where the harness dynamically adjusts its security posture based on the perceived risk of the current task.
The authors conclude that harness providers must move toward verifiable security settings and rigorous testing of alternative execution paths to ensure that "guardrails" aren't just speed bumps for determined attackers.
Summary updated