Skip to content

fix(ahp): validate tool input before hook dispatch - #301

Merged
danielkov merged 1 commit into
mainfrom
fix/pre-ahp-tool-input-validation
Oct 22, 2026
Merged

danielkov merged 1 commit into
mainfrom
fix/pre-ahp-tool-input-validation

Conversation

@danielkov

Copy link
Copy Markdown
Contributor

Summary

Validate original tool arguments against the cached current schema before constructing or dispatching tool.before. Malformed arguments now return FailedBeforeInvocation(InvalidInput) with the tool name and JSON instance path, instead of being reported as a hook policy denial.

Technical details

Validator initialization failures return Internal. Early validation failures skip both hook events and tool execution without coercing arguments; the existing AHP arguments contract continues to reject invalid hook edits.

@kit-code-agent kit-code-agent 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.

No issues found. The changes look good to merge.

Took 17 min

@danielkov
danielkov merged commit 9c2ef06 into main Oct 22, 2026
5 checks passed
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.

1 participant