Skip to content

pilot(mcp): scan for secrets on the triage-approved path too - #786

Merged
don-petry merged 2 commits into
mainfrom
claude/mcp-scan-approve-path
Jun 19, 2026
Merged

don-petry merged 2 commits into
mainfrom
claude/mcp-scan-approve-path

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

What

Extends the secret-scanning pilot (#681) to the triage-approved path so every agent-reviewed PR is scanned — not just escalated ones.

Why

The tier-2 deep-review secret scan (merged in #783) only runs on PRs that triage escalates. Clean PRs are triage-approved and handled by single-review.md, which never scanned them. A secret in an otherwise-trivial PR could therefore be approved by the agent without an MCP scan. (gitleaks CI still scans every PR, but the agent didn't — this closes that gap.)

Change

prompts/single-review.md — add a run_secret_scanning step mirroring deep-review.md:

  • Scans the diff's raw added/modified content (files = string or array of strings, not paths/objects — per the tool schema).
  • Any finding is HIGH and blocking → RISK=HIGH, DECISION=escalate (HIGH can never auto-approve).
  • Same graceful degradation: if the tool is unavailable or errors, note it in one line and continue — never fail the review or fabricate a result.

Activation

Effective once merged and pr-review/stable is re-cut to include the commit.

Pilot for epic #676 (#681).

🤖 Generated with Claude Code


Generated by Claude Code

The deep-review (tier-2) secret scan only runs on PRs that triage escalates.
Clean PRs are triage-approved and reviewed by single-review.md, which never
scanned them — so a secret in an otherwise-trivial PR could be approved by the
agent without an MCP scan (gitleaks CI still covers it, but the agent did not).

Mirror the deep-review step into single-review.md so every agent-reviewed PR is
scanned: when run_secret_scanning is available, scan the diff's raw added/
modified content; any finding is HIGH and blocking (escalate, never auto-
approve). Same graceful degradation — if the tool is absent or errors, note it
in one line and continue; never fail the review or fabricate a result.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015VRMMWmqW9nW81jygmea3e
@don-petry
don-petry requested a review from a team as a code owner June 19, 2026 00:47
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 30 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9741887e-1c60-4d16-bcf7-a1ee227c51ed

📥 Commits

Reviewing files that changed from the base of the PR and between 1bd5ab2 and 1ae1111.

📒 Files selected for processing (1)
  • prompts/single-review.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/mcp-scan-approve-path

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 00:48

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the single-review prompt to include a secret scanning step using the MCP tool when available. The review feedback correctly points out that the instructions should explicitly define how to derive the 'owner' and 'repo' variables in this new step, as they are currently only defined within the nested context of step 2.

Comment thread prompts/single-review.md Outdated
@don-petry
don-petry disabled auto-merge June 19, 2026 00:49
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-19T01:49:01Z.

…n step

Address Gemini review (#786): step 3 runs for all PRs, but owner/repo
derivation was only shown under step 2's incremental sub-bullet. State it
inline — owner = headRepository.owner.login, repo = headRepository.name from
the step-1 PR metadata.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015VRMMWmqW9nW81jygmea3e
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge June 19, 2026 00:50
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #786
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-19T01:22:48Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-19T01:22:48Z

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 00:52

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 1ae1111812438c45bb398827d4e5d8ae6e93dc86
Review mode: triage-approved (single reviewer)

Summary

Documentation-only change to prompts/single-review.md (16 add / 2 del) that adds a run_secret_scanning (MCP) step to the triage-approved review path, mirroring the existing step in deep-review.md. Closes the gap where triage-approved (clean) PRs were never agent-scanned for secrets. No executable code changes.

Linked issue analysis

No formal closingIssuesReference; PR is a pilot for epic #676 (#681) and extends the secret-scanning work from #783. The stated goal — scan the triage-approved path the same way escalated PRs are scanned — is fully realized by the new step 3, which is a faithful mirror of deep-review.md's secret-scan step.

Findings

None blocking. Verified the change against the mcp__github__run_secret_scanning tool schema: files accepts a single string or an array of strings (max 100) of raw file contents/diff hunks, not paths or objects — exactly as the new prose states. owner/repo derivation (headRepository.owner.login / headRepository.name) is correctly specified inline, addressing Gemini's review comment in commit 1ae1111. HIGH/blocking handling and graceful-degradation wording match deep-review.md.

CI status

All required checks green on the head SHA: Lint, ShellCheck, Compile agentic workflows, Agent Security Scan, Secret scan (gitleaks), CodeQL (actions/python), SonarCloud, unit-tests, AgentShield, holdout-guard. Earlier CANCELLED dev-lead/review check runs were superseded by SUCCESS re-runs. mergeStateStatus is BLOCKED pending org-leads review (human merge gate), which is outside this agent's auto-approval scope.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit e81f7ab into main Jun 19, 2026
25 of 28 checks passed
@don-petry
don-petry deleted the claude/mcp-scan-approve-path branch June 19, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants