Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/address-review-comments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ jobs:
env:
HOME: /tmp
steps:
- name: Link to run
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr comment "${{ github.event.issue.number }}" \
--repo "${{ github.repository }}" \
--body "🤖 Addressing review comments: [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"

- name: Get PR ref
id: pr
run: |
Expand Down Expand Up @@ -68,4 +76,4 @@ jobs:
PR_NUMBER: ${{ github.event.issue.number }}
run: |
claude --version
claude -p "/utils:address-reviews $PR_NUMBER" --model claude-opus-4-6 --max-turns 100
claude -p "/utils:address-reviews $PR_NUMBER" --model claude-opus-4-6 --max-turns 100 --allowedTools "Bash Read Write Edit Grep Glob WebFetch"

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.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Restrict high-risk Claude tools to reduce prompt-injection blast radius.

Allowing both Bash and WebFetch for an agent processing PR review content creates a direct exfiltration path if prompt-injected (the step also exposes GH_TOKEN). Please tighten --allowedTools to the minimum set required for /utils:address-reviews (avoid network/shell unless strictly necessary).

Suggested hardening
-          claude -p "/utils:address-reviews $PR_NUMBER" --model claude-opus-4-6 --max-turns 100 --allowedTools "Bash Read Write Edit Grep Glob WebFetch"
+          claude -p "/utils:address-reviews $PR_NUMBER" --model claude-opus-4-6 --max-turns 100 --allowedTools "Read Write Edit Grep Glob"

As per coding guidelines, "Agentic CI actions: audit for prompt injection via issue/PR title/body flowing into LLM prompts" and "Least privilege: minimize GITHUB_TOKEN permissions".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/address-review-comments.yaml at line 71, The workflow step
invoking the Claude agent for "/utils:address-reviews" currently grants
high-risk tools via the --allowedTools flag (notably "Bash" and "WebFetch");
tighten the toolset to least privilege by removing "Bash" and "WebFetch" and
only include the minimal tools that the /utils:address-reviews action actually
needs (e.g., keep "Read", "Write", "Edit", "Grep", "Glob" if those are
required), update the command string that contains --allowedTools accordingly,
and ensure no unnecessary network/shell capabilities are granted (so the claude
-p "/utils:address-reviews $PR_NUMBER" invocation no longer exposes shell or web
access).