Repository navigation
autonomy: decide whether to build a mod that approves babysit-lane actions through tool.check #6154
Description
Problem
Decide whether to build a mod that hooks tool.check and approves the babysit lane's own actions (merge, comment, resolve review threads), so auto-mode loop lanes can carry a PR to merge without a person, and if so how. This is a request for a decision with the security trade-off stated. It is not an instruction to build it.
This follows from #6152 (draft), which left this mod out of scope on purpose. Line references below are on that PR's branch, feat/5778-mod-conventions, until it merges.
Today, a lane whose action the auto-mode classifier denies records the denial in its lane telemetry and moves on (AGENTS.md, "When to stop and when to keep going"). A tool.check approval would stop that denial from happening for the approved calls. The same property is the risk.
What upstream says a tool.check approval does
Fetched 2026-10-03.
tool.checkfires after the permission rules and settings hooks have decided. The mod's hook receives their decision (allow,askordeny) and can return a different one (events: approve or refuse a tool call before the user is asked).- A mod's approval can replace an
askrule's prompt and a block from aPreToolUsehook outside managed settings. In auto mode, a call the mod approves runs without a classifier check. Deny rules hold over the mod only on a machine with managed settings or when signed in with a Team or Enterprise plan; anywhere else the mod can approve a call a deny rule refuses (permissions: extend permissions with hooks). - The built-in guard
sec-default, which enforces that deny precedence, loads only on a machine with managed settings or for a Team or Enterprise sign-in. An administrator can switch the precedence off withallowModsToOverrideDenyRules(admin: know what happens by default). The mods overview page lists "approve a tool call before you're asked" among what a loaded mod can do (overview: what a mod can reach). - ADR 0049 accepted this consequence for mods in general and recorded that the owner's Max machines have no managed settings, so the guard does not load there. It also records that this repository's two guard mods use no
tool.check(docs/adr/0049-adopt-claude-code-mods.md:37-44).
Why this needs a decision, not a build
- Lanes read untrusted issue and PR text while holding push credentials (AGENTS.md, "When to stop and when to keep going"). A lane approval mod removes the classifier from the path that handles that text.
- On 2026-10-03, during the feat(mods)!: adopt Claude Code mods and move context-guard and rate-limit-guard onto them #6152 work, the auto-mode classifier refused a probe dispatch of a
tool.checkdeny-override as "Auto-Mode Bypass". Overriding a deny rule is what the built-in guard blocks where it loads, so a design that does it is not one to build, and probing it in a lane-shaped session needs the owner's explicit approval. - Where the guard loads, deny rules hold over the mod by default, but the other gaps stay open: an
askrule, a block from aPreToolUsehook outside managed settings, and the classifier. UnderallowManagedModsOnlythe mod does not load at all, because a plugin Claude Code copies into its cache from a GitHub source, as this marketplace's are, does not count as the organization's (docs/adr/0049-adopt-claude-code-mods.md, "Packaging and loading"). - The babysit lane's merge decision lives in its own deterministic gate (
plugins/source-control/skills/babysit-loop/SKILL.md, the rung and gate sections). A mod sees only the call, not why the lane made it, so it must not become a second merge authority. Merge authority is a separate track (babysit-loop: wire inline promotion evidence into the CI pr-merge lane #4588; feat(autonomy): cut permission prompts and guard denials that interrupt autonomous lanes #5993 step 3).
Options
| Option | What it is | Trade-off |
|---|---|---|
| A. Do not build | Lanes stay on the classifier and permissions.allow rules; #5993 measures which prompts and denials lanes hit and fixes them with allow rules and exemptions. |
No new attack surface. Lanes keep stopping on denials. |
| B. Build narrow | The mod turns ask into allow only for an exact allowlist of lane calls, only in a session whose turn was not typed by a person (the module code already tells the two apart; see isPersonTurn in plugins/context-guard/hooks/register.tsx), and returns the earlier decision unchanged whenever it was deny. |
The classifier is still skipped for every approved call, so the allowlist carries the whole safety case. Loads only where mods load. A --bg launch turn reads as typed (plugins/rate-limit-guard/README.md:89), which the lane detection must handle. |
| C. Build broad, or override deny | Approve lane calls regardless of rules. | The classifier already refused a probe of this as "Auto-Mode Bypass", and the built-in guard blocks it where it loads. Not proposed. |
No option is recommended here. This is a security decision for every lane that holds push credentials, and the open questions below name the evidence that would settle it.
Open questions
- Is the classifier skipped for a call the mod only moves from
asktoallow, as the permissions page says? Evidence that settles it: a probe in a lane-shaped session on an unmanaged machine, which needs the owner's explicit approval because the classifier refused the deny-override probe. - Which exact calls would the allowlist hold (merge, comment, resolve thread), and can each be matched by tool and argument shape tightly enough that a prompt-injected lane cannot reuse the approval for something else? Evidence: the lane's real call shapes from lane telemetry (
/harness-ops:observability), which feat(autonomy): cut permission prompts and guard denials that interrupt autonomous lanes #5993's measuring step also needs. - Can a mod tell a lane session from a person session reliably, including
--bg,/loopand scheduled turns? Evidence: the turn-origin kinds in the per-build types (upstream "create: get the types for your build"). - Does the benefit exist after feat(autonomy): cut permission prompts and guard denials that interrupt autonomous lanes #5993's allow-rule and exemption work? If that clears most denials, option A may be enough.
Done when
- The decision (build or not, and why) is recorded in an ADR or in this issue.
- If build: the allowlist, the lane-detection rule, the machines it may load on, a test plan the classifier will not refuse, and a statement of what the mod must never approve (anything a
denyrule refuses, anything outside the allowlist). - If not build: the issue is closed as not planned with the reason, and lanes' permission friction continues under feat(autonomy): cut permission prompts and guard denials that interrupt autonomous lanes #5993.
Related
- feat(mods)!: adopt Claude Code mods and move context-guard and rate-limit-guard onto them #6152: the draft PR this follows from.
- feat(autonomy): cut permission prompts and guard denials that interrupt autonomous lanes #5993: nearest open issue; it cuts lane permission prompts and denials with allow rules, exemptions and guard messages, and does not consider a
tool.checkmod. - babysit-loop: wire inline promotion evidence into the CI pr-merge lane #4588: merge authority for lanes, tracked separately.
docs/adr/0049-adopt-claude-code-mods.md: the accepted consequence and the managed-settings behavior.
🤖 Generated with Claude Code
Activity
github-actions commentedon Oct 4, 2026
Thanks for the report. Automated triage handed this issue to a maintainer.
Automated triage. A maintainer reviews it.
kyle-sexton commentedon Oct 4, 2026
This was generated by AI during triage.
Triage
tool.check. Nearest items: feat(autonomy): cut permission prompts and guard denials that interrupt autonomous lanes #5993 (cut lane prompts and denials with allow rules; open question 4 here depends on its outcome) and babysit-loop: wire inline promotion evidence into the CI pr-merge lane #4588 (lane merge authority). Neither shares this exact decision, so no carrier or blocked-by edge is proposed.docs/adr/0049-adopt-claude-code-mods.md. That file exists only on draft PR feat(mods)!: adopt Claude Code mods and move context-guard and rate-limit-guard onto them #6152's branch. Main now has a different ADR 0049 (docs/adr/0049-run-ci-lanes-on-github-hosted-runners-under-trigger-and-token-hardening.md, merged in docs(conventions): add the pr-pipeline convention, config schema and lane ADRs #6139), so feat(mods)!: adopt Claude Code mods and move context-guard and rate-limit-guard onto them #6152's ADR number collides and the citations here will point at the wrong record once it is renumbered.Decision brief
Open question: build a
tool.checkmod that turnsaskintoallowfor an exact allowlist of babysit-lane calls (option B), or do not build and keep lanes on the classifier plus allow rules (option A).Evidence that would settle it (from the issue's open questions):
asktoallowmove: a probe in a lane-shaped session on an unmanaged machine, which needs the owner's explicit approval.--bg,/loopand scheduled turns.If build, the decision record must state: the allowlist, the lane-detection rule, the machines it may load on, a test plan the classifier will not refuse, and that the mod never approves anything a deny rule refuses or anything outside the allowlist. If not build: close as not planned and continue under #5993.
kyle-sexton commentedon Oct 13, 2026
Decision recorded. The owner approved applying independently verified recommendations (high-risk set, reviewed) on 2026-10-13.
Basis: https://code.claude.com/docs/en/permissions.md 'Extend permissions with hooks' lines 591-596 (fetched 2026-10-12, cache CC 2.1.296); docs/adr/0052-adopt-claude-code-mods.md:37-44; pr-pipeline: inputs from the 2,000-PRs effort, and the local-lane work waiting on deployed lanes #6202 amendment 'The wrapper is the one merge authority'; autonomy: decide whether to build a mod that approves babysit-lane actions through tool.check #6154 body 'it must not become a second merge authority'
Decide whether to build a mod hooking tool.check that turns ask into allow for babysit-lane merge, comment and resolve calls, so auto-mode lanes stop on fewer denials. Nothing is built; the issue withholds a recommendation and its nearest alternative (#5993, allow rules and exemptions) is still open.
Verification notes:
Verified by an independent fresh-context check (confirmed, risk high): gh issue view 6154 (body, 2 comments); https://code.claude.com/docs/en/permissions.md fetched 2026-10-12, lines 594-596; docs/adr/0052-adopt-claude-code-mods.md:36-45; issue 5993 OPEN, 4588 OPEN; gh pr list search tool.check (only #6152, merged)
Admission to an agent lane stays with the work-class rules and owner ratification.