Josh Fruhlinger
Contributing Writer

Rewriting infrastructure as code for the AI data center

feature
Jun 30, 202512 mins
Developer

Generative AI is becoming a standard part of IaC workflows โ€” bringing speed, structure, and new risks.

visualization of big data digital data streams in the data center. The concept of big data information technology.
Credit: Timofeev Vladimir / Shutterstock

Generative AI has officially entered the infrastructure as code (IaC) trenches. What started as a bottom-up phenomenon โ€” developers using ChatGPT and Copilot to avoid Googling Terraform syntax or getting bogged down in endless StackExchange threads โ€” has grown into something more complex and widespread. Today, organizations are embracing AI as a tool not just for writing configs, but for shaping infrastructure decisions, integrating with observability, and even catching deployment errors.ย ย 

But the story isnโ€™t just one of acceleration. As AI-generated IaC becomes more common as part of the AI data center, so do the pitfalls โ€” from silent misconfigurations to public-facing APIs no one meant to expose.ย 

Rise of the machinesย 

Letโ€™s start with what you can probably guess: Developers have been using generative AI tools to write IaC config code for some time now. In many places, especially early on, this was a bottom-up movement driven individual developers. โ€œA lot of developers I know, especially those who arenโ€™t IaC experts, are leaning on ChatGPT or Copilot to generate Terraform or Ansible configs,โ€ says Siri Varma Vegiraju, Security Tech Lead at Microsoft. โ€œItโ€™s fast, and it helps people avoid looking up every AWS resource syntax or module.โ€ย ย 

That speed and accessibility come from the way AI has lowered the bar to writing configuration code. Ivan Novikov, CEO of Wallarm, puts it this way: โ€œAI reduces the threshold for devs to write configs without deep knowledge. Before AI, writing production-ready Kubernetes or Terraform config was for SREs, DevOps, infra teams. Now, any backend dev can open ChatGPT and ask โ€˜make me a Helm chart for my API with autoscaling and ingress.โ€™ And AI will do it.โ€ย 

This democratization of IaC also means that a lot of experimentation happens without much oversight. โ€œMany developers quietly use ChatGPT/Copilot to draft IaC templates, especially for unfamiliar cloud services,โ€ says Fergal Glynn, chief marketing officer and AI security advocate of Mindgard. โ€œWhile this speeds up tasks, unreviewed AI code risks security gaps (e.g., overly permissive rules).โ€ย 

โ€œIn many companies,โ€ Milankumar Rana says, software engineer advisor and senior cloud engineer at FedEx, โ€œsuch usage began informally โ€” engineers โ€˜on the slyโ€™ asking ChatGPT how to create a resource block or fix an obscure provider error. However, we are now observing a more structured approach to adoption.โ€ย 

That shift is being driven by larger organizations that see potential in AI-assisted IaC but want it embedded within guardrails. As Glynn puts it, โ€œLarger orgs use AI-augmented platforms (e.g., Torqueโ€™s Environment-as-Code) with guardrails to prevent errors. Startups and devops teams often experiment first, while enterprises prioritize governance frameworks.โ€ย 

When enterprises get on board with AIย 

As the use of generative AI expands in infrastructure engineering, many organizations are responding by developing internal tools to guide and govern that usage. Nimisha Mehta, Senior DevOps Engineer at Confluent, notes that โ€œAI-forward tech organizations adopt various tools such as IDEs with AI plugins, and even invest time and money into building bespoke systems and tools to integrate LLMs with their specific environments.โ€ย 

One increasingly common approach is to create internal AI โ€œplaygrounds โ€โ€” sandbox environments that allow teams to test configurations without risking production infrastructure. โ€œSandboxes allow developers to experiment with IaC templates, validate outputs to catch errors before deployment,โ€ says Mindgardโ€™s Glynn. โ€œBy balancing innovations with oversight, these playgrounds can minimize risks, such as security gaps, while encouraging controlled adoption of AI infrastructure-as-code workflows.โ€ย 

