Conversation
|
It looks like you've incorrectly branched from the You can attempt to fix this with a rebase: If that does not resolve it, you can run |
Add Tool Guardian hook for blocking dangerous tool operations Introduces a preToolUse hook that scans Copilot agent tool invocations against ~20 threat patterns (destructive file ops, force pushes, DB drops, permission abuse, network exfiltration) and blocks or warns before execution.
61f1af3 to
1192ffc
Compare
|
Thank you for the feedback! I have rebased the branch onto staged and force pushed. The materialized plugins should no longer be included in the diff. Apologies for the oversight, please let me know if anything else needs to be fixed. |
aaronpowell
left a comment
There was a problem hiding this comment.
Given there is allow/disallow tool support built into CLI, VS Code, etc. for Copilot, what would this hook bring that you don't get from the native support?
… file - Move hooks/tool-guardian/ to .github/hooks/tool-guardian/ - Remove accidentally committed guard.log - Update all path references in README.md
|
The native allow/disallow support works at the tool and subcommand level, e.g., you can allow or deny So once This hook fills that gap by pattern matching against the full command String, for example, it can:
It also adds audit logging (JSON Lines), safer alternative suggestions, and a configurable warn/block mode. It's meant to complement native controls as a defense-in-depth layer, not replace them |
|
I moved it to .github/hooks/tool-guardian/ as suggested, but it seems the repository's build Script (npm start) generates docs/README.hooks.md by scanning the hooks/ directory. Moving it out of hooks/ causes the Tool Guardian entry to be dropped from the generated README, failing the validate-readme CI check |
Sorry, I think there was a miscommunication in the suggested refactor - it was just that the log folder should go into |
hooks/ - Revert hook files from .github/hooks/ back to hooks/tool-guardian/ - Update default log path to .github/logs/copilot/tool-guardian/ - Update all path references in README.md and hooks.json
|
Sorry for the misunderstanding, reverted the hook files back to Thanks for clarifying! Kindly check now |
|
Thanks @aaronpowell |
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.Description
Type of Contribution
Additional Notes
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.