MetaVul: Agentic Harness Discovery for Vulnerability Detection
On the map: LLM agents and tool use → Agent threats, guardrails and governance also fits: Software engineering coding agents
Abstract (arXiv)
LLM agents are increasingly used to automate vulnerability detection, but reliable detection is challenging because agents must distinguish subtle, security-relevant fixes from benign code variation. While underlying LLM capability has improved significantly, the accuracy of the agent still depends heavily on the harness: the code that defines the scaffolding around the LLM. Harnesses are typically fixed, and largely hand-written, limiting adaptation to evaluator feedback. Additionally, when harnesses are static, improvements on one dataset or model may not transfer to others. To address these challenges, we introduce MetaVul, a self-improving framework for harness discovery in vulnerability detection. Starting from a seed structured reasoning scaffold, MetaVul uses a workflow-based optimization loop to iteratively refine the harness using feedback from paired vulnerable and patched functions, while preserving the structured reasoning and verdict format. At each iteration, it searches over the history of prior harnesses, with access to their trajectories, logs, and metrics, and it returns a set of Pareto-optimal harnesses. We apply MetaVul to discover agent harnesses for various architectures. A validation set (202 pairs) is used for optimization, while an unseen dataset (430 pairs) is kept as the held-out set. We test whether harnesses learned from one model transfer to others not seen during optimization. Results on both frontier and small LLMs show that the optimized harnesses improve pairwise vulnerability detection up to 23.3 percentage points on the validation set and up to 25.8 points on the held-out set with a Pareto-frontier harness. Harnesses learned with one model also transfer to others. We show that harnesses optimized with one model transfer to another, improving held-out pairwise accuracy by 14.7 points without further optimization.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 22 of its 36 references that are in the map. Submitted 29 Oct 2026.
Builds on
22 of 36 references.
Closest ancestors · 2
Same direction, newest first
- 2026SecureForge: Finding and Preventing Vulnerabilities in LLM-Generated Code via Prompt Optimization8 May
- 2025Let the Trial Begin: A Mock-Court Approach to Vulnerability Detection using LLM-Based Agents16 May
Other references · 20
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,963
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,329
- 2024ORPO: Monolithic Preference Optimization without Reference Modelcited by 595
- 2026Meta-Harness: End-to-End Optimization of Model Harnessescited by 415
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 162
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 145
- 2026Rethinking the Evaluation of Harness Evolution for Agentscited by 75
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 71
- 2023Large Language Model-Powered Smart Contract Vulnerability Detection: New Perspectivescited by 50
- 2026MemoHarness: Agent Harnesses That Learn from Experiencecited by 24
- 2024An Empirical Study of Static Analysis Tools for Secure Code Reviewcited by 20
- 2026Evo-Bench: Can Language Models Improve Agent Harness?cited by 19
8 more
- 2026HarnessOpt-Bench: Evaluating LLMs at Harness Optimizationcited by 15
- 2025Out of Distribution, Out of Luck: How Well Can LLMs Trained on Vulnerability Datasets Detect Top 25 CWE Weaknesses?cited by 8
- 2026OneDayAgent: Towards a Long-Horizon Harness for Autonomous Agentscited by 5
- 2025MoT: Modularization-of-Thought Prompting for Effective Code Generationcited by 4
- 2026LLM-based Vulnerability Detection at Project Scale: An Empirical Studycited by 4
- 2026VulTriage: Triple-Path Context Augmentation for LLM-Based Vulnerability Detectioncited by 3
- 2026StarHarness: Evolving Harnesses with Stratified Search for Enterprise Environmentscited by 3
- 2026An Empirical Analysis of CodeQL False Positives and Query Refinements for Java Vulnerabilitiescited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Synthesizing Multi-Agent Harnesses for Vulnerability Discovery
- 2026From Failed Trajectories to Reliable LLM Agents: Diagnosing and Repairing Harness Flaws
- 2026Self-Harness: Harnesses That Improve Themselves
- 2026AgenticVM: Agentic AI for Adaptive Software Vulnerability Management
- 2026Argus: Reorchestrating Static Analysis via a Multi-Agent Ensemble for Full-Chain Security Vulnerability Detection
- 2026HarnessRisk: A Lifecycle-Oriented Benchmark for Agent Harness Safety
- 2025VulnLLM-R: Specialized Reasoning LLM with Agent Scaffold for Vulnerability Detection
- 2026MulVul: Retrieval-augmented Multi-Agent Code Vulnerability Detection via Cross-Model Prompt Evolution