fix(server,catalog): canonicalize tool names at ingress; enforce lowercase in catalog (POLICY-002) - #218
Merged
Conversation
…rcase in catalog (POLICY-002) Tool names are now lowercased in _handle_tool_call() before reaching the proxy, so Cedar policy, catalog, and request always use the same case. Catalog loading now rejects any entry whose tool_name is not already lowercase, preventing inconsistency that could allow a case-variant to bypass deny rules. Closes #159 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_handle_tool_call()before reaching the proxy, catalog lookup, and Cedar evaluator. This ensures Cedar policy, catalog entries, and client requests all use the same casing. Catalog loading now rejects entries with non-lowercasetool_namewith aConfigError, preventing future inconsistency.Test plan
test_uppercase_tool_name_is_rejected—ConfigErrorraised when catalog entry has uppercase tool_nametest_tool_name_is_lowercased_at_ingress— proxy receives lowercased tool_name even when client sends uppercase🤖 Generated with Claude Code