AV Software Solutions 360PR broker

How-to

Get pull requests reviewed with the PR broker

The PR broker collects pull requests that need a review and hands them to Claude Code review sessions. Each session claims one focus topic, such as security or architecture, reviews the PR from that angle and posts one review comment. The broker checks the comment and keeps track of who reviews what, round after round.

Which key you need

The broker accepts nothing without a key. An admin issues keys on the console's admin page. Each key belongs to one person or one pipeline, is shown once, is valid for 12 months and can be revoked at any time. The broker stores only a hash of it.

You want toKeyStarts withIssued under
Submit PRs for review: by hand, from a pipeline, from a coding agent or your own Power Automate flowPublishing keyprp_Admin → Publishers
Run review sessions and watch the consoleChannel token (maintainer key)prb_Admin → Maintainers
Ask for a review in the team's Teams channelNone: post the PR link in the channel––

Keep keys secret. Store them in a file only you can read, in a pipeline secret or in Azure Key Vault. Never put them in a repository, a chat or a prompt. If a key leaks, ask an admin to revoke it and issue a new one.

Submit a PR with curl

Send the PR's web address to POST /intake/pr with your publishing key. The broker opens a review request in your name, and the review sessions are told about it at once.

curl -sS --fail-with-body -X POST https://<broker>/intake/pr \
  -H "X-PR-Broker-Key: $PR_BROKER_PUBLISH_KEY" \
  -H "content-type: application/json" \
  -d '{"url": "https://github.com/<owner>/<repo>/pull/42"}'

Keep the key in a file and read it into the variable, so it never appears on the command line:

export PR_BROKER_PUBLISH_KEY="$(cat ~/.config/pr-broker/publish-key)"
FieldMeaning
urlThe PR's web address. GitHub: https://github.com/<owner>/<repo>/pull/<n>. Azure DevOps: https://dev.azure.com/<org>/<project>/_git/<repo>/pullrequest/<n> or the visualstudio.com form.
textInstead of url: any text; every PR link in it counts. For flows that pass a whole message.
idOptional. Your own id for this submission, such as a pipeline run id. Sending the same id again is answered as a duplicate, so retries are safe.
unblockOptional, true: lifts a block a reviewer set with the verdict block and opens the next round.
AnswerMeaning
201Requested. {"requestIds": ["github/<owner>/<repo>/42"]}
200{"duplicate": true}: this id was submitted before.
401No key, or the key is unknown, revoked or expired.
422No PR link in url or text.
400The body is not a JSON object, or id has spaces or is too long.

Re-review: after you pushed the requested changes, submit the same link again. The broker opens the next round; topics that were approved stay approved.

Connect Power Automate

The team's Teams channel

Post the PR link in the team's review channel. The team's flow forwards every message with a PR link to the broker; you need no key. Write unblock next to the link to lift a block. An admin set this flow up once with its own intake secret.

Your own flow

Any other flow, for example one that starts with Azure DevOps' trigger When a pull request is created, submits PRs like curl does:

  1. Ask an admin to add a publisher named after the flow and to issue its publishing key.
  2. Put the key into an Azure Key Vault secret. In the flow, read it with Azure Key Vault · Get secret and turn on Secure outputs in the action's settings, so the run history does not show it.
  3. Add an HTTP action and turn on Secure inputs:
    MethodPOST
    URIhttps://<broker>/intake/pr
    Headerscontent-type: application/json
    X-PR-Broker-Key: @{body('Get_secret')?['value']}
    Body{"url": "<the PR's web address>", "id": "<the PR id or the message id>"}

Build url from the trigger's dynamic content: the web address of the PR, not the REST API address. For a flow on another Teams channel, send the message text as text and the message id as id; the broker picks out the PR links. The default retry policy of the HTTP action is fine: with an id, a retry is a duplicate.

Let a coding agent submit its PR

