Somewhere, between the last commit and what lived in production, the truth slipped. This is Infrastructure as Code (IaC) drift. You define the state in Git; the servers and services change without it. Drift detection is the only way to see the gap before it becomes an outage or a security hole.
What is Git IaC Drift Detection?
Git IaC Drift Detection is the process of continuously comparing your actual infrastructure against the version defined in your Git repository. If the live state differs from the code, you have drift. This can happen when changes are applied manually in the cloud console, when scripts run outside CI/CD, or when automated tools modify resources without a corresponding Git change.
Why Drift Matters
Unchecked drift breaks the promise of declarative infrastructure. It erodes confidence, weakens disaster recovery, and introduces hidden attack surfaces. Troubleshooting becomes slower because developers debug the wrong state. Compliance reports become meaningless because the audited environment no longer matches the source of truth in Git.
How Drift Detection Works
A modern Git IaC Drift Detection workflow runs on a schedule or triggers from events. The system fetches the actual resource configuration from the cloud provider APIs, normalizes it, and compares it to the IaC definition stored in Git. Differences are flagged. Some platforms raise alerts in Slack, post issues back to GitHub, or even open pull requests with the detected changes so you can review, approve, or reject.