Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

examples: add HOL Guard PreToolUse gate - #2648

Open
kantorcodes wants to merge 7 commits into
MoonshotAI:mainfrom
kantorcodes:feat/hol-guard-pretool-example
Open

kantorcodes wants to merge 7 commits into
MoonshotAI:mainfrom
kantorcodes:feat/hol-guard-pretool-example

Conversation

@kantorcodes

@kantorcodes kantorcodes commented Sep 16, 2026 •

Copy link
Copy Markdown

Summary

Adds a focused PreToolUse example that sends Kimi CLI Shell commands to HOL Guard before execution.

The hook:

  • invokes hol-guard command test <command> --json
  • proceeds only when classification.explicitly_benign is true and minimum_action is allow
  • exits with code 2 for missing Guard, malformed output, evaluation errors, review/risky verdicts, or missing commands
  • leaves non-Shell and non-PreToolUse events unchanged

The accompanying tests cover the explicit allow path, non-benign allow, review, CLI failure, missing command, and missing Guard. The focused test file passes locally with the parent test conftest.py excluded because this environment does not have the repository's kaos dependency installed.

Affiliation: I maintain HOL Guard / Hashgraph Online.


Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread examples/hooks/hol_guard_pre_tool.py

This branch has not been deployed

No deployments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant