MCP Server Framework - v1.0.0
    Preparing search index...

    Function isSensitiveKey

    • Check if a field/key name is sensitive and should be redacted.

      Algorithm (4 steps):

      1. Check if the key contains any sensitive pattern (substring match)
      2. If the entire key is an exact blocklist word → not sensitive
      3. For compound keys (segments): only sensitive if at least one segment is genuinely sensitive (not fully explained by blocklist)
      4. Single-segment keys: check blocklist patterns

      Parameters

      • key: string

        The field name to check

      Returns boolean

      true if the key should be redacted

      isSensitiveKey('password')         // true
      isSensitiveKey('api_key') // true
      isSensitiveKey('keyboard') // false (blocklisted)
      isSensitiveKey('monkey') // false (blocklisted)
      isSensitiveKey('monkey_password') // true ("password" is genuine)