Manuscript Offprint

arXiv:2610.23685

HardEval: An Execution-Verified Benchmark for AI-Driven Security Hardening and Compliance Remediation

Manohar Vellala, Soumya Banerjee, Sandip Roy, Ross Gore, Sachin Shetty

Manohar Vellala*†, Soumya Banerjee*‡, Sandip Roy‡, Ross Gore‡, Sachin Shetty*

*Center for Secure & Intelligent Critical Systems, †Department of Computer Science, ‡School of Cybersecurity

Old Dominion University, Virginia, USA

{mvell001, s1banerj, sroy, rgore, sshetty}@odu.edu

Abstract—Implementing Security Technical Implementation Guide (STIG) controls remains a demanding operating-system administration task. Each natural-language security requirement must be translated into a precise and persistent configuration change. These changes span Secure Shell (SSH) configuration, authentication policy, audit rules, and kernel parameters. Existing benchmarks do not measure whether a model can perform this task on a live system. Code benchmarks evaluate isolated programs without persistent system state, while agent benchmarks largely focus on applications rather than operating-system configuration. In this paper, we introduce HardEval, an execution-verified benchmark for evaluating language-model-assisted security hardening. HardEval is built from Red Hat Enterprise Linux 8 STIG controls that fail on an unhardened baseline system. Expert-written reference remediations and Open Vulnerability and Assessment Language (OVAL) checks serve as hidden ground truth for grading; they are never shown to the model, and each task states only the required security outcome while withholding the implementation. The model produces a Bash script, which is executed on a live virtual machine and graded from fail to pass using the corresponding OpenSCAP/OVAL compliance check. Evaluation of fourteen frontier and open-weight configurations reveals large and uneven capability differences across security domains. A recurring failure mode is plausible security code that does not satisfy the exact compliance condition. For four open-weight configurations, multi-run Wilson confidence intervals preserve the observed ordering. HardEval is publicly available.

Index Terms—STIG compliance, OS hardening, LLM evaluation, Security benchmarking, Automated compliance, Gen-AI for cybersecurity.

I. INTRODUCTION

Operating-system misconfigurations remain a persistent source of cyber risk. In Department of Defense (DoD) and regulated enterprise environments, this risk is managed through hardening frameworks such as the Defense Information Systems Agency (DISA) Security Technical Implementation Guides (STIGs). In practice, STIG compliance requires administrators to translate hundreds of natural-language security requirements into precise, durable configuration changes spanning kernel parameters, authentication policy, audit rules, SSH, services, package state, and reboot-persistent system state. Tools such as OpenSCAP, ComplianceAsCode, Ansible Lockdown, and commercial products can automate scanning and apply pre-authored remediations, but they remain constrained by static rule content and manually maintained corrective actions. When no suitable fix exists, when configurations deviate from expected templates, or when policy guidance evolves, the burden falls back to human analysts and administrators.

Large language models (LLMs) suggest a more adaptive alternative to static remediation playbooks: instead of selecting from prewritten remediations, a model may generate remediation code directly from a natural-language security requirement. However, end-to-end remediation systems can conflate model capability with retrieval context, post-processing, and orchestration. HardEval instead isolates the underlying code-generation capability: whether a model can produce security-hardening code that makes a live operating system compliant in the exact way an external scanner verifies. An isolated measurement also serves model selection: before investing in fine-tuning or retrieval pipelines, practitioners, especially those who must self-host, need a way to identify which base model can already bring a system to scanner-verified compliance.

Existing evaluation suites are poorly matched to this question: execution-based code benchmarks score isolated snippets with no persistent system state, repository- and agent-grounded benchmarks target application code rather than OS configuration, and security-oriented evaluations leave OS hardening unmeasured; even the most closely related system, SHIELDS [1], evaluates an end-to-end remediation loop rather than isolating the code-generation capability it requires (Section II).

This paper addresses that gap with HardEval, a functionally verified benchmark for LLM-generated Linux security-hardening code on the RHEL 8 family. HardEval is built from failed, automatable DISA STIG controls and expert-maintained ComplianceAsCode security content, including authoritative OVAL checks and reference remediation logic. Each task is presented to the model as an implementation-withheld natural-language security requirement that states the hardening objective and rationale while withholding the exact mechanism. The model must generate a Bash remediation script, which is then executed on a fresh RHEL-compatible virtual machine and scored by re-running the corresponding OpenSCAP/OVAL rule. A task is counted as solved only if the rule transitions from fail to pass. This target, compliance-

The HardEval benchmark, source code, model predictions, and per-rule results are publicly available at https://github.com/manoharvellala/Hardeval.

Figure

Fig. 1: HardEval system overview. Stage 1 turns each rule failing an OpenSCAP scan of an unhardened RHEL-8 host into an implementation-withheld task plus a hidden answer key (reference remediation and OVAL check identifier). Stage 2 gives the model only the prompt, and Stage 3 executes the returned Bash script on a throwaway VM and re-runs the same OVAL check: a task is solved iff the rule flips from fail to pass.

oracle satisfaction, is deliberately narrower than security in the broad sense (Section III-C);

Fig. 1 summarizes the end-to-end design.

On the fixed cross-model manifest, the strongest configuration, Claude Opus 4.7, achieves 111/137 (81.0%) on the combined server-safe bucket, with Claude Opus 4.8 at 106/137 (77.4%). Failures are rarely shell-syntax errors; the recurring patterns are scanner-specific value or mechanism mismatches. This result points to a key distinction between plausible security code and verifiable compliance: a script may improve security in practice while still failing the exact condition the scanner checks.

The contributions of this paper are as follows:

• We formalize a new evaluation problem, whether LLMs can generate remediation code that brings live operating systems into compliance under authoritative OpenSCAP/OVAL checks, and introduce HardEval, a reusable execution-based benchmark built from DISA STIG failures and ComplianceAsCode content, with implementation-withheld prompts and fail-to-pass grading on throwaway virtual machines.

• We provide a baseline study spanning fourteen model configurations, from frontier closed models to 4-bit quantized open weights, showing that frontier models solve many hardening tasks but fail on scanner-sensitive details invisible to text-based evaluation.

• We validate the benchmark’s robustness with a cross-author study (GPT-4o re-authoring the prompts) and a zero-code port to Ubuntu 24.04, showing that the model ordering is stable across prompt authors and that the construction pipeline is not tied to a single operating system.

References (14)