A coding agent such as Claude Code can request the review itself once it opened a PR. Give it a publishing key of its own, so the console shows who asked, then tell it when to submit.

  1. Ask an admin for a publisher such as Claude Code (your name) and its publishing key. Save the key in a file only you can read:
    mkdir -p ~/.config/pr-broker
    sh -c 'umask 077; printf "Publishing key: "; stty -echo; read -r k; stty echo; echo; printf "%s" "$k" > ~/.config/pr-broker/publish-key'
  2. Start the agent with the key in its environment, never in its prompt:
    PR_BROKER_PUBLISH_KEY="$(cat ~/.config/pr-broker/publish-key)" claude
  3. Add these instructions to the repository's CLAUDE.md or AGENTS.md. They contain no secret, only the variable's name:
    ## Review requests (PR broker)
    
    After you open a pull request, or push changes that answer review comments,
    request a review through the PR broker:
    
    curl -sS --fail-with-body -X POST https://<broker>/intake/pr \
      -H "X-PR-Broker-Key: $PR_BROKER_PUBLISH_KEY" \
      -H "content-type: application/json" \
      -d '{"url": "<the PR web URL>", "id": "<the PR web URL>@<head commit sha>"}'
    
    - Use the PR's web URL, as `gh pr view --json url` or the Azure DevOps PR page shows it.
    - Submit once per pushed state; the id with the head commit makes a retry harmless.
    - 201 means requested, 200 means already requested. 401: tell the user the key is
      missing or revoked. 422: the URL is not a pull request link.
    - Never print, log, echo or commit PR_BROKER_PUBLISH_KEY. If it is not set, say so
      and stop; never ask for the key in the chat.

Claude Code asks before it runs the command. To let it run without asking, allow exactly this call in your user settings (~/.claude/settings.json), not in the repository's:

{ "permissions": { "allow": ["Bash(curl -sS --fail-with-body -X POST https://<broker>/intake/pr:*)"] } }

Run Claude review agents

A review agent is a Claude Code session with the broker's channel attached: a small server that runs next to the session, tells it about new review requests and gives it six tools: list_requests, list_topics, claim_topic, report_progress, submit_topic and release_topic. Run one session per focus topic you want to cover; three sessions on security, architecture and business alignment cover the required topics.

What you need

Set up once

  1. Save the channel token in a file only you can read:
    mkdir -p ~/.config/pr-broker
    sh -c 'umask 077; printf "Channel token: "; stty -echo; read -r t; stty echo; echo; printf "%s" "$t" > ~/.config/pr-broker/channel-token'
  2. Register the channel with Claude Code. The configuration holds the token file's path, never the token:
    claude mcp add pr-broker --scope user \
      -e PR_BROKER_URL=https://<broker> \
      -e PR_BROKER_CHANNEL_TOKEN_FILE=$HOME/.config/pr-broker/channel-token \
      -- node <path-to-the-pr-broker-checkout>/apps/channel/src/server.mjs
    For Azure DevOps PRs add -e PR_BROKER_AZDO_ORGS=<organisation>.

Start a review agent

Start Claude Code in a checkout of the repository under review, with a session name others recognise:

cd <repository-under-review>
PR_BROKER_SESSION=jane-security claude --dangerously-load-development-channels server:pr-broker

The flag is needed until the channel is on the organisation's allowlist. Requests that are already waiting arrive right away, new ones as they come. A notification never starts a review on its own; you decide what the session takes. Then, in the session:

  1. Claim a topic: Claim security for github/<owner>/<repo>/42. If someone else holds it, the answer names the topics still open.
  2. Review only that topic: Review the PR from the security angle only. Do not post, do not push. Ask for a short progress note now and then; a claim lasts 15 minutes and only progress notes renew it.
  3. Post one review comment on the PR whose first line is the marker, then the summary and the findings:
    pr-broker · security · round 1 · request_changes
    The verdict is approve, request_changes or block (a human has to decide).
  4. Submit: Submit the security review with the comment URL and the head commit. The broker reads the comment itself and accepts it only from your identity, on this PR, after your claim, with the right marker.
  5. Or release the topic, so another session can take it.

When every required topic is in, the request is approved or changes requested. After a new submission of the same PR, the next round reopens only the topics that asked for changes; the agent then checks whether its findings are resolved and what changed since the reviewed commit.

Sign in to the console with your channel token to watch requests, rounds and sessions live. The full session guide, with troubleshooting, is docs/guide/review-session.md in the broker repository.