All templates
FeaturedMulti-Agent#Multi-Agent#Adversarial#Code Review#PR Review#Orchestrator#GitHub#MCP#Sequential Thinking#Agent

Adversarial PR Review

An orchestrator pulls a pull request from GitHub, a primary reviewer proposes findings, and a challenger on a different model disputes them — arbitrated into one calibrated approve, comment, or request-changes decision.

Workflow at a glance

The full canvas, before you import it

Click any node to see its config.

#Multi-Agent#Adversarial#Code Review#PR Review#Orchestrator#GitHub#MCP#Sequential Thinking#Agent

Click a node to select it — same as the Heym editor; the panel shows its settings.

5 nodes · Free & source-available

Adversarial PR Review

A multi-agent, adversarial pull request reviewer. An orchestrator pulls the real change from GitHub, delegates to a primaryReviewer that proposes findings, then to a challenger on a different model vendor that disputes those findings and hunts for missed bugs. The orchestrator arbitrates both sides into one calibrated decision — approve, comment, or request changes — instead of dumping every issue a single model noticed.

Built from the pipeline in our guide: AI Code Review: A Multi-Agent, Adversarial Guide.

What this workflow does

  1. prInput takes a pull request URL (or POST {"text":"<pr-url>"} to the workflow)
  2. orchestrator uses the GitHub MCP to read the PR diff, commits, comments, and CI status, plus a Sequential Thinking MCP to reason step by step
  3. primaryReviewer (Claude Opus) returns structured findings, each with a severity from S0–S4, a confidence score, a file and line, and a suggested fix
  4. challenger (GPT, a different vendor) critiques every finding — accept, reject, or needs-more-evidence — flags wrong severities, and adds high-impact issues the reviewer missed
  5. The orchestrator merges both sides, drops rejected findings, applies agreed severity changes, and writes a final decision plus a suggested PR comment to finalReview

Why adversarial

A lone reviewer is confident, agreeable, and biased toward quick wins, so it both invents problems and misses real ones. Giving the challenger the explicit job of disputing the primary reviewer — on a different model so they do not share blind spots — filters weak findings and surfaces what a single pass would miss. The structure, not any single model, is what improves the output.

Use cases

  • Self-hosted PR review that keeps proprietary code on your own infrastructure
  • High-stakes merges where a missed bug costs more than the extra tokens
  • Cutting false-positive noise from a single-agent reviewer

Setup

  1. Add an LLM credential to orchestrator, primaryReviewer, and challenger — mix vendors so the challenger differs from the reviewer
  2. Provide a GitHub token: the GitHub MCP reads it from the global variable githubPat
  3. Replace your-github-username in the orchestrator prompt with your handle
  4. (Optional) Add web-search and website-loader sub-workflows to the orchestrator for external context (CVEs, library status, linked RFCs)
  5. Run on a real PR, then open the Traces tab to see every tool call, each sub-agent, tokens and latency, and where the two agents disagreed

Notes

The reviewer and challenger return structured JSON; the orchestrator's merge policy decides the verdict (any surviving S0/S1 finding means request changes). Swap models per role to trade cost against depth.

How to import this template

  1. 1Click Import → Copy JSON on this page.
  2. 2Open your Heym and navigate to a workflow canvas.
  3. 3PressCmd+V/Ctrl+V— nodes appear instantly.
  4. 4Add your API keys in the node config panels and click Run.
More workflow templates
View all templates