| from __future__ import annotations | |
| from typing import Any, Dict, Iterable, List | |
| from shield.models.evidence import Evidence | |
| def analyze_fraud(evidence: Iterable[Evidence], duplicate: Dict[str, Any], campaign: Dict[str, Any]) -> List[Evidence]: | |
| categories = {item.category for item in evidence} | |
| output: List[Evidence] = [] | |
| duplicate_score = int(duplicate.get("duplicate_score", 0)) | |
| campaign_score = int(campaign.get("campaign_risk_score", 0)) | |
| if duplicate_score >= 80 or campaign_score >= 70: | |
| output.append(Evidence( | |
| source="fraud_agent", | |
| category="fraud", | |
| risk_score=max(duplicate_score, campaign_score), | |
| weight=0.82, | |
| confidence=0.86, | |
| explanation="Identity and relationship evidence indicate likely coordinated abuse", | |
| )) | |
| elif {"velocity_abuse", "synthetic_identity"} & categories: | |
| output.append(Evidence( | |
| source="fraud_agent", | |
| category="fraud", | |
| risk_score=58, | |
| weight=0.55, | |
| confidence=0.72, | |
| explanation="Behavior and identity signals are consistent with account abuse", | |
| )) | |
| return output | |
Xet Storage Details
- Size:
- 1.2 kB
- Xet hash:
- 930a1e2a46b280eb944e75fc58b2f87c37d1df57fb8cddd796d519440985b5d7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.