AI agents are increasingly used to generate Infrastructure as Code (IaC), allowing for rapid cloud environment configuration. However, these tools often bypass established API contracts and architectural standards, leading to fragmented and difficult-to-maintain codebases.
A common issue is the excessive use of local values in Terraform. Agents often create parallel configuration paths instead of extending existing modules, which complicates infrastructure management and breaks the consistency of input variables and resource definitions.
Research highlights significant gaps in AI-generated IaC. In the IaC-Eval benchmark (NeurIPS 2024), over 50% of technically valid results failed to meet user requirements. Studies from MERL show that even with feedback loops, scripts often contain 5–15 security policy violations.
Real-world incidents demonstrate the risks of automated infrastructure management. In March 2026, an agent using Claude Code deleted production infrastructure for DataTalks.Club, resulting in a day-long recovery process. In December 2025, an agent named Kiro caused a 13-hour service outage for an AWS cost-estimation tool.






