Skip to content

isToolGatedAtRung

isToolGatedAtRung(options): boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/config/shell-policy.ts:931

The one rule: does rung gate this tool — i.e. must this call be decided rather than simply run? Everything else in this area is a projection of this predicate over a set of names.

  • The shell is gated whenever the shell gate is on, at EVERY rung (bypass included, so §2.5’s deny list can still fire — see the bypass arm of GthAgentRunner.decideToolApproval).
  • At the two deterministic rungs, a tool is gated when the rung’s own grant does not cover its access class (isAccessClassGrantedAtRung). At manual that leaves only the built-in READ tools free; at write, the built-in read and write tools. The write built-ins, the shell, MCP tools and custom/agent-authored tools all escalate to the human.
  • At assisted, auto and bypass nothing but the shell is gated. That split is deliberate and load-bearing, not tidiness. At a rated rung a gated non-shell call reaches the subject.kind !== 'shell' arm of GthAgentRunner.decideToolApproval, which floors it at destructive and sends it to the human with no rating call, because §4.3 keeps the rater on the shell until [[EXT-30]]. Gating there would silently turn every MCP call at assisted into a human prompt — a UX change belonging to EXT-30, not to the two rungs whose published descriptions this predicate makes true.

gateShell only ever WIDENS the result. At a deterministic rung the shell is gated by its own (absent) access class if it is bound at all, so gateShell: false does not exempt it — an exemption keyed to one tool NAME is the defect class this predicate exists to remove. In practice a disabled shell tool is never bound, so the two agree.

This takes no bound toolset, which is what lets GthAgentRunner ask it about a single arriving call: the runner sees only the names the graph registered, and a graph builder that registers tools of its own leaves them off that list. A decision that consulted a bound list would grant such a tool at manual purely because the runner could not see it.

boolean

"manual" | "write" | "assisted" | "auto" | "bypass"

string

boolean