Repository navigation
fix(transport): make debug logging opt-in for message privacy - #803
Open
gabrieledellamalva wants to merge 4 commits into
Open
gabrieledellamalva wants to merge 4 commits into
gabrieledellamalva wants to merge 4 commits into
Conversation
gabrieledellamalva
marked this pull request as ready for review
October 9, 2026 21:29
This branch has not been deployed
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.
Overview
Privacy / AI agent transport hardening — fixes #786.
PostMessageTransportcurrently callsconsole.debugfor outgoing and incoming JSON-RPC messages and for messages from unrelated iframe sources. This is noisy in multi-app hosts and can expose raw tool messages in developer consoles or captured browser logs even when the host never requested diagnostic logging.Changes
{ logger?: Pick<Console, "debug"> }.console.errorpath for malformed JSON-RPC messages.Scope / security notes
This is defense-in-depth for diagnostic logging and privacy. It is not an authorization boundary, message encryption, a sanitizer for malformed-message error logs, or an MCP tool-permission firewall. Embedders that choose to enable a logger are responsible for protecting their debug output.
Validation
bun test src/message-transport.test.ts— 20 passed, 0 failed.npm run build— passed.npm test— 441 passed, 1 skipped, 0 failed.0936aa1applied to both changed files; the finalnpm run prettiercheck is not independently confirmed yet.action_required(GitHub Actions permission/approval), not executed test results.Closes #786 upon merge.