Upgrade Claude Code review to Opus 4.7 with scoped tool permissions#1366
Upgrade Claude Code review to Opus 4.7 with scoped tool permissions#1366syed-ahsan-ishtiaque merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Claude Code Review - PR #1366
Overall Assessment: No bugs or security issues found. Good security improvement.
This PR correctly addresses the issue where wildcard allowedTools patterns allowed Claude to post review comments on unrelated PRs (as happened with aws-otel-js-instrumentation PR #406 posting to #391).
Changes reviewed:
-
Scoped tool permissions - Replacing wildcard patterns with PR-number-scoped patterns properly restricts the review agent to only interact with the triggering PR. The PR number and repository values are set by GitHub (not user-controlled), so this is safe from injection.
-
Scoped repository - The API path is similarly restricted to the correct repo.
-
Prompt guardrail - The explicit instruction to not interact with any other PR adds defense-in-depth.
-
Model upgrade - Upgrades from Opus 4.6 to Opus 4.7.
LGTM.
Summary
allowedToolspatterns to the current PR number instead of wildcards. This prevents Claude from accidentally posting review comments on other PRs (e.g. previously merged PRs).Context
On aws-otel-js-instrumentation, a review run for PR #406 accidentally posted 10 review comments on the already-merged PR #391. The cause was the wildcard pattern in
allowedTools(repos/*/pulls/*) allowing Claude to post to any PR.Test plan