Add event-level redact_event hook, protect server/client identity fields - #50
Merged
naji247 merged 1 commit intoAug 7, 2026
Merged
Conversation
…ient identity fields Add an event-level redact_event hook (AgentCatOptions.redact_event), matching the redactEvent/RedactEvent hooks already available in the TypeScript and Go SDKs. It runs before redact_sensitive_information, receives the full event, and may return a modified event or None to drop it entirely. id, session_id, project_id, event_type, and timestamp are restored from the original event afterward regardless of what the hook returns. Also add server_name, server_version, client_name, and client_version to PROTECTED_FIELDS: these are system-reported MCP metadata, not user-supplied content, and should always reach the dashboard intact rather than passing through redact_sensitive_information.
kashishhora
approved these changes
Aug 7, 2026
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
redact_eventhook (AgentCatOptions.redact_event), matching theredactEvent/RedactEventhooks already available in the TypeScript and Go SDKs. It runs beforeredact_sensitive_information, receives the full event, and may return a modified event orNoneto drop it entirely.id,session_id,project_id,event_type, andtimestampare restored from the original event afterward regardless of what the hook returns.server_name,server_version,client_name, andclient_versiontoPROTECTED_FIELDS: these are system-reported MCP metadata, not user-supplied content, and should always reach the dashboard intact rather than passing throughredact_sensitive_information.Example
Test plan
redact_sensitive_information