Conversation
A required check that passes mechanical changes the automated reviewer has seen, and otherwise waits for a code owner approval on the current head.
- Read the current head from the API instead of the event payload, which can lag on a review event. - Judge renames on both paths, so moving a source file into a mechanical path does not count as mechanical. - Require the approver to be listed in CODEOWNERS on the base branch. The collaborator-permission endpoint is not available to this token, which made every approval look unauthorised. - Note that a pull request can edit this file, so branch protection also carries the requirements.
Accept the reviewer's completed check run as well as a review object: Bugbot skips some pushes, and waiting for a review that never arrives wedged the gate.
Re-run when the reviewer's check run completes, since a skipped review posts no review event to trigger on.
Re-run when a pull request is retargeted, so a change pointed at main after it was opened is still assessed.
Wait for the automated review instead of failing while it runs, and re-check after the wait. A check that fails mid-review leaves the gate stale until some other event re-runs it, which a skipped review never produces.
The reviewer is the risk gate: wait for it to review the current head, and leave the resolution of its comments to required conversation resolution. Drops the path allow-list, the rename handling and the code-owner approval logic.
Replaces the risk-gate check and the protocol-team bypass: the bot approves once the reviewer has reviewed the current head, and CODEOWNERS makes that approval count. Fails closed otherwise.
The approve step has no checkout, so gh needs GH_REPO to find the repository.
Run on pull_request_target so a pull request cannot rewrite the job that approves it, and drop the review event: the job waits for the reviewer itself.
Only approve branches of this repository, and pass the pull request number through the environment instead of interpolating it into the shell.
Lets the workflow run for its own pull request. Switch back to pull_request_target before merging, otherwise a pull request can rewrite the job that approves it.
The bot approved repeatedly because its own approval fires the review event that re-runs this job; skip when the head is already approved. Approval now also needs a low-risk verdict from an agent (deepseek/deepseek-v4.1-flash over OpenRouter), which fails closed when the diff is too large, the key is missing or the answer is unusable.
pi (deepseek/deepseek-v4.1-flash over OpenRouter) judges the diff and approves through its only tool, approve_pr, which re-checks the guards and calls the API as wld-walletkit-bot. The agent has no shell, read or write tools, so a prompt injection in the diff cannot reach the bot token or run anything.
Drops the pre-fetched context and the disabled toolset: the agent runs with its normal tools and a short system prompt, and the bot token stays in the step that submits the approval.
Makes the workflow run for its own pull request; switch back to pull_request_target before merging.
Text mode into the log, the transcript in the run summary, and one PR comment the agent edits in place on later pushes.
pi needs a user message, not just a system prompt, or it exits without doing anything. Write the extension where typebox resolves, next to the pi install.
No pipe, so the log streams while the agent works; the transcript for the comment comes from the pi session file. The report step needs GH_REPO without a checkout.
|
Risk agent: No low-risk verdict, so no approval. I reviewed PR #545 ( What it changes (2 files, +130/-1):
Why this hits the stop conditions:
Because this is workflow/release/dependency configuration (and a security-relevant governance change), I'm stopping without approving. It needs human review of the token handling, guard conditions, and CODEOWNERS change. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1666a1d. Configure here.
| (if (.author_association == "OWNER" or .author_association == "MEMBER" or .author_association == "COLLABORATOR") then empty else "author is an external contributor (\(.author_association // "NONE"))" end), | ||
| (if $head != "" and .head.sha != $head then "the head moved" else empty end) ] | .[]' /tmp/pr.json > /tmp/problems.txt | ||
| # A changed file under .github is workflow or config. | ||
| grep -q '^\.github/' /tmp/files.txt && echo "a changed file is under .github" >> /tmp/problems.txt || true |
There was a problem hiding this comment.
Config guards miss dependency files
High Severity
The new fail-closed check only greps for paths under .github/, so it does not enforce the same commit’s rule against CI, release, or dependency configuration. A low-risk verdict can still produce a wld-walletkit-bot CODEOWNER approval for changes to Cargo.toml, deny.toml, release-plz.toml, flake.nix, or rust-toolchain.toml. The agent can write /tmp/verdict.json from untrusted PR content, and those path checks are the real merge gate.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1666a1d. Configure here.


Approves a pull request with
wld-walletkit-botonce the automated reviewer has reviewed the current head, so the reviewer is the gate. Its comments block the merge until resolved, whichworldcoin/infrastructure#49096enforces..github/workflows/auto-approve.ymlreplacesrisk-gate.yml: waits for the reviewer (Bugbot, or Copilot if enabled), then approves as the bot..github/CODEOWNERS: adds@wld-walletkit-botso its approval satisfies the code owner requirement.Fails closed: a draft, a fork (no secrets), a base other than
main, a pull request authored by the bot itself, or a missing review on the head all get no approval.Note
High Risk
Changes merge gating and bot approval in CI; mistakes could auto-approve risky PRs or block legitimate merges despite defensive guards and split-token design.
Overview
Adds an
auto-approveGitHub Actions workflow that runs onpull_request_targetfor PR lifecycle events. A pi agent reviews the PR (without the bot token), may record a low-risk verdict via a customapprove_prtool, posts a Risk agent comment, and a separate step submitswld-walletkit-botapproval only when the verdict approves and guards pass (basemain, same-repo head, not draft, internal author, head SHA unchanged, no.github/file changes, not already approved)..github/CODEOWNERSadds@wld-walletkit-botto the default owner list so that bot approval can satisfy code-owner requirements alongside human owners.Reviewed by Cursor Bugbot for commit 1666a1d. Bugbot is set up for automated code reviews on this repo. Configure here.