Skip to content

gate: subagent guard does not see a wrapper written as a path (/usr/bin/env git stash) #320

Closed

Description

@wasikarn

Found by the #318 differential fuzz (pre-existing; develop allows it too).

The subagent guard's wrapper list (_WRAPPER_WORDS) matches only the bare word, so a wrapper written as a path is not a wrapper: /usr/bin/env git stash runs git stash in every shell tested (sh, bash 3.2, bash 5, dash, zsh, ksh) and the guard allows it. The anchor already takes /path/git, but not /path/env before it. 40 of the 43 branch false-allows in the #318 fuzz (4000 cases) are this shape, e.g. ( { /usr/bin/env git -C . clean -fd; } ).

Fix direction: let a wrapper word carry an optional path prefix ((?:\S*/)?env, same as the git word), in the walk and in the lead-chain lookahead, then fuzz per docs/reference/repo-gotchas.md. Check irrecoverable.py's PREFIX_WRAPPERS matching for the same gap (it may already compare a basename).

Activity

  1. self-assigned this
    on Oct 2, 2026
  2. added a commit that references this issue on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions