Repository navigation
Add mcp_schema_change_then_use trait for MCP tool-digest change followed by use (#317) - #536
Merged
blitzcrieg1 merged 8 commits intoNov 30, 2026
Conversation
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.
Slice of #317 under the bounty program (#454), claimed in the issue comments. Same shape as my #521.
What it detects: an
mcp_schemaevent whose status ischangedfor a server (its tool digest moved), followed later in the same session by a successful call to that same server. Both recorded call shapes are covered: client-hook events carrying themcp__<server>__<tool>qualified name, and proxy-recorded calls (mcp_audit_proxy) carryingtool.server. Server identity is matched through the sameserver_id()hashing the schema events already use, so no new stored fields and no schema changes — the signal is computed entirely from fields already recorded.Mapping: ATLAS AML.T0109 (rug-pull), registered in
DETECTION_ATLAS. The Detection keeps empty ATT&CK lists on purpose, following atlas.py's doctrine that ATT&CK has no honest id for this.Contents:
mcp-schema-change-then-use(severity high) in the detection registry — published rules 20 → 21tests/test_detection_mcp_schema_change.py— 14 tests: fires on both call shapes; silent for use-before-change, other server, new/same/rebaselined status, denied call, and window expiryVerification:
ruff checkclean on touched filesTwo existing guard tests were extended deliberately, not weakened: the ATLAS mapping guard now expects exactly two mapped rules (this slice is the second, per #317 naming AML.T0109), and the README number-words table was extended past twenty. Both assertions are unchanged in strength.