-
Notifications
You must be signed in to change notification settings - Fork 3.5k
docs/examples: add a tool-response detection middleware sample? #2617
Copy link
Copy link
Open
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesdocumentationImprovements or additions to documentationImprovements or additions to documentationenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implement
Metadata
Metadata
Assignees
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesdocumentationImprovements or additions to documentationImprovements or additions to documentationenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implement
Type
Fields
Give feedbackNo fields configured for issues without a type.
Hi maintainers,
Per CONTRIBUTING.md ("PRs are for execution, not exploration"), opening an issue first to gauge appetite before writing code.
Question
Would the maintainers accept an
examples/snippets/security/directory with a single self-contained file that demonstrates how to scan MCP tool responses through a detection-rule callback before they reach the client?The intended file would:
examples/, no changes to SDK core or existing examples)pip install pyatr) for the rule engine itself; not added to the SDK's own requirementsWhy this might be in scope
Production MCP deployments increasingly need a tool-response scanning hook for prompt-injection / tool-poisoning detection. The example would not advocate for any single detection product. The same pattern works with any callable detector. Showing the wiring once removes a class of "how do I plug security in" questions.
Reference for the rule engine
I maintain ATR (Agent Threat Rules), an MIT-licensed open detection rule format. It is in production at Microsoft Agent Governance Toolkit (PRs #908 and #1277, both merged) and Cisco AI Defense skill-scanner (PRs #79 and #99, both merged), and integrated into MISP/CIRCL via misp-taxonomies #323 and misp-galaxy #1207 (both merged by @adulau).
Repo: https://github.com/Agent-Threat-Rule/agent-threat-rules
If you say yes
I will draft the PR and link it back to this issue. Self-contained, ~80 lines including docstring, no SDK changes.
If you say no
Totally fine. I will not push a PR or follow up.