DiliexPublic affairs · Policy · Society SEARCH MENU
POLICY
BRIEF
AI & ML

Infrastructure as Code Gives AI Agents a Safer Path to Kubernetes Changes

Oct 20, 2026 · 811 views

IaC makes Kubernetes and hybrid infrastructure changes reviewable, helping teams manage upgrades and drift while keeping AI agents inside human approval workflows.

Infrastructure as Code Gives AI Agents a Safer Path to Kubernetes Changes

AI agents can already create and modify cloud resources, but direct access to production accounts leaves teams with a difficult question: how can they use that speed while still understanding and approving the changes? Infrastructure as code offers a practical answer. It turns an agent’s work into proposed edits to configuration, with a preview and review step before infrastructure changes take effect.

That approach matters because infrastructure keeps changing. Kubernetes clusters need version upgrades, cloud resources drift from their declared settings, and many platforms depend on databases and other services outside the cluster. IaC helps teams manage those moving parts through versioned definitions, rather than treating provisioning as a one-time task. The approach has also been discussed as a way to close gaps in infrastructure management.

Make cluster changes reviewable

A Kubernetes cluster may change less often than the applications it hosts, but it still has a lifecycle. When a minor version leaves support, teams need to plan an upgrade; delaying it can increase cloud costs. IaC lets them express the cluster and related resources in configuration, then review the consequences of a proposed update before applying it.

With tools such as Pulumi, Terraform and OpenTofu, a cluster can be one component of a larger system definition. A version change may amount to a small edit, while the preview reveals whether the provider will update resources in place or replace them. That visibility gives platform teams a chance to assess the impact before deployment, rather than discovering it during the change.

This external management model differs from infrastructure tools built around the Kubernetes Resource Model. Crossplane, AWS Controllers for Kubernetes, Config Connector and Azure Service Operator let teams describe cloud infrastructure through Kubernetes resources, but they depend on a running cluster. External IaC tools can define the cluster itself alongside the workloads and services that rely on it.

That distinction is useful when teams need to stand up a cluster in another region, deployment stage or cloud provider. They can adjust the configuration that defines the infrastructure while retaining Kubernetes objects that don’t depend on a particular provider. The result is a route to reuse without rewriting every application resource for each environment.

Bring infrastructure beyond the cluster into the same plan

Most Kubernetes environments rely on resources that aren’t Kubernetes objects. An external database is a straightforward example: workloads may depend on it, but a chart manager can’t necessarily model or wait for it as part of the same deployment. Helm orders a chart’s manifests by resource kind, rather than by dependencies that cross that boundary.

IaC can describe the database and the cluster in one system, making dependencies explicit. That’s useful for platform teams managing hybrid environments, where some services run in Kubernetes and others remain external. It also gives application teams a consistent way to consume infrastructure without requiring every team to write low-level YAML. Platform engineers can package scoped components as typed libraries, setting boundaries around what application teams can configure.

Drift management is another point where tools make different choices. A Kubernetes control plane can automatically reconcile a resource when its live state diverges from the declared state. IaC workflows typically show the proposed correction and wait for approval before applying it; automatic correction can be enabled as a separate setting. Teams can choose a review process that fits the consequences of a change.

Give agents a proposal workflow

Agents can call cloud APIs directly, but their output isn’t deterministic by default. Granting an agent broad account access can make it hard to track what changed, why it changed or whether the action matched the team’s intent. That opacity becomes harder to accept as systems grow and changes affect more services.

When an agent works on an IaC program or stack configuration, its output becomes a code change that teams can inspect. A preview lays out the resources that would be created, updated or replaced. Reviewers can compare that plan with the requested work, then approve it before deployment. The agent handles the drafting and analysis; established human review remains part of the release path.

This doesn’t make every proposed change safe automatically. It gives teams a legible artifact to evaluate and a defined point at which to catch errors. The same workflow can also help explain existing configuration, identify likely consequences and prepare routine updates, while keeping the final infrastructure action tied to an approved plan.

Adopt IaC in stages

Most organizations already have infrastructure they didn’t create from a single IaC program. Requiring a clean start would make adoption impractical. Instead, teams can bring existing resources under code gradually, maintaining visibility over the resources that remain outside the new workflow.

IaC tools can import current cloud resources into a program. A preview with no planned changes then provides evidence that the code describes the live environment. From there, teams can take on additional resources in manageable steps, including the cluster itself when moving from older infrastructure. The declared state also gives agents a clearer basis for proposing edits during migration work.

Teams with established GitOps practices can keep that operating model. An operator can run IaC programs inside a cluster, with a Kubernetes object pointing to a Git branch as the source of configuration. Kubernetes resources continue to be managed through the existing process, while the operator applies the infrastructure program those resources describe.

Use automation where teams can see its effects

The practical case for IaC is broader than creating cloud resources. It gives teams a shared way to track infrastructure changes, account for dependencies across cluster boundaries and plan upgrades with a preview. For agentic development, the key benefit is that an agent’s work can be reviewed as a proposed change before it reaches the cloud.

Teams don’t need to move every resource at once to gain that control. They can start with an upgrade, a new environment or a service that sits outside Kubernetes, then expand the program as they learn where review and automation help most. As agents take on more infrastructure work, the organizations best placed to use them will be those that can inspect and approve each change with confidence.

Source: Guinevere Saenger · cloudnativenow.com

Discussion

Sign in to join the discussion.