def redact_secrets(value):
    if isinstance(value, dict):
        return {
            k: '[REDACTED]' if any(word in k.lower() for word in ('password', 'token', 'secret')) else redact_secrets(v)
            for k, v in value.items()
        }
    elif isinstance(value, list):
        return [redact_secrets(item) for item in value]
    else:
        return value
