Repository navigation
feat: mask sensitive keys in events - #14
Merged
Merged
Conversation
Port the shared sensitive key mask to SensitiveKeys and call it in EventQueue after the redaction hooks and the sanitizer, before truncation, on parameters and response. Credential headers in parameters.extra.http.req.headers and other sensitive keys now reach AgentCat as [redacted].
kashishhora
approved these changes
Nov 26, 2026
naji247
added a commit
that referenced
this pull request
Nov 26, 2026
Version 1.1.2 has a dated section but was never published: the publish job of its release run stopped when CI failed on a Maven download. The mask (#14) merged after that, so a publish from main now ships 1.1.2 with the mask. The entry moves from [Unreleased] into [1.1.2], and the 1.1.2 note about raw Authorization and Cookie headers now says that the SDK masks them.
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
Every queued event goes through this one call site. If the mask fails on a field, that field becomes
null, the SDK writes onewriteToLogline, and the event goes out without the field.truncateandbuildRequestkeep their typedMap<String, Object>signatures.Evidence
HttpHeaderCaptureTestonorigin/mainasserts that the published event carriesparameters.extra.http.req.headers.authorization = "Bearer secret-token".After: the published event carries
"[redacted]"forauthorization,cookieandx-api-key, keepsmcp-session-id, and the handler's transport context keeps the raw values (sensitiveHeadersAreMaskedAndTheHandlerKeepsThem).mvn --batch-mode --no-transfer-progress verify: 1187 tests, 0 failures, 0 errors, 0 skipped. The compat profilesmcp-1xandmcp-018xpass (14 tests each, 0 failures).mvn package -P release,mcp-2.0.1 -DskipTests -Dgpg.skipbuilds. The vectors test checks all 233 key cases and 17 tree cases.Merge Danger
Door: two-way
Revert the commit to send the raw values again.
Blast Radius: all-customers
After the merge, the dashboard shows
[redacted]for request headers such asauthorization,cookieandx-api-key, and for tool arguments and results under key names such aspageToken,auth_typeorpassword. Other headers and values do not change. No option turns the mask off.