Use Claude to summarize drift reports and propose repair vs. accept-state PRs.
11 min · Reviewed 2026
The premise
AI can triage drift output faster than humans, but apply decisions need policy backing.
What AI does well here
Cluster drifted resources by likely cause (manual change, vendor update).
Draft import or apply plans with rollback notes.
Generate Slack summaries for the platform team.
What AI cannot do
Know whether a manual prod change was intentional emergency work.
Authorize destructive applies on shared infrastructure.
End-of-lesson check
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-ai-coding-AI-terraform-drift-detection-creators
What does 'drift' mean when discussing Terraform infrastructure?
A security vulnerability in cloud resources
Infrastructure that has changed from what Terraform's configuration specifies
A type of Terraform provider error
The process of destroying and recreating infrastructure
An on-call engineer makes an emergency manual change to production to fix a critical outage. The next day, Terraform drift detection shows this resource as drifted. Why is it risky to let AI automatically apply the repair plan?
AI cannot connect to cloud providers to make changes
The automated repair would revert the engineer's emergency fix, potentially causing another outage
Terraform does not support automated apply operations
The emergency change was not saved in version control
Which of these tasks is AI well-suited to perform in a drift detection workflow?
Manually reviewing every line of Terraform configuration for errors
Clustering drifted resources by likely cause and drafting apply plans with rollback notes
Determining whether a manual prod change was intentional emergency work
Approving destructive changes to shared production infrastructure
What is a fundamental limitation of AI in infrastructure management?
AI cannot generate summaries of any kind
AI cannot distinguish between different cloud providers
AI cannot parse JSON output from Terraform
AI cannot know whether a manual production change was intentional emergency work
What does Terraform 'state' represent?
A backup of cloud provider credentials
A log of who ran Terraform commands
The source code files defining infrastructure
A record of what Terraform believes the current infrastructure looks like
When AI clusters drifted resources by 'likely cause,' what are two common categories it might identify?
Expired SSL certificate and missing IAM permissions
Manual change by a user and vendor update to a cloud service
Outdated documentation and untracked temporary files
Syntax error in configuration and network connectivity failure
Why is human approval required before applying a drift-repair plan to production infrastructure?
Because the repair might revert an intentional emergency change made by on-call staff
Because the cloud provider charges extra for automated changes
Because Terraform cannot run without human input
Because AI-generated plans always contain syntax errors
In Terraform, what does the 'import' operation accomplish?
Bringing an existing resource under Terraform's management without recreating it
Transferring ownership of cloud resources between accounts
Copying configuration between workspaces
Moving Terraform state files to a new directory
What information should be included in a draft apply plan generated by AI for drift repair?
A complete history of every Terraform run ever performed
The personal email addresses of all engineers who touched the resources
Rollback notes explaining how to revert the changes if needed
A list of all unused Terraform modules in the repository
Why should AI never be allowed to authorize destructive applies on shared infrastructure?
Because shared infrastructure doesn't support Terraform
Because Terraform blocks all destructive operations by default
Because AI lacks context about other teams' work and could cause widespread outages
Because authorization requires a specific database role that AI cannot obtain
What is 'IaC' an abbreviation for?
Intelligent and Computing
Internal Audit Console
Infrastructure as Code
Instance Allocation Controller
How can AI help platform teams when drift is detected?
By automatically deploying changes to production without notification
By billing the team for the compute time used
By generating Slack summaries that explain what drifted and suggest actions
By rewriting the team's Terraform configuration files
What could happen if an AI is allowed to auto-apply drift repairs without any human oversight?
Terraform would refuse to work with the AI
Intentional manual changes could be accidentally reverted, causing outages
The drift detection would stop working entirely
The AI might become too expensive to run
What is the purpose of 'rollback notes' in a Terraform apply plan?
To document how to undo the changes if they cause problems
To list all previous owners of the resources
To provide legal justification for the changes
To track how long the apply took to complete
What does 'state reconciliation' refer to in infrastructure management?
The process of aligning Terraform's state with the actual state of infrastructure
Reconciling billing statements from cloud providers