Skip to content

fix(ci): allow the cursor bot to trigger Claude Code Review - #722

Merged
logbie merged 3 commits into
mainfrom
warden/allow-cursor-bot-claude-review
Sep 3, 2026
Merged

fix(ci): allow the cursor bot to trigger Claude Code Review#722
logbie merged 3 commits into
mainfrom
warden/allow-cursor-bot-claude-review

Conversation

@logbie

@logbie logbie commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

What was broken

Every push to a PR made by the Cursor cloud agent fails the claude-review job.

Most recent instance: run 33315392206 on cursor/setup-cloud-agent-env-2b67 (PR #720), which failed in 1.6s with:

##[error]Action failed with error: Workflow initiated by non-human actor: cursor (type: Bot).
Add bot to allowed_bots list or use '*' to allow all bots.

This is not a flake and not a missing secret. The same branch went green at 13:15 and 13:36 and red at 13:53 — the only difference is the triggering actor:

Run Time (UTC) triggering_actor Result
33313705518 13:15 logbie success
33314646506 13:36 logbie success
33315392206 13:53 cursor[bot] failure
33316533966 14:19 logbie success

So the job fails precisely when the Cursor agent itself pushes, and passes when a human pushes the same branch. As we use Cursor cloud agents more, this becomes a permanent red X on our own PRs — noise that trains us to ignore a review check.

Root cause

anthropics/claude-code-action@v1 refuses non-User actors unless they are named in allowed_bots (src/github/validation/actor.tscheckHumanActor / isAllowedBot). Our workflow sets allowed_bots: 'github-actions', which was added for exactly this failure mode when the monthly SECURITY.md rotation PR hit it. cursor[bot] was never added.

The fix

One-line list extension: allowed_bots: 'github-actions''github-actions,cursor'.

The action lowercases each entry and strips a trailing [bot] on both sides before comparing, so the bare cursor form is correct and matches the existing github-actions style. This is the same remedy, from the same list, that already fixed the same error for github-actions.

Security note — please make this call deliberately, it is not routine plumbing

allowed_bots is a security control, so I want to be explicit rather than slip this through as CI cleanup:

  • This adds one named bot, not '*'. The action's own docs warn that '*' on a public repo can let external Apps invoke the action with prompts they control; that risk is not taken here.
  • Our prompt: is fixed by the workflow (/code-review:code-review ${{ github.repository }}/pull/...), so an allowed bot cannot steer what Claude is asked to do. It gets the same code review a human push would.
  • Job permissions are unchanged and read-only apart from id-token: write.
  • The residual exposure is that a PR whose head branch is pushed by cursor[bot] now gets reviewed rather than refused. That is the intended behaviour, but it is your integration and your judgement call — if you would rather gate the job off bot actors entirely (if: github.actor != 'cursor[bot]'), say so and I will send that instead.

Verification

  • allowed_bots semantics confirmed by reading action.yml ("Comma-separated list of allowed bot usernames") and the matching logic in src/github/validation/actor.ts and permissions.ts in anthropics/claude-code-action.
  • Failure signature and per-run triggering_actor values read from the Actions REST API (table above).
  • Workflow file re-parsed with yaml.safe_load after the edit; runs-on: blacksmith-4vcpu-ubuntu-2404 unchanged and still present in .github/actionlint.yaml.
  • No Rust source touched, so the presubmit build/test block is not implicated. I could not run cargo in this sandbox; nothing in this change requires it.

Test evidence

  • Risk class: R3. This is a workflow change to a security allow-list governing an untrusted-input boundary, and the conventions say ambiguous classification takes the higher class. R3's independent-review requirement is satisfied by this PR being human-reviewed and human-merged.
  • Acceptance criteria → tests: a claude-review run whose triggering_actor is cursor[bot] completes instead of exiting 1 at the actor gate. The check is only observable in CI on a Cursor-pushed PR — there is no local harness for it.
  • Red evidence: run 33315392206, a real timestamped CI failure on current main's workflow, with the exact error above. Not manufactured.
  • Unit/component: n/a — no repo code changed.
  • Integration/contract: n/a.
  • End-to-end: deferred to the next Cursor-authored push after merge. Please watch the first one.
  • Security: analysed above — single named bot, fixed prompt, unchanged permissions, '*' deliberately avoided.
  • Coverage / platforms: n/a; GitHub-hosted workflow config.
  • Not applicable, with reason: no TestPrograms/ or language-behaviour surface is touched, so backward compatibility is not in play.
  • Rollback/recovery: revert this one-line commit; behaviour returns to today's (Cursor pushes fail the review job).
  • Residual risk: low but non-zero, and it is a posture choice rather than a defect fix — see the security note.

Opened by the WFL repo warden (automated triage pass). I do not merge — this is for a human to review and decide.


Devin Review

Summary by CodeRabbit

  • Chores
    • Improved automated pull request review coverage for changes created by supported automation tools.
    • Clarified the review workflow documentation while preserving the existing review criteria.

Every PR push made by the Cursor cloud agent fails the claude-review job
with "Workflow initiated by non-human actor: cursor (type: Bot)". Add
cursor to the existing allowed_bots list, alongside github-actions.
Copilot AI lite review requested due to automatic review settings August 31, 2026 09:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T09:05:41.304463Z 1fe33c4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 698ddbc5-65a9-4d8f-b2c8-18a96521869a

📥 Commits

Reviewing files that changed from the base of the PR and between 36b5444 and 1fe33c4.

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

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Claude Code Review workflow now permits pull requests from both github-actions and cursor bot actors. Comments document Cursor cloud-agent pushes and confirm the fixed review prompt.

Changes

Claude review workflow

Layer / File(s) Summary
Update allowed review bots
.github/workflows/claude-code-review.yml
The allowed_bots configuration includes cursor alongside github-actions. Comments document the supported bot workflows and fixed review prompt.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: 🔵 Low · up to 1fe33

The workflow now lets Cursor-authored pull requests invoke Claude review, but it does not explicitly restrict that access to trusted same-repository PRs. Because the job uses a Claude credential and OIDC token issuance, external-PR behavior should be verified or constrained; the change is otherwise mergeable with explicit owner awareness.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: allowing the Cursor bot to trigger the Claude Code Review workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch warden/allow-cursor-bot-claude-review

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.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 potential issues.

Devin Review

# branches on our own PRs. The review prompt below is fixed by this
# workflow, so an allowed bot cannot influence what Claude is asked
# to do -- it only gets the same code review a human push would.
allowed_bots: 'github-actions,cursor'

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.

🔍 Required bot-path test is deferred

This R3 change lacks an automated test proving cursor[bot] passes while unlisted bots remain denied. The testing policy requires staging verification before merge.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

# branches on our own PRs. The review prompt below is fixed by this
# workflow, so an allowed bot cannot influence what Claude is asked
# to do -- it only gets the same code review a human push would.
allowed_bots: 'github-actions,cursor'

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.

🟥 Bot-triggered reviews expose privileged credentials

Any cursor bot push can trigger a checkout and model review with OAuth and OIDC credentials. Fork or compromised-agent changes can target the action’s execution environment.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copilot AI 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.

Pull request overview

This PR updates the GitHub Actions workflow for Claude Code Review so that PR pushes performed by the Cursor Cloud Agent (cursor[bot]) no longer cause the claude-review job to fail the “non-human actor” validation in anthropics/claude-code-action@v1.

Changes:

  • Extend allowed_bots from github-actions to github-actions,cursor so Cursor-originated PR pushes are accepted.
  • Expand the inline workflow comments to document why the bot is allowed and the intended security posture (named bot allow-list, fixed prompt, unchanged permissions).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@logbie

logbie commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

Stale-PR nudge (24h, first one). Opened 2026-08-31T09:03Z, last touched 09:10Z — 24 hours idle, non-draft, no human review yet. Re-checked this morning: 18/18 substantive checks pass, 2 skipped (Bump Version, claude), mergeable: true, mergeable_state: clean. Nothing has changed on main since (HEAD is still 36b54444, and today's nightly was a designed no-change skip), so this is still a clean merge.

One new data point from today's pass that's directly relevant. This morning's monthly update-security-doc run opened #723 — the github-actions[bot] case that the existing allowed_bots: 'github-actions' line was written for. On that PR, Claude Code Review (run 33455570082) came back action_required with zero jobs: it never started, so it never reached the allowed_bots gate at all. Two separate bot-actor problems, and they're independent:

  • This PR fixes the gate inside the action — cursor[bot] pushes get rejected with "Workflow initiated by non-human actor" once the run starts. That's deterministic on actor, proven on 08-30 by the same branch going green under logbie at 13:15/13:36/14:19 and red under cursor[bot] at 13:53.
  • Update SECURITY.md for September 2026 #723 is blocked one step earlier, by GitHub's own approval gate on PRs authored via GITHUB_TOKEN. Merging this PR won't fix that, and vice versa — details on Update SECURITY.md for September 2026 #723.

So the ask is unchanged and still one click: this is a security-posture decision (an allow-list on a public repo), which is why I left it for you rather than treating it as routine. The case for the named-bot form is in the PR body; '*' was deliberately avoided. If you'd rather not widen the allow-list at all, the alternative offered in the description — gating the job off bot actors entirely — is still on the table.

Standing caveat, repeated because it matters at merge time: my own CI passing here proves nothing about the fix. I push as logbie, a User, so this PR's claude-review never exercised the bot path. The first Cursor-authored push after merge is the real validation — please watch that one.

Posted by the WFL repo warden (automated triage pass).

@logbie
logbie merged commit 5385e61 into main Sep 3, 2026
19 checks passed
@logbie
logbie deleted the warden/allow-cursor-bot-claude-review branch September 3, 2026 15:53
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.

2 participants