Repository navigation
Closed
Closed
Copy link
Labels
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.Human-in-the-loop required; autonomous sessions must not resolve items carrying this.
Description
Problem
The disk-hygiene destructive guard gates hygiene.py apply --execute with a PreToolUse hook that returns permissionDecision: "ask". Whether that ask holds is documented for some permission modes and not others:
- Probed and held (2026-09-30, Claude Code 2.1.285, Linux/WSL2, Bash tool): headless default mode denied the call;
--bgdefault mode parked at the prompt; headless--permission-mode bypassPermissionslisted the call inpermission_denialsand the target survived (PR feat(disk-hygiene): add model-invocable read-only audit skill #5590, comments 5916629407 and the probe table in its body). - Not probed: an interactive session in
bypassPermissions, auto mode, and the Windows PowerShell tool. - The official docs do not name hook
askunderbypassPermissions. The/permission-modes"Actions no mode auto-approves" list names ask rules, not hookask. Upstream [BUG] Bypass permission mode resets after a PreToolUse hook returns "ask" anthropics/claude-code#37420 (closed, 2026-03) reports the prompt still appears interactively; #79356 (2.1.215, Windows, PowerShell tool, closed stale) reports a hookasknot enforced. Research record:.work/hook-ask-bypass-permissions/RESEARCH.md(memory tier, not committed).
So the only gate on the irreversible lane rests on behavior that is undocumented for two of the modes a session can be in.
Acceptance criteria
- Probe the guard's
askonapply --executein: an interactivebypassPermissionssession, auto mode, and the PowerShell tool on a Windows fleet host. Record mode, version, tool, result and the target listing on this issue. - Decide whether
apply --executealso needs a gate that does not depend on the permission mode (an engine-side confirmation, or a hookdenyin modes whereaskcannot reach a person), and implement the chosen one with tests, or record why not. - Add a four-part verification record (Claim, Basis, As of, Recheck) for the hook-
ask-under-bypass behavior to the disk-hygiene safety-model reference, with a recheck trigger on any Claude Code changelog entry that names PreToolUseaskorbypassPermissions.
Related
- disk-hygiene: model-invocable read-only audit skill for orchestrators and subagents #5516 (owner decision A1, condition 4), PR feat(disk-hygiene): add model-invocable read-only audit skill #5590 (the read-only audit skill that motivated the probe).
- disk-hygiene: give the session belt an escape hatch and re-scope its deny-by-default to its actual threat model #3856 (session belt re-scope), disk-hygiene: PowerShell guard false-positives on read-only Export-Csv into the plugin data dir, and the workaround bypasses the guard #5226.
Metadata
Metadata
Assignees
Labels
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.Human-in-the-loop required; autonomous sessions must not resolve items carrying this.
Type
Fields
No fields configured for Task.
Activity
docs(disk-hygiene): record hook ask behavior under bypassPermissions (#…
kyle-sexton commentedon Oct 1, 2026
Owner decision (2026-10-01): approved the recommendation ("go with recommended", the owner's reply to the batch decision page that listed this question and its recommendation).
Question: which option for the
apply --executeguard, A, B, C or D? Chosen: A, probe first. An agent runs the headless auto-mode probe on this WSL host and the PowerShell-tool probe on melo-lap-001 or melo-desk-001 via /fleet:reach, both against a throwaway dir under .work/. The interactive bypassPermissions probe is run by the owner (or by an agent only if the owner explicitly authorizes a tmux-driven session, since AGENTS.md forbids bypass mode otherwise). Results are recorded here, then AC2 is decided (record why not, or add a mode-independent gate with tests) in a PR that closes this issue.Next: the owner names the Windows host for the PowerShell probe and runs or authorizes the interactive bypassPermissions probe. Until then
needs-humanis set andagent-readyis removed so no lane picks this up early. The auto-mode probe can run any time.kyle-sexton commentedon Oct 22, 2026
This was generated by AI during an attended run.
AC1, auto-mode lane (owner decision A): held. The guard returned
askonapply --executeunder headless--permission-mode auto. The call is the only entry inpermission_denials, and the target survived.Setup:
git archiveof origin/main9ef419e52b, loaded with--plugin-dir, with the installed copy disabled..work/probe-5609/target/.--plan/--reportpaths inside the authorized data root, so the plan lived there and not under.work/. Its one candidate wasstaging.tmp, tier medium.claude -p --model sonnet --effort low --permission-mode auto --tools Bash --strict-mcp-config --max-turns 14 --no-session-persistence --output-format stream-json.permission_denialsauto(initpermissionMode: auto)hygiene.py apply --execute --snapshot … --plan …/plan-medium.json --confirm-tier medium --approval-token … --report … --data-root …, afterscanandpreview(both allowed)decision: ask,rule: exact-engine-apply,mode: engine-gate(03:58:52Z)staging.tmp,sub/,emptydir/all present; no report writtenautols -la <target>[]hygiene.pymatch)Still open under AC1:
/fleet:reach).AC2 and AC3 wait for those results.
kyle-sexton commentedon Oct 22, 2026
Interactive bypassPermissions probe, run by the owner 2026-10-22: Claude Code 2.1.308, Linux/WSL2, Bash tool, disk-hygiene from main 4114353 loaded with
--plugin-dir, a fresh scratch target holding one empty file.claude --dangerously-skip-permissionsin an interactive terminal.scanandpreviewran. The guard loggedallow, ruleexact-engine-preview, at 17:55:19Z, and the preview returned ready-for-explicit-approval.hygiene.py apply --execute: the guard returnedask, ruleexact-engine-apply, in decisions.jsonl at 18:07:40.768Z. A permission prompt appeared in the bypass session. The owner approved it with Enter, and the tool result arrived at 18:09:54Z, 2m14s later. The target file was then deleted,paths_removed1, as approved. The session's model reported no prompt, as expected: the prompt goes to the person, not the model.Result: the hook
askreaches a person in interactive bypass mode and is not auto-approved. Together with the auto-mode probe in comment 6332348323 and the 2026-09-30 probes, every probed mode holds.askreaches a person or is denied in every probed mode; the reason is recorded in the safety-model update.kyle-sexton commentedon Oct 24, 2026
This was generated by AI during an unattended host run over
/fleet:reach(melo-desk-001, native Windows lane).AC1, PowerShell tool on a Windows fleet host: holds within one process; does not hold across
--resume. The cross-resume gap is filed separately: #9853.Setup:
diff -rqagainst origin/main9965f0c07showed no differences apart from__pycache__. A first attempt with--plugin-dirresolveddata_root: none, so the guard denied every engine call. That attempt is discarded.claude.exe -p --model sonnet --effort low --permission-mode auto --strict-mcp-config, withCLAUDE_CODE_USE_POWERSHELL_TOOL=1. Each run is on a fresh throwaway target holdingstaging.tmp,sub/keep.txtandemptydir/.permission_denials,guard-decisions/decisions.jsonl, and a listing of the target before and after.decisions.jsonl)permission_denials-pturns,--resumebetween themscanthrough PowerShell; turn 3: engineapply --executethrough PowerShelldenyin bothbeltandengine-gatemodes; turn 3:denyinengine-gateonly, with nobeltentry. Rulepowershell-deletion-spelling; a hard deny, neveraskstaging.tmp)handoff-verify(clear), then PowerShell[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile(<path>, 'OnlyErrorDialogs', 'SendToRecycleBin')ask, rulepowershell-deletion-spelling, modebeltstaging.tmpsurvived-pturns: scan, then--resumewith the same approvalDeleteFilecallengine-gateentries only, with nobeltentry[]staging.tmpremoved (recycled)Reading:
apply --executeis not a Windows lane: the engine returnsexecution-platform-unsupported, and the PowerShell guard hard-denies every engine call (safety-model.md, "Execution is intentionally not cross-platform" and the PowerShell paragraph). The PowerShell-tool question therefore concerns the manual lane's hookask.askholds under headless auto mode: the call is denied and the target survives, the same result as the Bash probes on 2026-09-30 and 2026-10-22.--resume, a new process on the same session id, the skill-frontmatter belt is not registered. Two runs show it. In run b, turn 3 logsengine-gateonly. Run c's turn 2 showsSessionStart:resumehooks, nobeltdecisions, and an unprompted PowerShell delete. That contradictssafety-model.md, which says the belt is registered "for the rest of the session after the skill is invoked" and "only the session's end clears it". The always-on engine gate does not see PowerShell deletion spellings (same section), so nothing gated the delete. Filed as fix(disk-hygiene): the clean skill's PowerShell belt is gone after --resume, so a manual-lane delete runs unprompted #9853.AC2 and AC3: the earlier rationale for AC2 ("the
askreaches a person or is denied in every probed mode") holds per process, but not across a resume. Whether to add a gate that does not depend on the mode or the process is now the design question in #9853, so I have not opened the AC2/AC3 PR. Outputs are kept locally under.work/host-runs/5609/.kyle-sexton commentedon Oct 26, 2026
This was generated by AI.
Closing as completed, with the last edits carried to #9853. A second, independent agent check agreed.
bypassPermissions(2026-10-22) and the PowerShell tool on a Windows host (2026-10-24).apply --executestayed denied by the always-on engine gate even after--resume, andsafety-model.md:711-716already records that no mode-independent gate is needed. The resume gap in the manual lane moved to fix(disk-hygiene): the clean skill's PowerShell belt is gone after --resume, so a manual-lane delete runs unprompted #9853, where the owner chose option D (Q111, 2026-10-25).safety-model.md:711-736). Its two stale lines (the "Not probed: the Windows PowerShell tool" line and the Recheck pointer to this issue) are now checklist items on fix(disk-hygiene): the clean skill's PowerShell belt is gone after --resume, so a manual-lane delete runs unprompted #9853, which edits the same section: fix(disk-hygiene): the clean skill's PowerShell belt is gone after --resume, so a manual-lane delete runs unprompted #9853Reopen if #9853 closes without those items.