Repository navigation
feat: mask sensitive keys in events - #7
Merged
Merged
Conversation
Port the shared sensitive key mask to lib/agentcat/sensitive_keys.rb and run it once in EventPipeline, after sanitization and before truncation, on parameters, response and error. Credential headers in parameters.extra.requestInfo.headers, authInfo and secret-named tool arguments now go out as "[redacted]". A field the mask fails on is dropped and logged. The shared vectors file checks the port.
kashishhora
approved these changes
Nov 26, 2026
Merged
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
Evidence
parameters.extra.requestInfo.headers.authorizationas received (for exampleBearer abc.def), andtest_tracking.rbasserted the rawextra.authInfoHash and_meta.progressToken=3.After: the pipeline test sends
Authorization,CookieandX-Api-Keythrough a real Rack env; the sender gets[redacted]for all three, keepsuser-agent,x-anthropic-clientandmcp-session-id, and the captured request Hash keeps the raw values.COVERAGE=1 bundle exec rake: 827 runs, 3310 assertions, 0 failures (97.59% line coverage).bundle exec rake test:e2e: 25 runs, 0 failures. The vectors test checks all 233 key cases and 17 tree cases.Merge Danger
Door: one-way
Events sent before the merge keep their raw headers, and masked values cannot come back.
Blast Radius: wide
Every event now shows
[redacted]for credential headers,authInfo,_meta.progressToken, and tool arguments or results under secret key names such aspageToken,api_keyorauth_type. A dashboard view or customer query that read those values gets[redacted]. No option turns the mask off.