def redact_secrets(value):
    if isinstance(value, dict):
        new_dict = {}
        for k, v in value.items():
            if isinstance(k, str):
                k_lower = k.lower()
                if "password" in k_lower or "token" in k_lower or "secret" in k_lower:
                    new_dict[k] = "[REDACTED]"
                else:
                    new_dict[k] = redact_secrets(v)
            else:
                new_dict[k] = redact_secrets(v)
        return new_dict
    elif isinstance(value, list):
        return [redact_secrets(item) for item in value]
    else:
        return value
