Gate AI-generated pull requests in GitHub Actions

When agents open pull requests, the review bottleneck moves to CI: an AI-generated change can look plausible line-by-line and still carry a destructive migration, a weakened policy, or a credential leak.

Mergen’s CI gate runs the same deterministic policy engine your developers already have locally against the changes in the pipeline — flagging high-risk diffs and enforcing a human approval step before merge or deployment. Every build is fully protected on every plan; plan limits are informational only and never weaken a verdict.

What is covered, precisely

Wire it into a workflow

Add the gate as a workflow step (see action.yml for all inputs)
- uses: actions/checkout@v4
- name: Mergen AEG Gate
  uses: <path-or-ref-to-action.yml>
  with:
    mergen-url: ${{ secrets.MERGEN_URL }}
    mergen-secret: ${{ secrets.MERGEN_SECRET }}
(Optional) Report build status separately, for incident correlation — not the policy gate
curl -X POST http://your-mergen-host:3000/ci/generic \
  -H 'Content-Type: application/json' \
  -d '{"status":"failed","branch":"main","sha":"'$GITHUB_SHA'","url":"'$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID'"}'

What gets stopped

PR that adds `terraform destroy` to a deploy job
High-risk change flagged; the required status check fails and blocks merge.
Migration dropping a column in use
Blast-radius calculation flags schema changes against live usage.
Workflow step that echoes secrets
Credential-exposure patterns are detected structurally in the diff.

Human-in-the-loop approvals

A block verdict fails a required commit status, so branch protection stops the merge until a human resolves it — either by fixing the PR or by reviewing the matched policy through the normal override workflow. There is no in-pipeline Slack approval step for this gate; that HITL flow is for local/MCP tool-call holds, not CI.

Install Mergen →Quick start guide →See the benchmark →
Also available for: Claude Code · Cursor · Windsurf · VS Code