Quick Start

Set up in 5 minutes

Add InfraGuard AI to any GitHub Actions pipeline that uses Terraform.

1. Add the workflow file

Create .github/workflows/infraguard.yml in your repository with the YAML shown to the right.

2. Set secrets

In your repo settings under Secrets β†’ Actions, add INFRACOST_API_KEY (from infracost.io) and your cloud credentials.

3. Open a PR with Terraform changes

InfraGuard AI will automatically run on any PR that touches .tf or .tfvars files and post a review comment.

4. Configure enforcement

Set block-on to none (comment only), critical, high, or medium to control when the PR gate blocks merging.

.github/workflows/infraguard.yml
name: InfraGuard AI Review

on:
  pull_request:
    paths:
      - "**.tf"
      - "**.tfvars"

jobs:
  infraguard:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write

    steps:
      - uses: actions/checkout@v4

      - name: Setup Terraform
        uses: hashicorp/setup-terraform@v3

      - name: Terraform Init
        run: terraform init
        working-directory: ./terraform

      - name: Terraform Plan
        run: terraform plan -out=tfplan.binary
        working-directory: ./terraform
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

      - name: InfraGuard AI Review
        uses: infraguard-ai/action@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          plan-file: ./terraform/tfplan.binary
          block-on: high          # none | critical | high | medium
          infracost-api-key: ${{ secrets.INFRACOST_API_KEY }}

Early access note

The infraguard-ai/action@v1 GitHub Action is in private beta. Join the waitlist to get early access.

Docs β€” Quick Start | InfraGuard AI