Skip to content

feat: implement input filtering hook (#143)#150

Merged
abwaters merged 1 commit intomainfrom
143-input-filtering-hook
Mar 9, 2026
Merged

feat: implement input filtering hook (#143)#150
abwaters merged 1 commit intomainfrom
143-input-filtering-hook

Conversation

@abwaters
Copy link
Owner

@abwaters abwaters commented Mar 9, 2026

Summary

  • Implements on_post_validation on GitHubRepoFilterHook to block tool calls targeting disallowed repos
  • Extracts owner/repo from request arguments, uses fnmatch for case-insensitive pattern matching
  • Supports both allowlist (deny if no match) and blocklist (deny if match) modes with ShortCircuitError
  • Respects servers scoping — skips filtering for unmatched server names

Test plan

  • All 18 existing tests pass
  • Verify allowlist mode blocks unlisted repos
  • Verify blocklist mode blocks listed repos
  • Verify non-repo-scoped tools pass through unchanged
  • Verify server scoping skips filtering for unmatched servers

Closes #143

🤖 Generated with Claude Code

…oFilterPlugin (#143)

Add the on_post_validation method to GitHubRepoFilterHook that enforces
allowlist/blocklist policies on GitHub repository references by extracting
owner/repo from request arguments, using fnmatch for pattern matching,
and raising ShortCircuitError for denied repositories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abwaters abwaters merged commit f86a2c1 into main Mar 9, 2026
4 checks passed
@abwaters abwaters deleted the 143-input-filtering-hook branch March 9, 2026 15:11
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.

Implement input filtering hook

1 participant