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
Commit c146748
Browse filesBrowse the repository at this point in the historyBrowse files
fix(agent-guard): fail closed on lefthook install behind global options and package runners
The lefthook hooks-path guard took the first bare word as the subcommand,
so `lefthook --colors off install --force` read `off` and was allowed, and
`npx lefthook install --force` never reached the guard at all. Any
`install` word now makes the segment an install, and npx, pnpm, yarn, bun
and npm exec are looked through when they launch lefthook.
argv[0] is normalised once with the helper guarded_head uses, so git.exe
or a path-qualified git also reaches the git:* contributed guards.
Closes#1918
Copy file name to clipboardExpand all lines: tools/agent-guard/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,7 +136,7 @@ way — see [Contributing guards](#contributing-guards)):
136
136
|`mention`|`pr-management-triage`|`gh pr comment` / `gh issue comment` that `@`-mentions anyone other than the PR/issue author; **any**`@`-mention in `gh pr edit --body[-file]`| denoise: author-directed feedback never pings maintainers; body edits stay silent. Exempt: the operator commenting on their **own** PR/issue (author == authenticated `gh` user), and the `MAGPIE_ALLOW_MENTIONS=1` override |
137
137
|`mark-ready`|`pr-management-triage`| adding `ready for maintainer review` while the PR head SHA has GitHub Actions runs awaiting approval | Golden rule 1b |
138
138
|`security-language`|`security-issue-fix`| a CVE id / security-fix language in a **public**`gh pr create`/`gh pr edit` title/body (not comments) | public-PR scrubbing |
139
-
|`lefthook-hooks-path`|`setup-isolated-setup-install`|`lefthook install --force` / `-f` or `--reset-hooks-path` / `-r` while the global `core.hooksPath` is the framework's | the first writes over the dispatcher for every repository, the second unsets the whole-user setup; the shim hides the global path, so a plain `lefthook install` is all that is needed. Override: `MAGPIE_ALLOW_LEFTHOOK_HOOKS_PATH=1`|
139
+
|`lefthook-hooks-path`|`setup-isolated-setup-install`|`lefthook install --force` / `-f` or `--reset-hooks-path` / `-r` while the global `core.hooksPath` is the framework's, also behind global options and package runners (`npx`, `pnpm exec`, `yarn exec` / `dlx`, `bunx`)| the first writes over the dispatcher for every repository, the second unsets the whole-user setup; the shim hides the global path, so a plain `lefthook install` is all that is needed. Override: `MAGPIE_ALLOW_LEFTHOOK_HOOKS_PATH=1`|
140
140
141
141
A denied command is **not** posted/run; the model is shown the reason and the
142
142
deterministic fix (e.g. "use a backtick `` `login` `` instead of `@login`").
0 commit comments