Language models show large, uneven ability to harden OS configs, often failing compliance
Current frontier language models vary widely in correctly applying STIG hardening and frequently produce non-compliant scripts
AI/ML arXiv 16 Oct 2026 Benchmark Prototype evidence
Published as “HardEval: An Execution-Verified Benchmark for AI-Driven Security Hardening and Compliance Remediation”
Why it matters
HardEval gives practitioners a concrete, execution-verified way to pick LLMs that can reliably produce scanner-approved OS hardening scripts, accelerating compliance automation in regulated environments.
Summary
Claude Opus 4.7 solves 81.0% of the combined server-safe STIG hardening tasks, the highest among the fourteen evaluated models. The benchmark, HardEval, runs LLM-generated Bash remediation scripts on a fresh RHEL-8 VM and grades them with OpenSCAP/OVAL checks, revealing large capability gaps across security domains. Evidence is strong: results are reported on a fixed 151-rule manifest with per-model pass counts, and confidence-interval analysis shows the ordering is stable. However, the paper notes that passing the scanner does not guarantee broader security and that SSH scores are lower-bound estimates.
What they found 2
- Claude Opus 4.7 achieves the highest compliance rate of 81.0% on the combined server-safe bucket.
“On the fixed cross-model manifest, Claude Opus 4.7 leads with 81.0% verified success on the combined server-safe bucket”
- Four-bit quantization of GLM-4-9B does not noticeably degrade performance.
“No detectable quantization cost for GLM-4-9B at this sample size: Under Ollama’s Q4_K_M 4-bit quantization, GLM-4-9B’s aggregate accuracy barely moves, from 13.1% to 12.4% single-run”
Caveats 5
- a script may improve security in practice while still failing the exact condition the scanner checks.
- SSH scores are conservative lower bounds because the harness grades over the same SSH channel the scripts harden, which is why that bucket is excluded from the headline metric (Section IV-E).
- all graded tasks derive from RHEL 8 under the DISA STIG profile and cover a curated, automatable subset of controls; the Ubuntu port demonstrates methodological portability, but broader generalization to RHEL 9, Windows, or other profiles is unshown.
- Ten of the fourteen configurations were scored with a single greedy run, and the variance study excludes the closed models.
- Prompts were authored by a single model (addressed by the cross-author study, Section IV-C), and training-data contamination from public STIG content cannot be ruled out.
What’s new here 4
- Evaluates LLMs on live OS hardening by executing generated Bash scripts on real VMs and grading with authoritative OpenSCAP/OVAL checks.
- Provides implementation-withheld prompts that hide exact remediation mechanisms, isolating pure code-generation capability.
- Introduces a cross-model manifest of 151 STIG rules (137 excluding SSH) for reproducible, execution-based benchmarking.
- Includes robustness checks: a cross-author prompt study and a zero-code port to Ubuntu 24.04.