Sometimes, organizations are driven to develop such internal tools specifically in response to chaotic early AI-generated IaC efforts. Ori Yemini, CTO and co-founder of ControlMonkey, describes one such case: โ€œA customer used ChatGPT to bulk-generate Terraform files for around 80 microservices. It worked, until they realized none of the generated code adhered to their tagging policies, module conventions, or team-based permissions. Their drift detection flagged hundreds of deltas against their baseline. The code โ€˜workedโ€™ technically, but operationally it created chaos.โ€ย 

The solution? A tailored internal tool that wrapped the LLM in organizational context. โ€œThey shifted toward a controlled approach: using an internal wrapper around the LLM with prompts that inject organization-specific context, like required tags, naming conventions, and known module repositories. This drastically reduced both drift and rework,โ€ Yemini says.ย 

Promises and pitfallsย of gen AI and IaC

At its best, generative AI acts as a powerful accelerant for infrastructure work. โ€œWeโ€™re seeing a quiet but significant shift in how engineering teams approach Infrastructure as Code,โ€ says ControlMonkeyโ€™s Yemini. โ€œItโ€™s not just about writing a quick Terraform snippet anymore, itโ€™s about accelerating infrastructure decisions in environments that are growing more complex by the day.โ€ FedExโ€™s Rana echoes this, noting that โ€œwhat used to take hours of cross-referencing documentation is now often accelerated by a single well-phrased cue.โ€ He points to common use cases like creating reusable Terraform modules, converting shell scripts into Ansible playbooks, and scaffolding TypeScript for Pulumi code.ย 

The benefits go beyond code generation. AI is starting to integrate with observability systems to help manage infrastructure in real time. Microsoftโ€™s Vegiraju notes, โ€œMore advanced setups are experimenting with feeding telemetry into AI systems that can suggest or even automatically apply IaC-based fixes. For example, if a service is repeatedly scaling out due to CPU exhaustion, the AI might propose a config tweak to increase CPU limits or change autoscaling thresholds.โ€ While these are mostly proof-of-concept efforts in telemetry-heavy environments, they signal a direction where AI becomes more than just a code-writing assistant.ย 

Confluentโ€™s Mehta points to similar developments on the operational side, extolling the troubleshooting prowess of agentic AI. โ€œSay you have a network packet that flows through several layers in the networking stack, she says. โ€œAI is great at eliminating options to pinpoint the root cause of the issue.โ€ She sees this as a precursor to more autonomous, self-healing systems, though notes theyโ€™re still in early stages.ย 

But for all its promise, AI still lacks a basic quality that human engineers rely on: context. โ€œAlthough AI is great at writing IaC and YAML manifests,โ€ Mehta says, โ€œits biggest current shortfall is not having visibility on how distributed production-grade infrastructure is actually set up in the real world.โ€ Agentic tools are starting to address this by integrating more directly with infrastructure, but, she notes, โ€œthey donโ€™t scale to thousands of compute clusters.โ€ย 

Wallarmโ€™s Novikov is even more blunt: โ€œPrompts donโ€™t carry full context about your infra and settings. Your infra is big. You have dozens of services, secrets, RBAC rules, sidecars, CI/CD flows, policies, naming rules, and many things in Terraform state. AI doesnโ€™t know all that. When you ask โ€˜write config for API X,โ€™ it works in a vacuum.โ€ย 

That vacuum can result in mistakes that are difficult to spot but potentially damaging. โ€œAI-generated configs can be syntactically right but semantically wrong,โ€ says Microsoftโ€™s Vegiraju. He offers a simple example of Terraform config code written by AI based on a simple prompt:ย 

resource "azurerm_storage_account" "example" { 

  name                     = "examplestorageacct1"  

  public_network_access_enabled = true 

} 

That configuration will deploy successfully โ€” but also opens the storage account to the public internet. โ€œWithout strict network rules or identity-based access controls, this could lead to unauthorized access or data exfiltration,โ€ he says. โ€œIn over 90% of real-world scenarios, public network access should be disabled.โ€ย 

