HARDE: Optimizing Agent Harnesses for Runtime Risk Detection and Execution Control
cs.CR, cs.CL
Submitted: 2026-09-29
Updated: 2026-09-29
License: http://creativecommons.org/licenses/by/4.0/
The gist: Large language model (LLM) agents are vulnerable to safety risks such as injected malicious instructions or misleading information, motivating runtime defenses that prevent unsafe action in execution
Terminology
Abstract
Large language model (LLM) agents are vulnerable to safety risks such as injected malicious instructions or misleading information, motivating runtime defenses that prevent unsafe action in execution across diverse risks while preserving benign-task utility. Existing system-level defenses either focus on risk detection rather than timely prevention or rely on predefined rules with limited flexibility across diverse risks. We propose a risk-aware harness that integrates LLM-based monitoring for flexible risk detection and structures monitor-guided execution around three core modules: trigger, monitor, and feedback, enabling targeted safety interventions while limiting disruption to benign task execution. To adapt the harness to different risks and deployment settings, we introduce HARDE, a two-stage harness optimization framework that first performs isolated probing of each module to derive an optimization guide, then uses this guide to iteratively optimize the harness based on safety and utility feedback. Experiments across three attack benchmarks show that HARDE improves runtime safety while preserving utility, outperforming manually designed harnesses and naive optimization baselines. Our analysis shows that effective runtime defense benefits from complementary safety mechanisms, attack-aware harness optimization, and harness designs matched to monitor capabilities. Our code is available at https://github.com/Liuz233/HARDE.
Sources
- ShieldAgent: Shielding Agents via Verifiable Safety Policy Reasoning
- Defeating Prompt Injections by Design
- Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversations
- Reliable Weak-to-Strong Monitoring of LLM Agents
- SHADE-Arena: Evaluating Sabotage and Monitoring in LLM Agents
- Meta-Harness: End-to-End Optimization of Model Harnesses
- AgentDyn: Are Your Agent Security Defenses Deployable in Real-World Dynamic Environments?
- SafeHarness: Lifecycle-Integrated Security Architecture for LLM-based Agent Deployment
- Auditing Agent Harness Safety
- SafeAgent: A Runtime Protection Architecture for Agentic Systems
- Agent Safety Alignment via Reinforcement Learning
- A Framework for Formalizing LLM Agent Security
- Agent Security Needs Redefinition through a Holistic Framework
- AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agents
- DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence
- Qwen3 Technical Report
- ReAct: Synergizing Reasoning and Acting in Language Models
- ShieldGemma: Generative AI Content Moderation Based on Gemma
- AgentAlign: Navigating Safety Alignment in the Shift from Informative to Agentic Large Language Models
- Agent-SafetyBench: Evaluating the Safety of LLM Agents
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills
- Token Composition: A Graph Based on EVM Logs