Module security

Module security 

Source
Expand description

Security utilities for PII protection and data sanitization

Constants§

MAX_PREVIEW_LENGTH
Maximum length for message previews to prevent PII leakage

Functions§

redact_pii
Redact PII patterns from text (emails, phone numbers, credit cards)
safe_preview
Create a safe preview of text by truncating and redacting PII
sanitize_json
Sanitize a JSON value by redacting sensitive fields
sanitize_tool_payload
Sanitize tool payload for safe logging/broadcasting
truncate_string
Truncate a string to a maximum length, adding ellipsis if truncated