SpecGuardBench: Can Coding Agents Construct Reliable Validation Harnesses from Natural Language Specifications?
cs.CL, cs.SE
Submitted: 2026-10-12
Updated: 2026-10-12
Comments: Paper Under Review
Code: https://github.com/coxhin/SpecGuardBench
License: http://creativecommons.org/licenses/by/4.0/
The gist: As coding agents become more capable, tests remain the primary evidence for judging whether their code is correct.
Abstract
As coding agents become more capable, tests remain the primary evidence for judging whether their code is correct. Yet passing available tests does not establish that an implementation satisfies its natural language specification. Reliable validation requires checks that faithfully capture the specification and scenarios that thoroughly exercise the code, but current benchmarks provide limited insight into whether agents can construct such evidence themselves. We introduce SpecGuardBench, a benchmark of 291 tasks from 13 real-world repositories, covering 8 types of verification logic such as functional postconditions and interaction protocols. Given a natural language specification, repository context, and a reference implementation, an agent constructs a validation harness comprising executable checks and test scenarios. The checks should reject implementations that violate the specification while accepting those that satisfy it, and the scenarios should thoroughly exercise the code. Across four proprietary and open-weight coding agents, none constructs a harness scored as faithful on the benchmark's implementations for more than 63% of the tasks. The bottleneck lies less in exploring test scenarios than in constructing checks that faithfully reflect the specification. Specifically, the agents show a clear tendency to write checks that mirror the reference implementation rather than the specification, and therefore reject implementations that the specification permits.
Sources
- TDD-Bench Verified: Can LLMs Generate Tests for Issues Before They Get Resolved?
- CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generation
- PBT-Bench: Benchmarking AI Agents on Property-Based Testing
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering