Repository navigation
fix(gateway): enforce runtime schemas and sanitize MCP errors - #195
Merged
Merged
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.
Summary\n- compile every Gateway Tool input/output schema once with fixed JSON Schema 2020-12 semantics\n- reject all external schema retrieval and external $ref, $dynamicRef, $recursiveRef, and $id authority\n- bound request/response bytes, nesting, and collection width before provider dispatch\n- validate input before invoking the host and validate output before returning it to an agent\n- replace provider and transport details with stable, secret-free MCP errors\n\n## Architecture\nThe portable core remains a dependency-light contract crate. Runtime validation is owned by the MCP facade feature, while invocation authority and lifecycle leases stay behind the injected CapabilityGatewayInvocationProvider. Schemas are compiled once per immutable catalog rather than per call.\n\n## Verification\n- cargo fmt --all -- --check\n- cargo test --workspace --all-features --locked -- --test-threads=1\n- cargo clippy --workspace --all-targets --all-features --locked -- -D warnings\n- focused core and Gateway MCP tests after rebasing onto current main