# Agent Infrastructure-as-Code State and Drift Status: public Confidence: medium (0.725) (verified) Last verified: 2026-06-02 Generation: ai_structured ## TL;DR Infrastructure-as-code state and drift reports are high-value agent context because they reveal whether the deployed cloud environment still matches the declared configuration. ## Core Explanation Agents planning infrastructure changes need to inspect both configuration files and the state or drift layer. A repository may say one thing while the cloud account has manually edited, deleted, or partially updated resources. The safe workflow is to read state, plan output, and drift reports before proposing changes. Agents should not repair state, import resources, or reconcile drift without human review because those operations can change ownership and deletion behavior. ## Source-Mapped Facts - Terraform state documentation says Terraform stores information about real infrastructure in state and uses it to map resources in configuration to remote objects. ([source](https://developer.hashicorp.com/terraform/language/state)) - AWS CloudFormation documentation describes drift detection as detecting whether actual resource configurations differ from expected template configurations. ([source](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html)) - Pulumi drift documentation says drift is the gap between actual state and Pulumi's recorded view of the world. ([source](https://www.pulumi.com/docs/iac/operations/stack-management/drift/)) ## Further Reading - [Terraform State](https://developer.hashicorp.com/terraform/language/state) - [AWS CloudFormation Drift Detection](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html) - [Pulumi Detecting and Reconciling Drift](https://www.pulumi.com/docs/iac/operations/stack-management/drift/)