Repository navigation
fix(guardrails): deny settings writes when nobody can answer the prompt - #18033
Conversation
settings-write-ask returned permissionDecision "ask" in every session, so a claude --bg lane that edited a settings file waited on a prompt nobody answers. AGENTS.md "Unattended lanes" says lane sessions carry no hook ask. The hook now asks only when CLAUDE_CODE_SESSION_ATTENDED is exactly 1 and GUARDRAILS_SESSION_UNWATCHED is not 1, the test refuse.sh uses for the blocking guards, and denies otherwise. The contract test covers unset, 0, a non-1 value and the unwatched flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Lane run report
Run 44949463372, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
Lane-Activity: pr-refine/fix-docs
Lane run report
Run 44949463372, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
|
claude-security-review reviewed Security review: PR #18033 at d230c04No security issues found. I read the whole diff for all 6 changed files. None of them is on the trusted-path list. What changed. Why this loosens nothing:
Docs and tests. The README edits rephrase prose; one removes the sentence "This closes a real hole" from the scope notes. The context-budget audit SKILL.md gains a clause describing the Other checks:
critical-findings: 0 |
|
claude-review reviewed Code review: PR #18033 —
|
No related issue: crash-course close-out, owner closed the walk 2026-11-21
session: AI Hero
Summary
The guardrails
settings-write-askhook returnedpermissionDecision: "ask"in every session. Ina session nobody can answer (
claude -p,claude --bg, or one marked unwatched), that ask is aprompt nobody answers. Root AGENTS.md "Unattended lanes"
already says lane sessions carry no hook
ask. This change makes the hook follow that rule. Ittightens a control and loosens nothing: the result is
askordeny, neverallow.Fix
plugins/guardrails/hooks/settings-write-ask.mjsasks only whenCLAUDE_CODE_SESSION_ATTENDEDisexactly
1andGUARDRAILS_SESSION_UNWATCHEDis not1. That is the testplugins/guardrails/hooks/refuse.sh(hook::refuse_asks) uses for the blocking guards. In anyother session it returns
deny, and the reason says to leave the change for a person."Unwatched sessions".
Verification
bash plugins/guardrails/hooks/settings-write-ask.test.sh: 30 passed, 0 failed.ATTENDEDunset,ATTENDED=0,ATTENDED=true, andUNWATCHED=1each gotaskinstead ofdeny.scripts/check-changelog-fragments.sh --check: all fragments valid.Related
--bglane is not in this PR.The probe runner always launches
claude -p(
plugins/harness-ops/skills/behavior-probes/scripts/probe.py:709-735), and theCLI reference says
--bgcan't becombined with
-p. A--bgsession also exits withWorkspace not trustedin an untrusteddirectory, such as a probe's temp directory
(permissions).
Probing it needs a runner change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RAoAtST8QdquPzTRsKGF4Y