Harden Claude review workflow#1865
Merged
Merged
Conversation
mootz12
approved these changes
May 8, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s Claude-based PR review GitHub Action by bounding agent iteration cost and constraining the GitHub CLI tool allowlist to the current pull request, reducing risk of unintended cross-PR operations.
Changes:
- Add
--max-turns 30to cap the number of Claude tool-use cycles per run. - Scope allowed
gh prcommands (comment,diff,view) to the current PR number via${{ github.event.pull_request.number }}. - Document the intent of these safeguards inline in the workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Apply the best practices to the Claude review workflow:
--max-turns 30to bound token spend per invocation.gh prcommands to this PR's number so a misfire can't reach into another PR.Why
Brings this workflow in line with the Claude-action best practices: capped turns and per-PR-scoped tool patterns. Existing fork exclusion is preserved — fork PRs from outside contributors will not trigger Claude.