Benchmark finds valid Terraform code is not necessarily secure Terraform
A new arXiv study benchmarks seven language models on AWS Terraform generation and reports that syntactic validity and security compliance are largely separate properties, so automated scanning remains necessary.
In plain words
Infrastructure-as-Code files define cloud setups, and models can now write them automatically. The study's authors found that a model can produce Terraform that runs correctly while still failing security checks, so teams should keep automated scanners in the loop regardless of which model they use.
What was announced
Researchers behind the arXiv paper benchmarked seven models on AWS Terraform generation across 17 scenarios, using three closed LLMs (Claude Opus 4, GPT-5.4, Gemini 2.5 Pro) and four open SLMs (Qwen2.5-Coder-14B, WizardCoder-33B, CodeLlama-13B, Magicoder-S-CL-7B). They integrated Checkov and Trivy scanners into a GitLab CI/CD pipeline and tested two prompt strategies at three security levels, measured as pass@5.
The results show the two qualities diverge sharply. WizardCoder-33B produced well-formed Terraform at a 77.8% validate rate yet scored zero on Checkov compliance, while Claude Opus 4 reached 23.1% on Checkov and 92.5% on Trivy when given detailed security prompting. The authors conclude that prompt engineering alone is insufficient and that multi-tool scanning remains a necessary complement to model-assisted IaC generation for any model family or prompt strategy. All artifacts from the study are publicly available.
What it does not show
- The evidence is limited to the paper's abstract, so full methodology, per-scenario results and evaluation details cannot be verified from the supplied passages.
- The benchmark covers AWS Terraform generation only; results may not extend to other cloud providers or IaC formats.
- The reported pass rates are the authors' own measurements and have not been independently confirmed.
For security and IT teams
- Scope
- The study evaluates AWS Terraform generation specifically, with Checkov and Trivy scanning in a GitLab CI/CD pipeline, not IaC generally.
Sources
Source-support review completed 5 Dec 2026. This story was drafted with AI assistance and checked against retained source passages. Automated checking is not independent verification.
Coverage: arXiv: abstract.
Updates and corrections
No corrections so far.
First published 5 Dec 2026
New to the subject? AI from the Ground Up starts from the beginning.