{
  "slug": "semgrep-scans-opentofu-tofu-files-as-terraform-c7e9186e5a09",
  "title": "Semgrep scans OpenTofu .tofu files as Terraform",
  "tools": [
    "semgrep"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-07-22T23:05:43.000Z",
  "announced_at": "2026-07-22T23:05:43.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When scanning a repository with OpenTofu `.tofu` files, run a recursive Semgrep scan with `p/terraform`; Semgrep 1.171.0 detects and scans `.tofu` files as Terraform without extra configuration.",
    "examples": [
      "semgrep scan --config p/terraform ."
    ],
    "gotchas": [
      "Version: 1.171.0",
      "TARGETS (`.`): Files or folders to scan; Semgrep defaults to the current working directory.",
      "--config (`p/terraform`) (required): Select a Semgrep Registry ruleset by name.",
      "Prerequisite: Use Semgrep 1.171.0 or later for the documented `.tofu` automatic detection change."
    ]
  },
  "why_it_matters": "Scan a repository containing OpenTofu files with recursive scans or Terraform rulesets.",
  "sources": [
    "https://github.com/semgrep/semgrep/releases/tag/v1.171.0",
    "https://semgrep.dev/docs/cli-reference"
  ],
  "rank": 0.94033,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-63ebebf2f7de25fb-0:gate",
    "evidence_hash": "1854e5b80d0c58323149c38c02dd42e2f32f3cec09ec3e6c09d99fd09c6b1bb2"
  },
  "review": {
    "draft_hash": "d41c949defefa12c0de1db4cdf1e0bf0b8f9ddb073b4208a7ff6077f08e9ed24",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.94 >= 0.9; 2 needed) and Jev gave 0.61 (>= 0.6 needed)."
  }
}
