PreToolUse guard: reject unquoted zsh EQUALS and glob tokens in Bash tool commands #562
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#562
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The Bash tool shell is zsh. Two zsh options break agent-written commands: EQUALS expands an unquoted word starting with
=as a command lookup, and NOMATCH errors on an unquoted glob with no match. Agents hit this at least four times: three entries in docs/os-sdlc-rebuild/interface-sketches.md, and the responsibility-auditor run of 2026-09-11 ((eval):1: === not found), plus the main session (no matches found: --include=*.rb). Each time the agent re-ran a rephrased command. No root cause or fix was ever recorded.OsSdlc::BashGuard(plugins/os-sdlc/lib/os_sdlc/bash_guard.rb) checks mutation and scope only; it has no shell-syntax check.Observed
Commands such as
echo ===STOPorgrep --include=*.rbfail with(eval):1: ... not foundorno matches found. Retries waste a turn each time.Reproduce
Expected
=or containing an unquoted*,?, or[outside a quoted span, reusing BashGuard's quoted-span stripping.unsetoptwas rejected because it changes the user's interactive shell.Origin
Checked 2026-09-11 against the recent BashGuard quoting fix (commit
07bb036, tickets #543/#550). That fix stopped the guard from reading quoted data as commands. This ticket is a different mechanism: zsh itself rejects the unquoted token. Reproduced after that fix:zsh -c 'echo ===STOP'printszsh:1: ==STOP not found, exit 1; the quoted form prints ===STOP. User preference recorded: fix the agent instructions (quote any token that starts with = or contains a glob) before adding a PreToolUse check. Low priority.