def redaction_confidence(result: dict) -> float: url = result.get("url","").lower() score = 0.9 if "pdf" in url: score -= 0.3 if "redact" in url: score -= 0.4 if "download" in url: score -= 0.2 return max(0.0, score)