TerraRepair: A Tool-Grounded LLM Agent for Infrastructure-as-Code Repair
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Background: Infrastructure-as-Code (IaC) scanners detect cloud misconfigurations in Terraform and other IaC languages before deployment, but repairing the flagged configurations remains largely manual. Recent Large Language Model (LLM)-based repair approaches can repair some findings, but may hallucinate unsupported constructs or suppress warnings without fixing the issue. Aims: We study whether tool grounding can improve LLM-based Terraform repair, and when a finding should be escalated because the required deploymnet-specific context is not availble. Method: We present TerraRepair, a prototype of a tool-grounded LLM agent for Terraform repair with structured escalation. TerraRepair retrieves dependency context from Terraform references, consults the installed provider schema, and re-runs the scanner before returning a candidate repair. Then teh required context is absent, TerraRepair escalates instead of fabricating a plausible fix. Results: We evaluate our tool on two vulnerable-by-design Terraform repositories using two IaC security scanners, Checkov and Trivy, across AWS, Azure, and GCP. On the combined AWS benchmark, TerraRepair improves scanner-verified fix rates from 26.6% to 78.4% on Checkov and from 44.8% to 72.4% on Trivy, compared with a controlled one-shot baseline. It repairs are labelled as correct under a majority-vote protocol. Conclusions: These emerging results show that tool grounding can substantially improve scanner-verified LLM-based IaC repair on the studied benchmarks, while missing deployment-specific context remains the main knowledge boundary for full autonomy.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 9 of its 25 references that are in the map. First posted on arXiv 13 Jul 2026.
Builds on
9 of 25 references.
Closest ancestors · 1
Same direction, newest first
Other references · 8
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2023InferFix: End-to-End Program Repair with LLMscited by 114
- 2021Examining Zero-Shot Vulnerability Repair with Large Language Modelscited by 105
- 2025LLMSecConfig: An LLM-Based Approach for Fixing Software Container Misconfigurationscited by 9
- 2025Automated Cloud Infrastructure-as-Code Reconciliation with AI Agentscited by 5
- 2026TerraFormer: Automated Infrastructure-as-Code with LLMs Fine-Tuned via Policy-Guided Verifier Feedbackcited by 5
- 2022Static Analysis of Infrastructure as Code: a Surveycited by 2
- 2025InfraFix: Technology-Agnostic Repair of Infrastructure as Codecited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Verifier-First Evaluation of Agentic LLMs for Infrastructure-as-Code Generation
- 2026RIVA: Leveraging LLM Agents for Reliable Configuration Drift Detection
- 2025Multi-Agent Code-Orchestrated Generation for Reliable Infrastructure-as-Code
- 2025IaC Generation with LLMs: An Error Taxonomy and A Study on Configuration Knowledge Injection
- 2026Does Fixing Break Security? An Empirical Study of Security Degradation in Iterative LLM-Driven Infrastructure-as-Code Repair ↗
- 2026RAVEN: Agentic RAG for Automated Vulnerability Repair
- 2026AgenticRepair: Multi-Faceted Program Context Engineering for Agentic Vulnerability Repair
- 2026SWE-InfraBench: Evaluating Language Models on Cloud Infrastructure Code ↗