Iterative LLM repair of Terraform code causes a security regression in about 3.3% of scenarios under strict counting, most often through resource restructuring, with iteration 3 as the recommended stopping point.
Using a Feedback Loop for LLM-based Infrastructure as Code Generation
1 Pith paper cite this work. Polarity classification is still indexing.
abstract
Code generation with Large Language Models (LLMs) has helped to increase software developer productivity in coding tasks, but has yet to have significant impact on the tasks of software developers that surround this code. In particular, the challenge of infrastructure management remains an open question. We investigate the ability of an LLM agent to construct infrastructure using the Infrastructure as Code (IaC) paradigm. We particularly investigate the use of a feedback loop that returns errors and warnings on the generated IaC to allow the LLM agent to improve the code. We find that, for each iteration of the loop, its effectiveness decreases exponentially until it plateaus at a certain point and becomes ineffective.
fields
cs.SE 1years
2026 1verdicts
CONDITIONAL 1representative citing papers
citing papers explorer
-
Does Fixing Break Security? An Empirical Study of Security Degradation in Iterative LLM-Driven Infrastructure-as-Code Repair
Iterative LLM repair of Terraform code causes a security regression in about 3.3% of scenarios under strict counting, most often through resource restructuring, with iteration 3 as the recommended stopping point.