Skip to content

fix: tighten Claude review workflow permissions#749

Merged
lklimek merged 2 commits into
v1.0-devfrom
fix/claude-review-permissions
Mar 13, 2026
Merged

fix: tighten Claude review workflow permissions#749
lklimek merged 2 commits into
v1.0-devfrom
fix/claude-review-permissions

Conversation

@lklimek
Copy link
Copy Markdown
Contributor

@lklimek lklimek commented Mar 13, 2026

Summary

  • Add 10 missing shell script/Python permissions to --allowedTools (fixes 8+ permission denials per review run)
  • Add Bash(jq *) for JSON processing
  • Remove Bash(cat *) and Bash(grep *) — agents use built-in Read/Grep tools instead
  • Document issues: write permission rationale

Companion change: claudius v3.2.1 (plugin-side fixes for temp dirs, report paths, agent constraints)

Test plan

  • Trigger a review with claudius-review label and verify no permission denials in the run log
  • Verify review report uploads to artifacts successfully

🤖 Co-authored by Claudius the Magnificent AI Agent

Summary by CodeRabbit

  • Chores
    • Updated automated code review workflow: expanded the set of available tools and utilities the workflow may invoke.
    • Minor permissions metadata adjusted with an inline comment to clarify a write permission on issues.

- 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>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a4216770-e03d-4799-b15a-f1f913b2248d

📥 Commits

Reviewing files that changed from the base of the PR and between 8338a0f and 4326f95.

📒 Files selected for processing (1)
  • .github/workflows/claude-code-review.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/claude-code-review.yml

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Workflow Configuration
\.github/workflows/claude-code-review.yml
Minor permissions comment change; extended allowedTools list to include numerous Bash and helper script entries (jq, gh-*, consolidate_*, generate_*, fetch_*, etc.), expanding the set of tools the agent may invoke.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I found new tools beneath the log,
A bash of helpers, scripts in a jog.
jq hums softly, gh tools sing,
I hop through code — what joy they bring! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: tighten Claude review workflow permissions' accurately describes the main change: restricting workflow permissions by adding specific script allowances and removing broad python3 permissions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/claude-review-permissions
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between d928288 and 8338a0f.

📒 Files selected for processing (1)
  • .github/workflows/claude-code-review.yml

Comment thread .github/workflows/claude-code-review.yml Outdated
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>
@lklimek lklimek merged commit ddcfa10 into v1.0-dev Mar 13, 2026
2 checks passed
@lklimek lklimek deleted the fix/claude-review-permissions branch March 13, 2026 11:24
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.

1 participant