Skip to main content

Module sanitizer

Module sanitizer 

Source
Expand description

Secret sanitization utilities for redacting sensitive information.

Provides regex-based secret redaction for:

  • OpenAI API keys (sk-...)
  • AWS Access Key IDs (AKIA...)
  • Bearer tokens (Bearer ...)
  • Generic secret assignments (api_key=..., password:..., etc.)

Use this module to sanitize text before logging, displaying in UI, or storing in session archives.

Functionsยง

redact_secrets
Redact secrets and sensitive keys from a string.