You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
agent-guard: git guards are bypassed by an ordinary global flag before the subcommand #1329
guard_commit_trailer and guard_empty_rebase (the two bundled git guards) check seg.argv[:2] == ["git", "commit"] / ["git", "push"]. Any ordinary global git option before the subcommand shifts it to argv[2], so the check is never true and the guard denies nothing. The dispatcher's own command_kinds pre-filter has the same shape (seg.argv[1]), and the bundled example contributed guard guards.d/no_verify_commit.py copies the same argv[:2] check, so all three fail the same way.
Same shape for guard_empty_rebase (git -C <dir> push --force ...) and for the bundled no-verify guard (git -C <dir> commit --no-verify, which also silently skips guard() entirely because command_kinds never adds the git:commit tag the guard's TRIGGERS filters on).
Expected vs actual
Expected: all three deny regardless of a global flag before the subcommand, the same way gh_subcommand already walks past gh's global flags (gh --repo o/r pr create is still caught).
Actual: git -C <dir> commit ..., git -c <k>=<v> commit ..., and git --no-pager commit ... bypass guard_commit_trailer; the equivalent push forms bypass guard_empty_rebase; and git -C <dir> commit --no-verify bypasses the bundled no-verify guard both at the TRIGGERS pre-filter and inside guard() itself. git -C <dir> in particular is an everyday pattern, not a crafted input: it is how this framework's own multi-clone tooling invokes git from outside the target checkout.
Surface area (optional)
Any future skill-contributed guard that declares TRIGGERS = ["git:commit"] / ["git:push"] inherits the command_kinds bug at the dispatch pre-filter, before its own guard(ctx) ever runs.
Activity
fix(agent-guard): resolve the git subcommand past global flags, not b…