Skip to content

fix(guardrails): read the lanes App login from a user option - #17556

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/17208-guardrails-lanes-app
Nov 20, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/17208-guardrails-lanes-app

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Refs: #17208

Summary

block-lane-pr-disable-auto named one publisher's GitHub App as the lanes App whose pull requests it protects. Every consumer inherited that login (#17208).

Fix

  • New block_lane_pr_disable_auto_app userConfig option (string, default empty) names the lanes App login; app/<slug>, <slug> and <slug>[bot] in any case name the same App. A set login keeps the old behavior: a disable on that App's pull request is blocked, any other author passes.
  • Unset, the guard blocks a disable on a pull request a GitHub App opened (app/<slug> or <slug>[bot] from gh pr view, a Bot author from the GraphQL read), passes one a person opened, and still blocks a target or author it cannot read. The GraphQL author read now asks for __typename.
  • The lanes App login comes from user settings, never from a file a pull request can edit, per the owner decision on trust values (row L227). The unset behavior is the owner's choice (row below).
  • README row and option table updated; minor fragment.

Owner decision

The check this changes is the guard hook plugins/guardrails/hooks/block-lane-pr-disable-auto.sh. Against main it narrows nothing: main blocked a disable only on the one hardcoded App's pull requests; with the option unset this blocks every App-opened pull request, and with it set, the named App's. A person's pull request passed on main and still passes. The owner chose the unset behavior over blocking every disable.

Verification

  • plugins/guardrails/hooks/block-lane-pr-disable-auto.test.sh: PASS=147 FAIL=0. New cases: unset with an App author (app/<slug>, <slug>[bot], GraphQL Bot) blocked; unset with a person's PR passes (CLI and GraphQL); unset with an author read that fails blocked; unset with an unreadable target blocked; set with the matching App login blocked; set with another App passes; an app/ slug in any case.
  • shellcheck clean; scripts/sync-plugin-options-docs.py --check up to date; scripts/validate-plugins.sh --only guardrails clean.

Remaining

What #17208 still needs after this PR:

  • The portability CI check, #17570.
  • Owner follow-up, not in this repository: set block_lane_pr_disable_auto_app to this organization's lanes App login in user settings; until then App-opened pull requests are protected as a class.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd

kyle-sexton and others added 4 commits November 19, 2026 17:34
block-lane-pr-disable-auto named one publisher's App. It now reads
lanes_app from the repository's docs/conventions/guardrails.yaml on
origin/HEAD; unset, the guard protects no App and passes every disable.
This repository's team file sets its App.

Refs: #17208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd
The owner decision on trust values reads the lanes App login from
userConfig or managed settings, never from a file a pull request can
edit, with a fail-closed default. The team-file key is replaced by the
block_lane_pr_disable_auto_app option; unset, every auto-merge disable
is blocked.

Refs: #17208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 19, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 19, 2026 22:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T22:46:47.635988Z 65f6535 Draft marked ready
ℹ️ 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.

@github-actions github-actions 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.

claude-security-review: 1 inline finding(s) on 65f653516b2955a760e5e49950c19c7877214f2e; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 378529497338e3ac45520388a176337276cbffa4: read 5 of 5 changed file(s); 1 finding(s), 1 as inline comments.

Security review: PR #17556 (guardrails: read the lanes App login from a user option)

This was a blocking-only review: this lane already reviewed an earlier head, so SUGGESTION findings were dropped. I read all 5 changed files in full: the change fragment, plugin.json, the README, the hook and its test.

What the change does: block-lane-pr-disable-auto used to have the lanes App login melodic-automation-lanes[bot] hardcoded. It now reads the login from the new block_lane_pr_disable_auto_app user option.

What changed since the last review: when the option is unset, the guard no longer blocks every disable. It now blocks a disable only on a pull request a GitHub App opened. It decides that from:

  • the GraphQL author __typename Bot, or
  • a REST login that starts with app/ or ends in [bot].

The check is at block-lane-pr-disable-auto.sh#L326 and the block at #L335-L338.

Data flow I checked:

  • The option value is normalized with bash parameter expansion at L62-L66.
  • It is used only in a quoted literal comparison at L329 and in message text.
  • The new kindof field comes from a --jq string that gh builds from the API response. It is only compared with == Bot and never run.
  • The unreadable-target and failed-author-read blocks are unchanged and still fail closed.

Effect for the owner's sessions: with the option unset, lanes App pull requests are still blocked, because the lanes App is a GitHub App. Compared with the base, nothing is widened.

Why this is not a security issue: the guard only stops an agent from disarming auto-merge, which is the restrictive action. No token, trust list or credentialed lane is touched.

No security vulnerabilities found. The one finding is the default-deny manifest flag for the added userConfig key. I posted it again inline because its lines changed since the earlier post. It is IMPORTANT and has no exploit path.

Other checks:

  • No embedded instructions were found in the PR context.
  • Instruction-surface lens: the hook's block list is not narrowed for the case the hardcoded login covered.

critical-findings: 0

Manifest lines (1)
  • manifest userConfig.block_lane_pr_disable_auto_app: flag, added string userConfig key with no options list, so default deny flags it; it is read only in a quoted literal comparison at block-lane-pr-disable-auto.sh:329, and when unset it blocks a disable on every pull request a GitHub App opened

@github-actions github-actions 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.

claude-review: 1 inline finding(s) on 65f653516b2955a760e5e49950c19c7877214f2e; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 378529497338e3ac45520388a176337276cbffa4: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Code review: read the lanes App login from a user option (blocking only)

This lane reviewed an earlier head (65f65351), so this pass reports only blocking findings and manifest flag lines. Advisory findings were dropped.

Prior finding is addressed. The earlier inline finding (discussion_r4636362952) was that the empty default blocked every --disable-auto before reading the author, including the merge skill's disarm step on a session's own PR. That no longer happens: with the option unset, the guard now reads the author.

  • It blocks only when the author is a GitHub App: an app/<slug> or <slug>[bot] login from gh pr view, or __typename: Bot from the GraphQL node query (block-lane-pr-disable-auto.sh#L326, L335-L338).
  • A PR opened by a person passes.
  • An unreadable target or a failed author read still fails closed.

So the fix suggested last round was adopted, and I am not posting the finding again.

I checked the option parsing (L77-L81) against how the author login is normalised. Both reduce to <slug>[bot], and the unset value stays empty, so the lanes-App comparison can never match by accident.

The new tests cover:

  • an App author when unset, through both the CLI and GraphQL paths;
  • a person's PR when unset, through both paths;
  • a failed author read and an unreadable target when unset;
  • a matching App and a non-matching App when the option is set;
  • the mixed-case app/ form.

I did not run the tests. The PR body's PASS=124 is the author's claim and unverified.

PR description is out of date (not blocking). It still says the unset guard "blocks every auto-merge disable" without asking gh, and lists that as an open question that blocks merge. The code, changelog fragment, README and option description now describe the App-only behaviour. The author may want to update the body before the do-not-merge hold is lifted.

Closing issue. The PR says Refs: #17208 and closes no issue, so there were no acceptance criteria to check.

Embedded text. The PR context holds no instruction aimed at the review lane.

Loosened-check verdict: fail (lane default; the prompt has no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. There is no loosened_check_decision_record: line either, so the citation requirement was not checked. Nothing in the change loosens a check: with the option set the guard behaves as before for the named App, and with it unset it blocks more than the base did.

Spend: none. The change uses no paid resource or billing.

Advisory and manifest lines (4)
  • manifest userConfig.block_lane_pr_disable_auto_app (new field, code reads the key): pass. Read at block-lane-pr-disable-auto.sh line 77.
  • manifest userConfig.block_lane_pr_disable_auto_app (default a user who never opens settings should get): pass. Empty now blocks only App-opened PRs, and a user's own PR passes.
  • manifest version (fragment bump: minor): pass. It adds an option and makes the unset guard stricter for App-opened PRs only.
  • manifest description: pass. The option description, README row, options table and fragment all describe the unset behaviour.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 65f653516b2955a760e5e49950c19c7877214f2e. What it wrote, as data:

What it wrote (27 lines)
Summary: Refs #17208. The PR covers one part of the issue: `block-lane-pr-disable-auto` now reads
  the lanes App login from the new `block_lane_pr_disable_auto_app` option instead of a hardcoded
  login. That part is in scope. The PR body names it and names the remaining work (the portability
  CI check). The login handling (lowercased, `app/` and `[bot]` stripped, then `[bot]` added back)
  is correct. The suite covers it, and the Test Bash jobs on the head passed (for example
  https://github.com/melodic-software/claude-code-plugins/actions/runs/44631537845/job/135954927610).
  The README and the plugin.json option entries match each other. The new default is the blocker.
  With the option unset, which every consumer starts with, the guard blocks every `--disable-auto`
  and every `disablePullRequestAutoMerge`, on any pull request. Before this change, a consumer's own
  pull request passed. Now the source-control merge skill's own disarm step
  (`plugins/source-control/reference/providers/github/pull-request/merge.md:125`, per the PR body)
  is blocked for every user by default. The PR body admits this and calls it an open question that
  blocks merge. The issue requires that shipped plugins work for any user. It also records an owner
  decision (docs/owner-decisions.md#L229, quoted as "Off when unset (Recommended)") that points to a
  guard that does nothing when no value is set. Nothing tries to steer the reviewer. No binary
  files. The capture summary is missing.
- plugins/guardrails/hooks/block-lane-pr-disable-auto.sh:257 — With `block_lane_pr_disable_auto_app`
  unset, the guard blocks every auto-merge disable on any pull request. That breaks the
  source-control merge skill's disarm step (`gh pr merge <n> -R <owner>/<repo> --disable-auto` on a
  session's own PR) for every consumer by default, which goes against #17208's rule that shipped
  plugins work for any user and its recorded "Off when unset" decision. Change the default so the
  guard passes (exit 0) when no lanes App is named, or have it check only after the option is set.
  Then update the test at block-lane-pr-disable-auto.test.sh:77-79 to match.
- plugins/guardrails/README.md:4 — The README row says an unset option blocks every disable, and the
  option table (README.md:12), plugin.json `block_lane_pr_disable_auto_app` and
  `.changes/guardrails/fix-17208-guardrails-lanes-app-3f1c9a2e.md` say the same. Reword all four to
  match the corrected default.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 19, 2026
kyle-sexton and others added 2 commits November 19, 2026 21:14
…unset

The owner chose this default: with block_lane_pr_disable_auto_app unset,
an auto-merge disable is blocked on a pull request a GitHub App opened
(app/<slug>, <slug>[bot], or a GraphQL Bot author); one a person opened
passes; an author that cannot be read stays blocked.

Refs: #17208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd

@github-actions github-actions 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.

claude-security-review: 1 inline finding(s) on 378529497338e3ac45520388a176337276cbffa4; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 20, 2026
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 20, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit ed65fce Nov 20, 2026
98 of 99 checks passed
@kyle-sexton
kyle-sexton deleted the fix/17208-guardrails-lanes-app branch November 20, 2026 02:57
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant