Skip to content

New hook: tool-guardian (#preToolUse)#1026

Closed
ajithraghavan wants to merge 5 commits intogithub:stagedfrom
ajithraghavan:feature/tool-guardian-hook
Closed

New hook: tool-guardian (#preToolUse)#1026
ajithraghavan wants to merge 5 commits intogithub:stagedfrom
ajithraghavan:feature/tool-guardian-hook

Conversation

@ajithraghavan
Copy link

Add a preToolUse hook that blocks dangerous tool operations (destructive file ops, force pushes, DB drops, network exfiltration, etc.) before the Copilot
coding agent executes them. Includes ~20 threat patterns across 6 categories, each with a safer-alternative suggestion, allowlist support, and JSON Lines
logging.

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, or workflow file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, or workflow with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • Update to existing instruction, prompt, agent, plugin, skill, or workflow.
  • Other (please specify):

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.

github-actions bot and others added 2 commits March 16, 2026 01:35
   Add a preToolUse hook that blocks dangerous tool operations (destructive file ops, force pushes, DB drops, network exfiltration, etc.) before the Copilot
   coding agent executes them. Includes ~20 threat patterns across 6 categories, each with a safer-alternative suggestion, allowlist support, and JSON Lines
   logging.
@ajithraghavan ajithraghavan changed the base branch from main to staged March 16, 2026 11:05
@ajithraghavan ajithraghavan requested a review from dvelton as a code owner March 16, 2026 11:05
@aaronpowell
Copy link
Contributor

It looks like you've incorrectly branched from the main branch not staged, and as a result all the materialised plugins are included in this PR.

You can attempt to fix this with a rebase:

git fetch origin staged
git rebase --onto origin/staged origin/main <branch name>
git push --force-with-lease

If that does not resolve it, you can run npm run plugin:clean which will delete the materialised plugins and you can commit that change.

   Add a preToolUse hook that blocks dangerous tool operations (destructive file ops, force pushes, DB drops, network exfiltration, etc.) before the Copilot
   coding agent executes them. Includes ~20 threat patterns across 6 categories, each with a safer-alternative suggestion, allowlist support, and JSON Lines
   logging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants