Skip to main content

PR Security Check

PR Security Check reviews your Terraform, CloudFormation, and IAM policy changes before merge. When a pull request touches security-sensitive files, Flare analyzes the diff with AI and posts findings as a PR comment with severity scores, plain-English explanations, and specific fix suggestions.
PR Security Check uses a Flare API key, not a connector. Anyone with a GitHub repo can use it — no cloud connection required.

How it works

  1. A pull request is opened or updated with changes to infrastructure files
  2. The GitHub Action identifies security-relevant files (.tf, CloudFormation, IAM policies, etc.)
  3. The diff is sent to Flare’s API for AI-powered review
  4. Findings are posted as a PR comment
  5. The workflow fails if findings meet your configured severity threshold

What Flare looks for

Setting up

1. Generate an API key

  1. Go to Settings at tryflare.ai/settings
  2. Click Create API key
  3. Copy the key immediately — it is only shown once
  4. Add it as a GitHub repository secret named FLARE_API_KEY

2. Add the workflow

Create .github/workflows/flare.yml in your repository:
fetch-depth: 0 is required. Without it, the action cannot compute the diff between the PR base and head.

Configuration

Inputs

Outputs

Fail-on threshold

The fail-on input controls when the workflow fails:

Custom file patterns

Override the default patterns to review additional file types:

Default file patterns

The action reviews these files by default: If no changed files match these patterns, the action exits cleanly without calling the API.

PR comment

When findings are detected, a comment is posted on the PR with a severity summary and per-finding details:
When the action runs again on the same PR (e.g., after pushing a fix), the existing comment is updated rather than duplicated. If no security issues are found, the comment reads: “No security issues found. :white_check_mark:“

Priority truncation

For large PRs, Flare prioritizes the most security-relevant files:
  1. Critical: IAM directories, policy files, role files
  2. High: Sentinel policies, firewall rules, network configs
  3. Medium: General Terraform and CloudFormation
  4. Low: Kubernetes and Helm manifests
If the total diff exceeds the analysis context window, lower-priority files are dropped first. The response includes a files_truncated count so you know if files were skipped.

Rate limits

PR checks share the Flare daily analysis limit (10/day on the free tier). When the limit is reached, the action posts a warning but does not fail the workflow — your PR is not blocked by exhausted quota.

Revoking a key

Go to Settings at tryflare.ai/settings and click Revoke on the key. Any workflows using that key will receive 401 Unauthorized on the next run.

Combining with deploy webhooks

PR Security Check and deploy webhooks serve different moments: Use both for complete coverage: catch issues in the code review, then verify the deploy didn’t introduce unexpected changes.