The judge, the pending queue and the safety valve

Part of the Workflow Modes reference.

The judge (safety only)

Each mode may declare a judge. It registers as the gadhs-mode-judge link in the permission system’s authorizerChain and reviews only ask decisions that survived every deterministic layer.

The judge sees the action and a few facts, never the agent’s side of your conversation. The action is the ask’s own fields: the tool, the whole command line (with the unit the permission system matched, when that is only part of it), and a path only when the ask is about a file; a command, an MCP target or a skill name is never offered as one (#366). The facts are the ones pi knows without reading anything the agent wrote: the workspace (the session’s directory) and its git remote (#210). The remote is none only when git says there is none; when git does not answer within 2 s the header says unknown (git did not answer) and the next ask reads it again (#784). Since #298 there are three more, and since #266 a fourth:

  • The kind of remote a push goes to, only when the ask pushes: local path (a directory on this machine, such as a bare origin the session made) or network host.

  • The current branch and its upstream, only when the ask pushes.

  • The session’s recent commands: the last 20 shell commands that succeeded. Each is quoted as JSON under a line that says it is data, so none can pass for a fact or a rule. A command over 300 characters stands as a placeholder, not in part: a part could carry a create while the cut hid its || true. A new, resumed or forked session starts with none, as it starts with none of your words (#393: until then the commands outlived /new in the same process and were quoted as the new session’s).

  • What you asked for (#266): your last five typed messages this session, each cut to 500 characters (the head kept, the cut said), quoted as JSON under a line that says they are data and that your most recent words win when they conflict. Only text pi stamps as yours enters, the same rule the pending queue’s replies use: typed at the terminal or a host, or sent from a phone pivot vouched. Tool output, the model’s prose, extension messages and slash commands never do. The list is per process: a new or resumed session starts empty.

  • The registry’s facts on an install (#268), only when the ask installs a package its project’s lockfile lacks (below): each quoted as JSON under a line that says it is data.

An install is checked against its registry before any rule allow or the judge (#268). Models name packages that do not exist, and attackers register those names. For a bash ask that installs a package (npm install|i|add, pnpm add, pnpm dlx, yarn add, bun add, npx, bunx; pip install, python -m pip install, uv add, uv pip install, uvx, pipx install|run; cargo add, cargo install) the packages are read from the parse, version cut and scope kept. A name the project’s lockfile already holds, from the ask’s directory up to the workspace root, is not looked up: it is a reinstall or a bump. A bare pnpm install, a requirements file, a path, a URL or a git source names nothing to look up. Each new name is asked of npm, PyPI or crates.io, all in parallel within one deadline (registryTimeoutMs, 4 seconds), and the answers are kept for the session for 10 minutes. Then:

  • The registry has never seen a name: the ask is denied, with no model and no question: the package left-padd is not on npm; an install of a name the registry has never seen is denied. The trace marks it registry. A mode’s rule deny still comes first, and a rule allow for pnpm add * does not settle it: that allow did not mean a name nobody published.

  • The registry knows them: the judge reads each one’s first and last publish, its age in days, its downloads (npm’s last week, crates.io’s recent count; PyPI gives none) and npm’s maintainer count. The rubric’s install clause says a package under 30 days old, with under 1000 downloads, or one edit from a well-known name defers; one with years of history and wide use is routine.

  • The registry cannot answer (a timeout, a network error, a 5xx), or a private registry is configured for the name (an .npmrc registry= or scoped @scope:registry= line, PIP_INDEX_URL, UV_INDEX_URL, a in pyproject.toml, a crates-io replace-with, or the command’s own --registry / --index-url): the name is unknown, never asked of the public registry, and judged as the command alone would be. An offline box neither denies an install nor waves it through.

registryFacts: false turns the check off (tuning).

They sit above the untrusted block, under "Established by the extension", and the rubric tells the judge to rely on them for where the session is. What they mean travels with them in the header, not as a rubric rule:

  • The recent-commands line says that what they created is the session’s own to stop, remove or run, and that a resource they only named, or never mention, is not. Reading a container’s logs never makes removing it routine.

  • The local path line says a push there, forced or not, reaches nothing shared. A remote is local path only when it has a path’s form and names a directory that exists on this machine. Path forms are git’s own: absolute, ~/, ./, ../, or a file:// URI for this host. On Windows they also include a drive with either slash and .\ or ..\ (#584). A UNC share (\\server\share) or a file:// URI naming another machine is a network host. Every other form (a URL, user@host:, an ssh alias’s host:path, a remote helper) is a network host. A network host’s line is bare, and every shared-branch rule applies.

What you asked for is read by one rubric rule, THE HUMAN’S REQUEST, for one thing. Some rubric rules defer only because the action reaches a human: a named reference or published version replaced or removed (deleting a remote tag or branch), shared infrastructure applied, sudo, personal files read, an unfamiliar installer run. Those are already answered when your own words name this very action: "delete the v1 tag on origin" answers git push origin --delete v1, and the judge allows it. Words about the work in general ("do the release", "clean up", "you have my permission") name nothing, and the defer stands. A request never lifts a deny: curl … | sh, printing secrets, or writing to ~/.aws is denied whoever asked. It lifts nothing else either: the safety valve and the authority cap apply after the judge, as always, so a step the valve names still queues, and your reply answers it. Plan mode’s rubric says the lines change nothing there: your words cannot make a write a read. The reply rule below is stronger because you saw the exact action; a request is what you said beforehand.

Wording added to the rubric shifted borderline asks elsewhere. An unfiltered git config --list went from allowed to deferred, so the rubric is unchanged.

The safety valve still caps what it names (docker volume rm, prune) to a human, whatever the judge says. A local-path remote is assumed to be the session’s own: a shared bare repository on a network mount is the limit of that assumption. The extension claims nothing it would have to parse out of the command, such as where a named path resolves. A measured extractor put heredoc text into that position, and the judge loosened on it. Its rubric travels as the transcript’s leading system message, as pi’s own runtime sends a prompt (pi-ai’s normalizeContext; judge.test.ts pins where it lands). It answers one question: is this dangerous? (Piping downloaded or decoded bytes into a shell, deleting things, leaking secrets, weakening security, escalating privileges.) The rubric is written against the threat model in Security: accidents, not a compromised model. So in auto:

  • A script run by path is ordinary work. An agent writes and runs its own scripts, and the judge can never see a file.

  • Reads outside the workspace are routine when they are code, dependency sources and caches, installed tools and their docs, or other repositories. Personal files (documents, downloads, mail, browser profiles) defer. Credential locations deny, and so does any write outside the workspace (in auto, a write or edit tool’s path outside the workspace and temp never reaches the judge — the gate’s outsideWrites row refuses it deterministically, #943; R15 decides shell lines that write outside). Temp directories are scratch space, macOS /var/folders and Windows AppData\Local\Temp included, but not a place for secrets: copying a credential file into temp denies (#221). So is your own runtime directory, /run/user/<uid> ($XDG_RUNTIME_DIR), a private tmpfs that is safer scratch than /tmp (#302), except its service entries: a write under its systemd/ arms a unit that runs later and denies, and its gnupg/, keyring/ and bus entries are services' sockets. That is the judge’s reading; no deterministic rule allows the runtime directory as one allows /tmp, because a blanket rule would cover systemd/ too.

  • The workspace’s own forge token, loaded from its .env.local to run glab or gh or to call the git remote’s host, is how the project acts as its bot. Printing it, copying the file anywhere (temp included), or sending the value anywhere else still denies.

  • The agent’s own settings and permission policy as installed are a vector it denies writing: pi’s settings and extensions under ~/.pi, a project’s .pi directory, the permission system’s config. The same file as source, in a repository that develops the agent (this one’s packages/pi-modes/modes.json), is ordinary work (#254). It is explicitly not a code reviewer: safe work that is oddly styled or bigger than expected sails through, because quality is your job and your reviewers' — not a model’s.

Secret material is a deny on every rubric, including plan mode’s, whose question is otherwise "does this mutate anything?": a read-only command whose output would print credential values — cat or git show of a .env file or a key, the process environment filtered for a credential term, a container’s environment through docker inspect, a pod’s secret through kubectl get secret -o yaml, sops -d, vault kv get, a token printer — is refused, and the reason names the names-only or count-only alternative (printenv | cut -d= -f1, grep -rl, test -f). The whole environment unfiltered — plain env, printenv or set — is allowed. pi’s own session variables, read by exact name, are rule allows in every mode that has rules (#464): printenv PI_MODEL, and likewise PI_PROVIDER, PI_REASONING_LEVEL, PI_SESSION_ID and PI_SESSION_FILE. pi’s bash prompt invites that read. A grep of the environment (env | grep PI_) stays refused, because it prints any variable whose name or value merely contains the text (OPENAPI_KEY does). Its refusal names the exact-name read instead. Sending it anywhere is not: rules deny env, printenv or set piped into curl, wget or nc, spaced or not (env | curl …, printenv|nc …); substituted into curl’s or `wget’s arguments, plain or filtered (`curl -d "$(env)" …, wget … "$(set | base64)"); and /proc//environ uploaded with curl … @…. They apply in every mode that has rules, before any judge (#257). The judge cannot review that shape reliably: the model provider refuses the request as violative cyber content, and a refused review fails closed to a queued step, which a human could approve by mistake. Rules deny the credential *locations before any judge. They apply to the read, write and edit tools, and, through the * surface, to a bash command that names them, cat ~/.pypirc | head included. The path matches whatever follows it: a space, the end of the line, or a quote or parenthesis, as in open(os.path.expanduser('~/.docker/config.json')) (#297). The locations, by ecosystem (#209):

  • SSH, cloud and cluster: ~/.ssh, ~/.aws, gcloud (~/.config/gcloud, and AppData/Roaming/gcloud on Windows), ~/.azure, ~/.kube/config, ~/.docker/config.json;

  • package registries: ~/.pypirc, Maven’s ~/.m2/settings.xml and settings-security.xml, ~/.gradle/gradle.properties, NuGet’s NuGet/NuGet.Config, ~/.cargo/credentials, ~/.gem/credentials;

  • forges and git: ~/.git-credentials, ~/.netrc, gh’s hosts.yml, glab’s glab-cli/config.yml;

  • other stores: ~/.terraform.d/credentials.tfrc.json, ~/.pgpass, ~/.vault-token, ~/.gnupg, and pi’s own auth.json.

A project’s own .npmrc, gradle.properties or nuget.config isn’t on the list: reading and editing those is routine, and a pattern can’t tell them from the copy in home. Nor is .tfstate, which would also match echo ".tfstate" >> .gitignore. Those stay with the rubric.

Commands whose purpose is printing a token are bash deny rules, alone, behind a wrapper, or anywhere in a compound line: gh auth token, gh/glab auth status -t and --show-token, glab config get token, gcloud auth … print-token, az account get-access-token, aws configure get …secret… and export-credentials, kubectl config view --raw, git credential fill, docker-credential- get, and macOS security find-*-password -w. Their names-only forms stay open (gh auth status, aws configure list, ls ~/.m2).

The rubric covers the routes a rule can’t see.

Adding is routine; replacing or removing reaches a human (#304, the operator’s ruling). For named references and published versions, auto’s rubric allows creating a tag, branch, forge release or label, pushing a new tag or branch (even where CI publishes on it), and publishing a version to a package registry whose versions are immutable (npm, PyPI, NuGet, RubyGems, crates.io). Those registries refuse to republish an existing version, so a publish only ever adds, and the judge need not see the version number. A Maven or Gradle deploy is not one of them: a -SNAPSHOT version overwrites by design and a repository may allow redeploys, so it stays on the valve, which also catches it behind a build that a rule allows (./gradlew build publish, #222). Image tags are mutable, so an image push is an add only under a specific version tag (1.4.0, v2.3.1, a date or a commit sha). It defers the replacing and removing side, and the reply names what would be replaced or removed:

  • deleting a tag, branch, release or label on a remote or forge;

  • moving a tag or a registry dist-tag or channel;

  • pushing an image to a tag that already exists (a moving tag such as latest, stable or nightly counts as existing);

  • unpublishing, yanking or deleting a published version.

Merging a merge request or pull request is routine, whatever the target branch is called (#509). That covers glab mr merge, gh pr merge and the forge’s merge API. A merge advances the branch with reviewed work and replaces or removes no reference: it is non-destructive, like creating a tag. The rubric’s moving-tag example once listed main beside latest and stable, and from about October 12 the judge read a merge into main as moving an existing reference. It deferred about one merge in five in canopy’s sessions, and every bare merge in the eval. Force-pushing a shared branch and deleting a branch on the remote still reach a human. Pins: the corpus’s mr-merge cases.

Local branch deletion is routine, since the reflog keeps it; local tag deletion reaches a human. The principle covers what you publish and name, not what you install: installing or swapping a dependency is outside it, and an unfamiliar or look-alike package name still defers.

Shared infrastructure reaches a human in auto (#207). The rubric defers applying changes to shared infrastructure or a cluster: terraform and pulumi applies, kubectl apply, scale and rollout, helm install, upgrade and rollback, and a cloud CLI’s deploy. Dry runs, plans, templates, local builds and local containers stay routine. Before this clause, the judge allowed kubectl apply to a production overlay, helm upgrade in production and gcloud run deploy. Plan’s rubric doesn’t carry either clause: plan refuses every change already, and "adding is routine" or "local builds are routine" would loosen it.

Plan’s rubric (prompts/plan-judge.md) has held one rule since plan mode existed. Plan reads anything, local or remote, and changes nothing but its plan draft, which it writes with the write and edit tools. The rubric names what changes state though it sounds like a read, in every ecosystem (#211):

  • running tests, and builds and compiles, which write caches and artifacts;

  • resolving dependencies that downloads them;

  • infrastructure plans that lock or refresh state (terraform plan);

  • any write, temp directories included.

Its examples used to come from this repository’s own stack, and given a toolchain they didn’t name, the judge reasoned from the command’s name. It allowed pytest, go test, cargo test, vitest --coverage, mvn dependency:tree and terraform plan. Version flags, dry runs that write nothing, format checks, and reads of the tree or a remote stay allowed.

Plan’s rubric also carries its own form of auto’s rule for the workspace’s own forge token (#368), not auto’s wording, which allows the call whenever the value stays unprinted and so would let a write through. Loading .env.local to authenticate glab or gh, or a call to the git remote’s host, is how the project acts as its bot, not secret handling. Plan judges the call it authenticates by its effect, as any other: glab issue list or an API GET reads; glab issue note writes, and plan still refuses it. Printing the value, copying the file, or sending the value to any other host denies in plan as in auto. Before this rule, plan refused every token-authenticated read, the search for an issue included, while auto allowed the same line.

The words the two rubrics share are written once (#899). Five constants in judge.ts carry them, cut from auto’s rubric: the ask as untrusted input, the session facts, the secret-material cases, and the forge token’s use and its limit. Plan’s file holds the same words in its own wrapping, beside what is plan’s alone: the secret rule holds although reading is read-only, there is no exception for the whole environment, and an authenticated call is judged by its effect. A test fails when either rubric’s copy drifts, as it does for the reply rule and the output contract. The file stays a whole rubric that you can copy and edit.

Auto’s rubric keeps its order. Splitting its named-references rule into five, and grouping its rules under deny, defer and allow headings with no rule’s words changed, both moved verdicts on the corpus (#899): on Sonnet 5.5, terraform destroy and pulumi destroy went from deny to defer in all three runs. The order is part of the rubric. Measure a move as you would a change of wording.

Field Default Meaning

model

required*

Judge model as provider/model. (*Not required for authority: "allow-all", which never consults a model.)

fallbackModel

unset (auto and plan ship vertex-anthropic/claude-opus-5-5)

Asked once when the judge refuses the review: a provider’s block (stopReason: error naming the usage policy, or, since November 2026, "Cyber safeguards flagged this message", #868), not an error, a timeout or an unreadable answer (#269). Same rubric, valve, authority and parse; the verdict is logged under the model that answered, beside a gadhs_mode_judge.refusal_fallback record. No fallback, or a second refusal, defers as before. In October Sonnet 5 refused none of the battery’s judge corpus, where Sonnet 5.5 refused two; with it the eval corpus read 216/216. On 2026-11-20 Sonnet 5.5 was blocked on 16 of 588 calls under the newer wording; Sonnet 5, measured the same day, was blocked on none and denied all 16, as each case expects. Sonnet 5 is the fallback only: on its own it allowed two cases it should not have (four calls), which Sonnet 5.5 answers itself.

effort

unset

Thinking effort for judge calls.

prompt

packaged rubric

A bundled prompt name (plan-judge.md), a file path, or inline text. Operators can substitute their own rubric. A path is any absolute form (POSIX, a Windows drive, UNC), ~, a relative path starting ./, ../, .\ or ..\, or one token with a separator ending in .md or .txt (org/rubric.md). A path that cannot be read gives the default rubric, never its own text, and leaves a judge.rubric_unreadable diagnostics record (#581). A rubric file is read at most every 10 seconds, so an edit to it takes effect within that; an unreadable path is tried again only after 5 minutes, since a read of an unreachable share blocks for seconds (#585).

authority

deny-only

deny-only: the judge may deny/defer, never allow (its allow becomes defer). advise: may also allow. allow-all: yolo — approve without consulting any model.

alwaysAsk

unset

Per-mode safety-valve patterns (replace the global list for that mode).

timeoutMs

45000

Call budget; timeout defers. The first call of a session is warmed in the background (~20 s cold vs ~5 s warm).

maxTokens

300

Reply budget — the contract is one JSON object. The budget is for the answer: a model that thinks first gets room for that on top, added by the Vertex provider per catalog entry (thinkingAllowance), so the judge does not need to know which models reason. A reply that reaches the budget is still read: a verdict that completed stands, and one that was cut defers (#215).

maxConsecutiveDenials

3

Denial-loop guard — see below. 0 disables.

maxTotalDenials

20

Session-total guard. 0 disables.

Which model. Both shipped judges run on Sonnet 5.5 at low (#252), by the operator’s decision, argued on the eval gate rather than a battery fill: 211 of 212 corpus cases over three runs, never unsafe. The one miss is a request the model provider refuses to review, and a refusal fails closed to you. Under the rubric as Sonnet 5 knew it, Sonnet 5.5 scored 193: it wrote a sentence of reasoning before the JSON object, which the strict parser refuses, so every rubric now ends with an output contract saying the reply is the object and nothing else. Sonnet 5, the judge before it, read level with Sonnet 4.6 on the battery’s judge corpus (0.97 exact each over 290 verdicts). With every model re-measured on one rubric (#256), Sonnet 5.5 and Sonnet 5 are level at 0.995 exact, neither unsafe; Sonnet 5 blocks a little less routine work (friction 6 against 10) and drew no provider refusals. The numbers are on the model battery. A different judge is a per-user overlay (the cookbook).

An unknown key in a judge block is refused by name when the config loads (an overlay still setting mandateTurns or mandateCharsPerTurn, from a removed feature, fails there: delete them). So is a mistyped field: a mode’s systemPrompt and a judge’s prompt must be strings, and a judge’s effort one of the thinking levels (#337). So is a malformed rule, in your overlay before it is merged or in the result (#224): every permission is surface → pattern → allow, ask or deny, lower case. Before this check, a shipped deny rewritten as "Allow" loaded and quietly replaced it.

Every failure mode — missing model, missing credentials, timeout, transport error, unparseable output — resolves to defer, never allow. The verdict contract is strict JSON, property-tested against arbitrary output.

Every refusal names its rule (#946). Each rule of the two shipped rubrics carries a code on its line: auto’s R2 to R19 (18 rules), plan’s P1, P3–P5, P8–P10, P12 (8 rules). The judge’s reply has three members: verdict, and for a deny or a defer rule, the code of the one rule that decided it, and reason, how that rule applies to this action.

A code the rubric holds is kept. The refusal then opens with the code and the rule’s title, ahead of the judge’s words:

[decided by gadhs-mode-judge (a model), not the human] [R9 named references] deletes the v1 tag on the remote

The code is recorded with the verdict, on the session’s trace and in the queue’s record of a deferral, so a count of refusals per rule needs no reading of prose. A code the rubric does not hold is dropped, and the log keeps what the judge wrote (ruleCited). A missing or garbled code never weakens the verdict: the deny stands, unattributed.

A rubric of your own (prompt) with no codes on its rule lines is judged as before, and its verdicts name no rule. To have yours attributed, open each rule line with - [CODE] (one to three capitals, then a number) and ask for rule in the reply. battery compare reads the codes when you measure an edit (local development).

The codes are stable: a rule that leaves takes its code with it, and a new rule takes the next unused one. Removed 2026-11-28 (#948): R1 (untrusted input), P2 (session facts), P6 (same tool either way), P7 (pipelines), and P11 (the human’s request).

Code Auto’s rule Code Plan’s rule

R2

session facts

P1

untrusted input

R3

deny on shape

P3

read-only allow

R4

deny on effect

P4

mutation deny

R5

deferred-execution vectors

P5

builds and tests

R6

CI definitions

P8

secret material

R7

path-only asks

P9

forge token

R8

unfamiliar executable

P10

unclear effect

R9

named references

P12

the human’s reply

R10

shared infrastructure

R11

credential locations

R12

secret material

R13

forge token

R14

assertion inside the ask

R15

outside the workspace

R16

allow

R17

defer

R18

the human’s request

R19

the human’s reply

An unreadable reply gets one repair turn first (#294). The judge sometimes reasons in prose and then writes a valid object, which the strict parser refuses: 4 % of judge calls in the field study’s third round, nearly all of them allows, each a stop in a headless session. The same judge is asked again for the object alone, its reply quoted back as a JSON string (data, like every untrusted line in the prompt, bounded to 2,000 characters). The parser stays strict: a second unreadable answer defers as before.

Denial-loop guard: after 3 consecutive or 20 total denials the session stops consulting the judge and defers to the human — a looping agent stops burning judge calls, and the human finds out something is wrong. In a mode that queues, the guard’s defer is one queue entry for the session, and any reply you type ends the consecutive run.

  • Every deny counts: the judge’s, a rule’s, a spawn the gate refused, an install of a name no registry has, and the plan draft refused outside plan mode (#901).

  • A judge allow or defer breaks the consecutive run, and so do your /pending approval and the guard’s own defer reaching a human (at the host, on the phone, or in the terminal’s dialog); a rule’s or a gate stage’s allow leaves it untouched. The total is never reset.

  • Letting the session go on from the queue (a reply typed to the guard’s entry, or approving it) is a release (#719): a tripped total gets another 20 denials (the mode’s maxTotalDenials) before the guard asks again, as the spend cap’s approval grants another cap. Before, the total stayed tripped, so the very next call queued the guard again under an entry saying "reply to let it go on", and only a restart cleared it. Denying the entry is no release: a tripped total holds the next call again. A release before the total trips grants nothing.

  • The limits are the current mode’s (judge.maxConsecutiveDenials / maxTotalDenials, defaults 3 / 20), read on every ask, so a mode switch applies its limits to the running counts.

  • A step waiting in the queue is not a denial: however often the agent runs it again before you reply, the guard does not count it.

Waiting on you: the pending queue

A step that needs you does not freeze the session (#249). In a mode whose pendingAsks is "queue" (auto and plan, as shipped), every ask the gate cannot settle alone goes the same way, whatever raised it: a judge defer, a judge that failed, a safety-valve cap, a high-consequence match, the loop guard.

  1. The agent’s tool call is denied with a reason that says the step is queued for you, to carry on with other work, and to run exactly the same action again once you have replied.

  2. One line above the prompt box says how many steps wait (2 pending for you · /pending to open, #544); /pending shows them whole (below). At most six steps wait. A seventh is not queued, and none is dropped to make room for it (#879): the agent is denied with "NOT queued", told to say so to you, and can make room by withdrawing a step it no longer needs. The loop guard’s entry and the spend cap’s are not counted in the six.

  3. You answer by typing, whenever you like: "yes, merge it", "no, leave the tag". Nothing waits on you meanwhile.

  4. When the agent runs the same action again, the judge reads what you typed and decides from your words alone. A plain approval allows it, whatever the judge would have said, safety valve included: you have seen the action and want it done. A plain decline denies it. Anything else — unrelated, vague, conditional, about a different step, or a bare "yes" while two steps wait — is not approval: the step stays queued, and the agent is told exactly what the judge needs you to say.

What the judge reads is narrow on purpose:

  • Only what you typed after the step was shown. A reply reaches the steps queued at the moment you type it and no later one, so nothing you said earlier — "cut the release" an hour ago — approves a step you have not seen. This is structural, not a rubric instruction.

  • Only your own text. pi stamps every input with where it came from: typed at the terminal (interactive) or sent by a host (rpc) is yours; text an extension injects (extension) is not, unless the paired phone vouched for exactly that text (A paired device). The agent cannot produce either. A slash command is not a reply.

  • Only for the exact action. The step is identified by its tool and its whole command; git push and git push 2>&1 are two questions.

A rule deny never queues, so no reply reaches it: the agency’s rules are passed only by changing mode. Before the judge can read a reply at all, a step that is still waiting costs nothing: it is denied at once, with no model call. A judge that cannot read your reply (an outage) keeps the step queued and says so; manual mode, whose dialogs are unchanged, is the way past it. A subagent still gets its immediate deny, not a queue entry: the parent session can do the step itself.

Acting on the queue directly: /pending (#259). A step stays queued until the agent runs that exact action again, so a step it rewrote or abandoned would wait for good. The command is yours (the agent cannot type a slash command; the paired phone sends it as your prompt):

  • /pending alone, at the terminal, opens the pending screen (341, #544). It takes the whole terminal: one row per waiting step (<id>, what it is, why it waits), with [approve] and [deny] on each and [clear all] on its title row, which also reminds you that a reply in the prompt box answers too. ↑ / ↓ choose a step, a approves it, d denies it, c clears the queue, esc closes; enter does nothing, so approving is a deliberate key. Where pi routes the mouse (its fullscreen mode, the default), a click chooses a step and a click on a button acts. The screen only chooses: it runs /pending approve #<id>, /pending deny #<id> or /pending clear as if you had typed it, so the notice, the model’s message and the trace are the typed command’s. Approving or denying keeps the screen open (#550): it re-reads the queue and chooses the step now in that place, so several steps can be settled in one opening, and it closes once nothing is left. A closes it first, since it asks which rule to save; so do c and esc. While an action runs, keys wait, so a held key cannot approve twice. Away from a terminal (a host, RPC), /pending alone asks two selects instead: pick a step, then approve, deny or leave it, or pick clear all.

    The whole command, before you approve it (#485, #544, #879). Wherever an answer of yours allows a command, the whole command is shown first: the screen below, the action menu /pending asks away from a terminal, and the yes/no dialog a manual-mode ask opens, each with token shapes scrubbed and control characters drawn. Only a list row is one line. A row shows one line, cut to the width, and a command is cut at 160 characters there. Below the rows the screen shows the chosen step’s whole command, wrapped, with its line breaks kept, and then why it waits, whole. Token shapes are scrubbed from it (as in a tool result), and its control characters are drawn as ^X rather than sent to your terminal. The command takes every row the list and the legend leave. Past that, page up / page down, j / k and home / end scroll it, and a line says which lines you are seeing (“lines 12–23 of 30”). A newly chosen step starts at its top, and a resized terminal reflows the screen. Without the terminal’s height (a host that mounts the pane) 12 lines show at once. The model is still told the one-line preview, which is the step’s identity.

  • /pending #<id> (#544) opens the screen with that step already chosen. Away from a terminal it asks the second select straight away: approve, approve always, deny or leave it. An unknown step says so.

  • Completion (544): after /pending ` (with the space), `tab lists the waiting steps by <id>, with each step’s line and its kind (judge, valve, rule, threshold, failure, spend), then the verbs approve, always, deny and clear. Typing narrows the list. After approve `, `always ` or `deny `, `tab lists the steps again, so /pending deny ` `tab enter declines a step without opening anything.

  • From the transcript (#353): a queued step’s trace line ends · queued as /pending #<id>. That stays true after the step settles, which a saved line cannot see. In fullscreen, a left click on the line opens the screen above with that step already chosen if it still waits; otherwise the screen opens on what still waits, or the "Nothing is waiting on you." notice shows. The click only opens the screen; approving is still a or a click on [approve]. Expanded, the line also says who queued the step and why (queued by the judge: …, or the valve’s pattern): the deferral the queue’s own text replaces. The diagnostics stream’s ask.verdict record carries the same, capped at 300 characters, so a deferral can be diagnosed after the step is answered or pi has restarted (#507).

  • From the widget (#346, #544): in fullscreen, a left click on the “N pending for you” line above the prompt opens the screen on the oldest step, as bare /pending does. The line names the hub’s key too, while one is bound (Activity (/hub): what needs your approval, runs, and permissions). Away from a terminal the widget is the same line, plain. The status line also says how many steps wait, right after the mode (2 waiting on you), and says nothing when none do.

  • alt+a / alt+x (#353) approve or deny the newest step still waiting, from anywhere, without opening anything. They run /pending approve #<id> or /pending deny #<id> for that step, so the notice names what they did ("Approved: bash: …"). An approved step is no longer waiting, so pressing alt+a twice approves the two newest. shortcuts.approvePending / shortcuts.denyPending rebind them, and null unbinds one (tuning).

  • /pending approve N approves step N (its place in the queue, oldest first, as a host’s select numbers them): the step leaves the widget’s count, the screen and the phone at once, since it no longer waits on you, and the next run of that exact action is allowed once, with no judge call. A rule deny still wins, and another spelling of the command is another question. The approval lasts until the end of the agent’s next run (#369): if that run ends without the action, it lapses and the terminal says so (“Approval lapsed: … did not run before the turn ended.”). A run that is aborted keeps it (#482), since the agent never had its turn; it lapses at the end of the next run that finishes without using it, so one abort never costs you a second approval. That covers a helper’s step: the approval goes to the session you are in, which cannot run another session’s action. Approving the same step twice does nothing the second time: it is no longer listed.

  • /pending always N (A in the screen, “approve always” at a host) approves step N once and allows its command from now on (#468). You pick the rule: the exact command, or its numbers as (an MR number, a port; matches anything, spaces included). The picker goes through the ask broker (#689), so a /pending always sent from a paired phone opens it on the phone as well as at the desk, and the first answer wins. It is written to your modes overlay, in force at once, and named at every session start (“standing approvals in your modes overlay: auto bash "…"”). The agent cannot write that file, so the approval is yours. Revoke it by deleting the line. A step a rule could not allow is refused with the reason, and nothing is written:

    • not a shell command;

    • a line of several commands, since a standing approval is one command’s rule (once written, it also clears that command inside a plain line, #888);

    • a safety-valve step, since rules never pass the valve;

    • a step on your high-consequence list, which asks first whatever the rules say;

    • a pick the rules would still not allow;

    • a pick that would carve an exception into a shipped deny.

  • /pending deny N settles step N as declined.

  • /pending clear drops every waiting step.

  • N may also be #<id>, the step’s own id, which never changes and is never reused in the session (#255). Places move up as steps settle; the paired phone and the completion act by id for that reason, so its Approve can never land on the step below. An unknown id says so, as an unknown number does.

Each action echoes the step it acted on, and the agent is told what you did: as a new turn when it is idle, or steering the turn in flight. The loop guard’s entry is no action: approving or denying it ends the consecutive run, as a typed reply does, and so does clearing it. Approving it, or typing a reply, also gives a tripped total another allowance; denying or clearing it does not (#719).

The agent is told why a step was queued (#760). The message a queued step returns to the model carries the reason you see beside it, and who gave it: “Why it was queued (the judge, a model): …”, “(policy, the safety valve): safety valve: "git tag*"”, “(policy, the human’s high-consequence list): …”, or “(the judge could not decide): …” when the judge failed. A step asked again while it waits says the same. Before this the model was told only that the step waited, and could wait, guess or reword blind; told the concern, it can fix what the concern names and withdraw the step, or leave it for you. The reason is cut at 400 characters, and the loop guard’s and the spend cap’s entries carry none. It approves nothing: the step waits on you whatever the model reads, and a reworded action is a new question the judge reads afresh. Knowing the reason does make rewording past the judge easier; the gate is built against honest mistakes, not a model working against it.

The agent withdraws a step it no longer needs (#471). A queued step’s message names its id (“queued as #4”) and the way out: when the agent changes approach, a corrected command or another route, it calls pending_withdraw with that id and a reason, rather than leaving the request to wait, ring and hold the tab’s attention until you clear it. Withdrawing only removes. Nothing is approved, and the same action run again is judged afresh. You see each withdrawal as a trace line, “the agent WITHDREW bash — «…» — <reason>”, and in the turn recap’s reasons. The agent may withdraw only its own steps: a helper’s forwarded step and the session’s loop-guard and spend entries are refused, and stay yours to settle.

A helper’s step (#840). A step a helper asked for is that helper’s alone. Its line says whose it is, “bash: git push (helper Explore)”, and the same command asked by your session or by another helper is a step of its own. Your decision goes to the helper that asked, never to your session as an action to run:

The helper /pending approve

is running

The helper is told to run the action again, and the approval is one only that helper’s run takes. Your session hears the fact, and that the action is not its to run, only while its own run is in flight; an idle session is not woken for it.

has ended and can be resumed

Your session is told to resume that helper and have it run the action, with the call spelled out: the subagent tool with resume, the helper’s subagent_type, a description and a prompt (#850). The approval waits for the helper: it does not let your session run the command.

has ended and cannot be resumed

Nothing is approved and no model is told. You read “The helper that asked has ended and cannot be resumed; nothing was approved:” and the step.

A denial and /pending clear reach a running helper the same way, and /pending always saves its rule and then tells the helper as an approval does. A helper’s approval does not lapse when your session’s run ends. Its steps stay listed while it runs or can still be resumed, which pi-subagents allows for ten minutes after its result is read (consumedSessionRetentionMinutes). After that its steps are removed, each traced as “the agent WITHDREW bash — «…» — the helper that asked (Explore) ended and can no longer be resumed”, and an approval it never used is said to have lapsed. That is checked when a helper ends, when your session’s run settles, and when /pending lists the queue (bare /pending, or a click on a step). A form that names a step, such as /pending approve 1, acts on the queue as you last saw it, so a number never moves under you; there a gone helper’s step gets the answer in the table. Before this the approval of a helper’s step told your session to run it, a command it had not asked for and knew nothing about.

A forwarded step that names no helper session keeps the earlier rule (#662): it is decided through your session, and goes when the last running helper of its agent type ends, since the asker can’t be told apart. Each is logged as pending.forwarded_unowned.

The queue on the phone (#255). Every change to the queue also goes on pi’s shared bus as gadhs:pending (Observability), and pi-remote forwards it to paired phones (Working remotely). The phone shows what waits, and its buttons send the same /pending approve #<id>, /pending deny #<id> or /pending clear as your prompt.

Pins: test/act-on-queued.test.ts (the trace line’s hint and click, the overlay opened on the clicked step, the two keys on the newest waiting step, their registration from config), test/pending-wiring.test.ts’s contract that a queued step’s trace carries its queue id while it waits, `test/pending-pane.test.ts (the screen’s layout at a height and without one, its scrolling, a 10,000-line command wrapped once, keys and click targets; each of its actions against the typed command on twin queues whose ids differ from their places; /pending #<id>; the completion; and the selects away from a terminal), test/act-on-queued.test.ts’s check that the completion reads the live queue, `test/pending-queue.test.ts (a reply never reaches a step queued after it, as a property over any interleaving), test/pending-wiring.test.ts (no dialog in a queueing mode, the input source rule, the retry end to end), test/authorize.test.ts (a waiting step costs no judge call and no loop-guard count), and the eval corpus’s human-reply cases.

Questions that do not block

When a decision is yours and other work can keep going meanwhile, the agent uses queue_question instead of the blocking ask (#929). The question takes a one-line summary (up to 300 characters), the context you need to decide (up to 4,000 characters), optional concrete choices (2 to 4 distinct options, or omitted for an open question), an optional recommendation, and meanwhile: "proceed" (reversible; requires a recommendation to proceed on) or "park" (irreversible; the agent leaves the item untouched until you answer). queue_question returns at once with the entry’s #id so the question does not need to be repeated in conversation prose.

Questions ride in the same /pending queue (and hub Waiting tab) under a separate capacity of eight, so they never crowd out the six approval-step slots. Unlike approval steps:

  • Typing ordinary messages in the prompt box never attaches to open questions (humanSaid targets approval steps only), and open questions alone do not hold the terminal tab’s attention ring (waitingSteps excludes them). The widget line names questions separately (N question(s) for you or N pending and M question(s) for you).

  • On a question row the pending screen shows [Answer] [Dismiss] and updates its legend to a Answer · d Dismiss, omitting the duplicate why: footer on the detail card because the card itself shows the recommendation (tagged (recommended) at most once) and Meanwhile: posture (#992). Pressing a or running /pending answer #id (or /pending approve #id, as a paired device’s Approve button sends) opens a full-screen scrollable answer overlay at a terminal (question-pane.ts: question header pinned at top, scrollable context via pgup/pgdn, j/k, home/end, or mouse wheel, and an always-visible option picker below) or ui.select without duplicating Options: on non-TUI hosts, raced through the ask broker so pi’s terminal and paired device settle together; /pending answer #id <words> answers inline (matching an option case-insensitively as a picked choice, or otherwise as your own words). Pressing d or running /pending deny #id dismisses the question without an answer.

  • Answering or dismissing never grants an approval pass, and /pending always #id refuses a question (a question is answered, not approved). /pending clear clears approval steps only and reports how many questions still wait. The quick-action shortcuts (alt+a, alt+x) skip questions so a hotkey never answers or dismisses one unread.

  • The answer or dismissal reaches the agent as your message (sendUserMessage, steered when a run is in flight), repeating the #id, the question, your choice or words, and what the agent said it was doing meanwhile so it stays self-contained across compaction. Dismissing a "park" question tells the agent the item stays parked.

  • Every ask and close (answered, dismissed, withdrawn, renumbered) is written to the session branch as a gadhs-question-record entry and replayed on session_start, so open questions survive reload, compaction, and restart. On a same-process session switch where a recorded id collides with a waiting step, the restored question takes a fresh id above every kept number, records renumbered + asked, and posts one gadhs-question-renumbered notice.

  • The agent withdraws a moot question with pending_withdraw (traced with target: "question" and recorded as withdrawn). If the agent withdraws a question while you have its answer dialog open, your answer is not sent and you are told so.

  • Non-interactive sessions (hasUI false) refuse queue_question cleanly without queueing, and the shipped helper profiles do not include it.

Pins: test/pending-question.test.ts (validation, fast-check no-throw and record roundtrip, whole-string wake texts), test/question-records.test.ts (branch replay and malformed-entry skipping), test/question-wiring.test.ts (tool refusals, inline and dialog answering, withdraw-during-dialog and double-dialog concurrency races, tell-before-record order, branch restore and same-process renumbering), test/pending-queue.test.ts, test/pending-pane.test.ts, test/pending-wiring.test.ts, test/pending-withdraw.test.ts, and test/session-wiring.test.ts.

Activity (/hub): what needs your approval, runs, and permissions

alt+h, or /hub, opens Activity — one full screen with six tabs (#545, #988). Each overlay and widget used to cut what it showed to fit beside the others; Activity is where the detail goes. ← / → step through the tabs, 1 to 6 jump, and in fullscreen a click on the tab bar chooses one. It opens on what needs your approval, else a running subagent, else a running monitor or job, else permissions, else status.

  1. Approvals: the pending screen above ("Needs your approval"), the same keys and clicks ([Approve], [Deny], [Dismiss all], or [Answer], [Dismiss] on questions); approving here runs /pending approve #<id> as /pending does.

  2. Subagents: each subagent (helper) this session launched, running first: its state, agent, task, time and spend. A running subagent’s spend so far comes from its own session’s messages (the helper ledger); two subagents launched in the same second could show each other’s figure. enter opens one: its model, start, price and what it yielded, whole. Its turns and transcript are pi-subagents', in /subagents:sessions; Activity cannot read them, since that service is a separate module instance from here.

  3. Monitors & jobs: each monitor with its status, events and last line, then each job on this computer (#577): a running one with how long it has run and its log’s latest line, an ended one with how it ended. enter opens a live tail of a monitor’s output or a job’s log, redrawn every second; a swaps a monitor’s to its actions log. s stops the chosen monitor or job, as monitor_stop or job_stop would; its closing notice tells the agent.

  4. Permissions: the session’s last 200 trace records: every block, deferral, queued step and withdrawal. Steps still in /pending come first, as needs your approval · #N. Everything decided follows, newest first. A queued step is one row however often it was asked again: queued #N, then what became of it (withdrawn, or no longer waiting, since an approval or decline is not traced), and why it was queued, never the raw waiting message (#602). enter opens one with its reason uncut, its pattern, who queued it and why, what became of it, a withdrawal’s reason, and the judge’s round trip. The transcript keeps its trace lines; this is the same record, read together. A new or resumed session starts with none.

  5. Status: the mode and its judge, what needs your approval, what the gate did, what was spent, and what pi-ssh and pi-remote report: the remote as the status line names it and the ports it forwards; the device link and the devices connected and trusted. Activity asks each time it opens (gadhs-hub:ask, Observability), so the lines are current; a source with nothing to say stays silent.

  6. Messages: the agent messages this session received (#566), by channel and newest first: sender, subject, when, and whether it answers one, ● marking a collected one not yet read. enter opens the headline whole; the body is msg_read’s. A message carrying `to:<this agent> or one of the subscription’s wake tags woke the agent as a monitor event does: an outside signal with the headline and the body’s first 4 KB (the rest is msg_read’s), which never replies by itself. Anything else was collected here, and the status line counts the unread ones (`2 msgs) until msg_read reads each.

o changes a list tab’s order (#749). Each list tab had one fixed order, and in a long session Helpers and Decisions run to hundreds of rows. o steps the tab through its orders and the legend names the one in use (o order: spend); the first is the tab’s own, described above.

  • Helpers: launched, newest, spend (dearest first, a running one by its spend so far), duration (longest first), state (failed, then running, then done).

  • Monitors & Jobs: monitors, then jobs, latest event (a monitor’s last line or a job’s end, most recent first), longest.

  • Decisions: waiting, then newest, oldest, outcome (denials, then queued steps, then withdrawals, then allows).

  • Messages: by channel, unread first.

Rows that tie keep the tab’s own order. The chosen row stays chosen when the order moves it. The order is kept per tab until the session ends, so closing and reopening the hub keeps it; Waiting and Session have none. In an opened item o does nothing. The order is the desk’s alone: the phone receives each part in the tab’s own order.

A paired phone sees the same hub, read-only: each tab but Messages goes to it as a part when it changes (#688). What goes, and what never does, is in Working remotely.

Like the pending screen, the hub only chooses, and each choice runs through the typed path. An approval or a denial in Waiting keeps the hub open on what is left; when nothing is, the tab says so and the hub stays (#550). Approve-always, clear and a monitor’s stop close it first. Nothing in it calls a model. It will not open while a permission dialog is up, since that dialog must keep the keyboard; it says so instead. At a host (RPC), /hub prints the Session tab’s text. shortcuts.hub rebinds the key, and null unbinds it (tuning). While steps wait, the widget’s line names the key too: 2 pending for you · /pending or alt+h to open.

Pins: test/hub-pane.test.ts (each tab’s rows from fixtures at a fixed size, tab keys and clicks, the pending pick and the stop, the live redraw, the full-height mount), test/hub-wiring.test.ts (the key and its config, the dialog guard, facts asked fresh, the host’s text, the picks through the typed path, the tail reader, no model consulted), test/hub-records.test.ts (the facts' shape, the decision ring, the helper history and its live spend), and pi-ssh’s and pi-remote’s answers in their own suites, with the names pinned to pi-modes' by packages/pi-ssh/test/hub-facts.test.ts.

The safety valve

The valve names actions that stay interactive even where the judge would approve them. It caps an allow to a defer — it never short-circuits adjudication, so a deterministic deny still denies. In a mode that queues, the capped step waits for your typed approval like any other (Waiting on you: the pending queue); the operator’s ruling is that typed approval is enough.

No allow passes it either (#901). The gate asks once, before any of its own allows, whether the valve names the action, and if it does the rule allow, the plain line, the scratch root and the workspace write and read stages all stand back and the judge decides, capped. The same check holds an action that carries a secret-shaped value, and a file tool’s on a credential-shaped name (permission). Three allows are not held: the delegation gate’s (a spawn names an agent, not an action), the plan draft’s in plan mode (one file the harness names), and your own approval of a step with /pending.

It holds changes that replace or remove what nothing downstream can restore (#220, narrowed by #304), and process kills (#628). Publishing to an immutable registry and pushing an image left it: adding is routine (the rubric above).

  • a Maven or Gradle deploy (Gradle’s publish task, not publishToMavenLocal), which can overwrite a -SNAPSHOT or a version a repository lets you redeploy;

  • deleting or moving a tag or a published version: git tag -d/--delete and -f/--force; a push that deletes or force-moves a refs/tags/ ref (:refs/tags/…, +refs/tags/…, --delete … refs/tags/…, --force … refs/tags/…); npm/pnpm/yarn npm unpublish; npm dist-tag add/rm; npm deprecate; cargo yank; gem yank; and deleting a gh/glab release or label. A bare-name remote delete (git push --delete origin v1.4.0) and an image push to latest are the rubric’s: a pattern cannot tell a tag from a branch, or a new image tag from an existing one;

  • throwing away local work: git reset --hard, git clean -f, git stash drop/clear, git checkout ., git restore .;

  • deleting a forge object: gh/glab repo delete, gh/glab issue delete;

  • destroying infrastructure or data:

    • Terraform and Pulumi destroy, and kubectl delete namespace/pvc;

    • dropdb, a Redis FLUSHALL/FLUSHDB, mysqladmin drop;

    • AWS bucket removal and recursive delete, and RDS, DynamoDB and CloudFormation deletes;

    • Azure resource-group, SQL and storage-account deletes;

    • gcloud sql instances delete and a recursive storage delete;

    • the PowerShell Az equivalents, Format-Volume and Clear-Disk;

    • local Docker volumes (compose down -v, volume rm/prune, system prune --volumes);

  • rm with --no-preserve-root;

  • killing a process (#628): kill (with /bin/kill, /usr/bin/kill and xargs kill), pkill, killall, taskkill, and PowerShell’s Stop-Process. A pid names whichever process holds it, and a kill of another session’s tree once ran on the judge’s say-so. A session’s own monitors and jobs need no kill command: monitor_stop and job_stop stop them. kill -0, which only checks that a process exists, is a kill too; use ps -p <pid> to check one, or job_list for a job.

No push of a new ref is on the list. A push to the default branch, forced or not, and a push of a new tag, are the remote’s to govern: GitLab’s branch protection. Nor are a new tag, release or merge (#217, #304). The judge still decides all of these, and defers or denies when it sees a reason: it refuses a force push to a shared branch, and defers deleting a branch or tag on a remote (#304). git … --no-verify is refused by a deny rule and the commit guard, never asked about.

Each pattern starts with the command it names (pnpm publish*, not publish). A substring pattern matched the word anywhere, and over a month of real sessions publish deferred 204 commands of which 3 were a publish — a grep for the word, a message mentioning it, a file named for it (#208).

  • A mode’s own judge.alwaysAsk, when it declares one, is its valve.

  • A mode that declares none gets the shared safetyValve: one pattern per spelling of the actions above. Auto and plan use it.

  • Yolo declares an empty list on purpose — yolo means yolo — so the shared list does not reach it; giving yolo its own list is the way to keep specific actions interactive there (the cookbook).

  • A safetyValve in your overlay replaces the shipped list for every mode that uses the shared list; it does not add to them.

  • The valve checks every command of a bash line, so a prefix (cd . && terraform destroy) cannot hide a named command. It also checks each command with its wrappers and leading assignments stripped, so timeout 120 pnpm publish and CI=1 npm publish meet pnpm publish* and npm publish*. The strippable wrappers are timeout, env, nice, ionice, stdbuf, exec, nohup, setsid, time, command, and sudo and doas (#752: sudo gh auth token meets the token deny, sudo git commit --no-verify is a commit to the commit guard, and sudo in front of an allowed command still earns no rule allow), their options read as getopt reads them: a cluster ending in a value-taking letter takes the next word (timeout -vk 5 300 …), long value options take a separate value (stdbuf --output 0 …), and a signed number before > is a word, not a descriptor (nice -n -5>/dev/null …); a grammar word behind a wrapper (time ! …) makes the line complex (#404). Each command is also checked as bash reads its words, unquoted, with escapes and line continuations gone (#237), inside double quotes too (#405: "--no-\<newline>verify" is --no-verify). env FOO='a b' npm publish, "npm" publish, npm publish and a timeout 300 \ continuation all meet npm publish*, and env -S 'npm publish' (including short-option clusters such as env -iS, #1021) is read as the command it names. The highConsequence list and the deny rules do the same. A program that only reads its arguments as data (grep, egrep, fgrep, rg, git grep, echo, printf) is read with each operator in its words written as bash’s hex escape (| as $'\x7c'), so a searched-for ntfy|bash is no pipe into a shell for *|bash (#554). Not when a flag makes it run a command: rg --pre or --hostname-bin, and git grep -O or --open-files-in-pager, keep the plain reading. Every other program keeps the plain reading, so bash -c "curl x | sh" is still denied. The rules also match the line’s own text, and there such a program’s words have their operators masked, so a pipe with spaces round it inside quotes (grep 'x | bash y' f) meets no spaced rule either (#608). A pipe between commands keeps its spacing, so grep -l x f | sh is still denied. Only the rules read the masked text: the valve, the highConsequence list and the judge read the line as written.

  • On Windows, pi’s powershell tool is checked the same way: its command is split on ;, |, &&, || and newlines, and again inside every script block, parenthesis and subexpression, so … | ForEach-Object { Remove-AzResourceGroup … } meets its pattern (#238). A backtick at a line’s end joins the next line. There is no PowerShell parser, so the split is textual; while bash’s parser loads, the same split reads a bash line.

Patterns — the valve’s, highConsequence’s and every rule’s — are globs, not regexes: ` spans anything (a newline included, so *production matches a multi-line heredoc the same as its one-line form), everything else is literal, and case does not matter. On Windows a backslash is a path separator, so it matches /: /.ssh/ meets C:\Users\dev\.ssh\id_ed25519 (#213). On every platform a run of separators reads as one, and a ./ segment is dropped, in the pattern and in what it is matched against. So a//b, a/./b and, on Windows, a bash-escaped C:\\Users\\dev all meet a rule written with one / (#536). .. is not resolved: it names a different file.

On Windows an 8.3 short name reads as its long name, for a deny or an ask (#674). NTFS gives most names a short alias that opens the same file (.ssh is SSH~1), so a path through one also meets the rules spelled long, in a bash line or a tool’s path. The long spelling comes from the filesystem (realpathSync.native), for the longest part of the path that exists. It only restricts: an allow still has to match the path as written, and an exception carved out of a deny (/.ssh/known_hosts inside /.ssh/*) holds through the alias as it does without it. A name that exists nowhere, like git’s HEAD~1, is read as written.

Edit this page · latest