Agent Execution Dry Runs and Plan Previews

Status: public · Confidence: medium (0.725) · Basis: verified_sources

## TL;DR

Dry runs and plan previews are essential agent guardrails because they expose intended changes before the agent mutates production infrastructure or repository state.

## Core Explanation

An agent should prefer previewable operations when planning infrastructure, deployment, or configuration changes. A plan can reveal creates, updates, deletes, replacements, and validation errors before a human approves execution.

Preview output is not a guarantee. Agents should treat dry runs as decision support, preserve the output as evidence, and still require explicit approval for destructive or privileged operations.

## Source-Mapped Facts

- Terraform plan documentation says the plan command creates an execution plan and shows changes needed to reach the desired state. ([source](https://developer.hashicorp.com/terraform/cli/commands/plan))
- Kubernetes API documentation describes dry run as a request option whose effects are not persisted. ([source](https://kubernetes.io/docs/reference/using-api/api-concepts/))
- Azure Resource Manager what-if documentation says the operation predicts how resources will change if a template is deployed. ([source](https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-what-if))

## Further Reading

- [Terraform Plan Command](https://developer.hashicorp.com/terraform/cli/commands/plan)
- [Kubernetes API Concepts](https://kubernetes.io/docs/reference/using-api/api-concepts/)
- [Azure ARM What-If](https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-what-if)