Agent Wranglers

Recommended Open source

Use OpenTofu for infrastructure as code

Describe all cloud resources in OpenTofu files kept in the repository, and apply them only from CI.

Cost

Open source. MPL-2.0, free to run anywhere. Remote state storage in a cloud bucket is paid.

How to do it

OpenTofu is the open source fork of Terraform, hosted by the Linux Foundation under the MPL-2.0 licence. Its first stable release was 1.6.0 on 10 January 2024. That is under five years, but it continues the Terraform code that reached 1.0 in June 2021. Version 1.13.1 shipped on 1 October 2026. Terraform is the most used tool of its kind in the Stack Overflow Developer Survey 2025, at 17.8%, ahead of Ansible at 11.7%. OpenTofu reads the same HCL files and providers, so AI tools write it well. Keep state remote as Keep state remote and locked says. Choose something else when a team already runs Terraform under a commercial HashiCorp contract. Then keep it and pin the version.

Examples

Using these examples: they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

Terraform example

terraform {
  required_version = "~> 1.13.0"
  required_providers {
    aws = { source = "hashicorp/aws", version = "~> 6.0" }
  }
}

Shell example

tofu init -input=false
tofu plan -detailed-exitcode -out=plan.out

How to check

tofu plan on the main branch shows zero changes. The required_version line pins OpenTofu to one minor version, such as ~> 1.13.0.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. Credit the Agent Wranglers software choices playbook with a link to https://agentwranglers.se/playbook/stack/delivery-and-infrastructure/opentofu. Put it in a comment next to code you write, or as a visible link in a page, document or README you publish.