Security oversights like that are far from theoretical. โ€œConfigs often miss security best practices,โ€ says Novikov. โ€œNo rate limits, wide network exposure (0.0.0.0/0), missing resource limits, open CORS, and no auth on internal APIs.โ€ In one real-world case, a fintech developer used AI to generate ingress for an internal API. โ€œThey forgot to add IP whitelisting. The API went public, got scanned in 20 minutes, and attackers found an old debug route.โ€ย 

A cautious look ahead at AI and infrastructureย 

As generative AI becomes more embedded in infrastructure workflows, its role is evolving. โ€œOne pattern weโ€™re noticing across several mid-to-large scale orgs is this: AI is being used as a โ€˜first draft generator,โ€™ but increasingly also as a decision-support tool,โ€ says ControlMonkeyโ€™s Yemini. โ€œEngineers arenโ€™t just asking, โ€˜How do I write this AWS security group?โ€™ theyโ€™re asking, โ€˜Whatโ€™s the cleanest way to structure this VPC for future scale?โ€™โ€ He notes that these questions arenโ€™t confined to early design stages โ€”t hey come up mid-sprint, when real-world blockers hit. โ€œFrom our perspective, the most successful orgs treat generative AI like an untrained junior engineer: useful for accelerating tasks, but requiring validation, structure, and access to internal standards.โ€ย 

That need for human oversight was a recurring theme with everyone we spoke to. Microsoftโ€™s Vegiraju puts it simply: โ€œEngineers should first understand the code coming out of the LLM before using it.โ€ At Confluent, Mehta emphasizes the importance of safeguards: โ€œWe need guardrails built into the system to prevent accidental breaking changes, be it due to human error or due to AI-generated changes.โ€ She points to GitOps systems and peer-reviewed version control as ways to build accountability into the workflow.ย 

Mindgardโ€™s Glynn sees a similar pattern emerging. โ€œModels like WISDOM-ANSIBLE generate Ansible playbooks just by providing natural language prompts,โ€ he says, โ€œbut AI-generated YAML/Chef files do require manual tweaks for edge cases.โ€ Enterprises may use these tools to enforce compliance โ€” for instance, automatically adding HIPAA settings โ€” but they still review outputs for accuracy before deployment.ย 

Without that diligence, the risks can compound quickly. Wallarmโ€™s Novikov recounts a troubling trend: โ€œOne large SaaS org told us 30% of their IaC is now AI-generated. But they also see three times more config misfires in CI/CD than last yearโ€”wrong secrets, open ports, wrong S3 policies, unprotected APIs.โ€ That company now uses tools like Checkov, tfsec, and custom Wallarm rules to catch misconfigurations after the fact. But the root cause is often speed outpacing safety. โ€œOne junior dev told us: โ€˜I just paste the prompt, review the YAML looks ok, and push.โ€™ Thatโ€™s where issues sneak in.โ€ย 

The tools are getting better โ€” yet the need for caution is still there. โ€œAI is so powerful,โ€ Novikov says. โ€œBut when it comes to PaaS and APIs, itโ€™s risky if used blindly. Without proper policy checks, context awareness, and testing, AI-generated configs become new security debt.โ€ย 

โ€œYou use AI for infra?โ€ he says. โ€œCool. Just donโ€™t trust it too much.โ€ย 

Josh Fruhlinger

Josh Fruhlinger is a writer and editor who has been covering technology since the first dot-com boom. His interests include cybersecurity, programming tools and techniques, internet and open source culture, and what causes tech projects to fail. He won a 2025 AZBEE Award for a feature article on refactoring AI code and his coverage of generative AI earned him a Jesse H. Neal Award in 2024. In 2015 he published The Enthusiast, a novel about what happens when online fan communities collide with corporate marketing schemes. He lives in Los Angeles.

More from this author