fix: tighten Claude review workflow permissions#749
Conversation
- Add 10 missing shell script/Python permissions to --allowedTools (gh-resolve-review-threads, consolidate_reports, etc.) - Add Bash(jq *) for JSON processing - Remove Bash(cat *) and Bash(grep *) — agents use Read/Grep tools - Document issues:write rationale (needed for gh pr edit --remove-label) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe GitHub Actions workflow for Claude code reviews was updated to expand the agent's allowedTools list with many additional Bash/helper scripts (e.g., jq, gh-* scripts, consolidate_*, generate_review_report.py). Permissions and overall workflow structure remain unchanged. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/claude-code-review.yml:
- Line 99: The workflow's allowed tools list currently contains the overly-broad
entry "Bash(python3 *)" which permits arbitrary Python execution; remove that
broad pattern from the --allowedTools string in claude-code-review.yml and
explicitly allow only the known Python scripts used by the workflow (e.g.,
consolidate_reports.py, validate_report.py, generate_review_report.py) by adding
specific Bash patterns like "Bash(*consolidate_reports.py *)",
"Bash(*validate_report.py *)", and "Bash(*generate_review_report.py *)"
alongside the existing allowed commands so Python execution is constrained to
those known scripts and the least-privilege model is preserved.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d09458c2-2240-4e9f-b65a-93ba153d82b0
📒 Files selected for processing (1)
.github/workflows/claude-code-review.yml
All Python invocations are already covered by script-specific globs: - Bash(*consolidate_reports.py *) - Bash(*validate_report.py *) - Bash(*generate_review_report.py *) The only non-script usage was an agent improvising `python3 -c "import shutil; shutil.copy2(...)"` instead of cp. No need for a wide-open python3 permission. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
--allowedTools(fixes 8+ permission denials per review run)Bash(jq *)for JSON processingBash(cat *)andBash(grep *)— agents use built-in Read/Grep tools insteadissues: writepermission rationaleCompanion change: claudius v3.2.1 (plugin-side fixes for temp dirs, report paths, agent constraints)
Test plan
claudius-reviewlabel and verify no permission denials in the run log🤖 Co-authored by Claudius the Magnificent AI Agent
Summary by CodeRabbit