| """Severity weights and category metadata for aggregation.""" | |
| SEVERITY_WEIGHT: dict[str, float] = { | |
| "critical": 1.0, | |
| "high": 0.75, | |
| "medium": 0.5, | |
| "low": 0.25, | |
| } | |
| DEFAULT_CATEGORIES: tuple[str, ...] = ( | |
| "prompt_injection", | |
| "tool_output_injection", | |
| "retrieval_poisoning", | |
| "memory_poisoning", | |
| "secret_exfiltration", | |
| "unauthorized_action", | |
| ) | |
| def severity_weight(severity: str) -> float: | |
| return SEVERITY_WEIGHT.get(severity.lower(), SEVERITY_WEIGHT["medium"]) | |