Governing Infrastructure Agents: Plan Checks and Cloud Permissions

Published Β· Updated β€’ articles
AI AgentsEnterprise AICybersecurityInfrastructure

An infrastructure agent needs limited authority at every stage, including planning. Put policy checks around proposed changes and retain the cloud provider's own authorization controls. They answer different questions.

Correction, 22 October 2026: The earlier article said Terraform governance runs before any cloud API call and described IAM as enforcing permissions only after execution begins. It also overstated automatic credential revocation and an agent's inability to modify controls. Unverified vendor funding comparisons and claims of industry consensus have been removed.

Planning is already a privileged operation

HashiCorp's run-state documentation orders the main stages as plan, cost estimation, policy check and apply. The policy stage evaluates a proposed plan; it does not mean nothing has contacted the provider beforehand.

A plan may need to read resources and resolve configuration. Treat that environment as security-sensitive even when apply remains blocked. Give the planning identity only the access it needs, and examine what state, variables and provider configuration expose.

Workspace policy documentation defines how policies attach to runs. Review the configured enforcement and override permissions. An agent with administrative authority must not be assumed unable to change the very controls you intend to constrain it.

IAM authorizes the provider request

AWS's evaluation logic describes authentication, request-context processing and policy evaluation to decide whether a request is allowed. An explicit deny overrides an allow in the described policy combinations.

A plan policy can reject an unwanted configuration. IAM can deny an attempted API operation by the running identity. Neither layer makes the other redundant, and neither alone proves that an allowed change matches the user's intent.

Consider an agent proposing a storage bucket. A plan check might require an approved region and encryption configuration. Provider authorization should still prevent the identity from operating outside its assigned account or resource scope. Review what the actual credentials permit, including reads during planning.

Temporary credentials need a trust policy

HashiCorp's dynamic-credential documentation describes OIDC workload identities exchanged for temporary provider credentials at plan or apply. The run environment is torn down and its credentials discarded afterwards. Trust rules can use run metadata, including phase and workspace.

Discarding a local credential file is not the same assertion as revoking a copied credential at the provider. Check the provider's expiry and invalidation behavior. Keep planning and applying permissions distinct where the deployment supports that design.

Also check who can change the trust relationship. A short-lived credential with broad privileges can still authorize a damaging action while it is valid.

Separate authoring, approval and execution

The following is a proposed organization workflow, not a guarantee supplied automatically by Terraform:

AuthorityPermitted workSeparation to test
Configuration authorPrepare a change and explain its expected effectCannot grant itself policy-administration rights
Planning identityRead the required environment and produce a planCannot perform unneeded mutations
Policy administratorMaintain independently reviewed constraintsChanges are visible and separately authorized
ApproverApprove the specific reviewed planApproval cannot silently transfer to a changed proposal
Applying identityExecute the authorized change within scopeProvider permissions still deny unrelated operations

Exercise the denied paths using the assigned identity in a test environment. Check attempts to bypass the normal workflow, change a policy, switch credentials or apply a different plan. Retain the plan, decision and provider operation records.

Governance does not establish model correctness. A permitted infrastructure change can still be the wrong change. Our agent-boundary review explains why reachable shared services and action semantics belong in the assessment too.

Frequently asked questions

Does HCP Terraform policy evaluation happen before every cloud API request?

No. Its documented run sequence places policy checks after planning and before apply. Planning can itself require cloud access; protect that access with appropriate provider permissions.

Does cloud IAM check permissions only after an action begins?

No. AWS documents authentication and policy evaluation to determine whether an incoming request is allowed or denied. The earlier article's post-execution description was incorrect.

Can an agent never change its own HCP Terraform controls?

That depends on the identity's effective privileges. Separate policy administration, approval and execution authority, then test the assigned identity. A product name alone does not establish that separation.

Are discarded temporary credentials the same as immediate cloud-side revocation?

No. HashiCorp describes temporary credentials and teardown of the run environment. Review the actual cloud credential lifetime and revocation behavior; do not infer immediate invalidation solely from deleting a local copy.

Free interactive tools for the decisions this piece raises.

Related Reading