|
26 | 26 | "PolicyClassifierOutputLabel", |
27 | 27 | "PolicyEntityMatcherOutput", |
28 | 28 | "PolicyEntityMatcherOutputMatch", |
| 29 | + "PolicyEntityMatcherOutputMatchSignals", |
| 30 | + "PolicyEntityMatcherOutputMatchSignalsBrandImpersonation", |
29 | 31 | "Recommendation", |
30 | 32 | "Error", |
31 | 33 | ] |
@@ -245,13 +247,60 @@ class PolicyClassifierOutput(BaseModel): |
245 | 247 | labels: Optional[List[PolicyClassifierOutputLabel]] = None |
246 | 248 |
|
247 | 249 |
|
| 250 | +class PolicyEntityMatcherOutputMatchSignalsBrandImpersonation(BaseModel): |
| 251 | + brand: str |
| 252 | + |
| 253 | + method: Literal["registered_domain_token", "subdomain_token"] |
| 254 | + |
| 255 | + |
| 256 | +class PolicyEntityMatcherOutputMatchSignals(BaseModel): |
| 257 | + """Observable properties of a URL (URL Risk only). |
| 258 | +
|
| 259 | + Absent for allow/block list matches. |
| 260 | + """ |
| 261 | + |
| 262 | + bot_protection: Optional[bool] = None |
| 263 | + |
| 264 | + brand_impersonation: Optional[PolicyEntityMatcherOutputMatchSignalsBrandImpersonation] = None |
| 265 | + |
| 266 | + domain_age_days: Optional[int] = None |
| 267 | + |
| 268 | + final_url: Optional[str] = None |
| 269 | + |
| 270 | + has_email_setup: Optional[bool] = None |
| 271 | + |
| 272 | + has_suspicious_characters: bool |
| 273 | + |
| 274 | + is_link_shortener: bool |
| 275 | + |
| 276 | + is_reported: bool |
| 277 | + |
| 278 | + redirect_count: Optional[int] = None |
| 279 | + |
| 280 | + |
248 | 281 | class PolicyEntityMatcherOutputMatch(BaseModel): |
249 | 282 | match: str |
250 | 283 |
|
251 | 284 | probability: float |
252 | 285 |
|
253 | 286 | span: List[int] |
254 | 287 |
|
| 288 | + entity_type: Optional[str] = None |
| 289 | + """Sub-type of the entity match — e.g. |
| 290 | +
|
| 291 | + the NER key (email, phone, name, …) for PII matches. Absent for URL Risk and |
| 292 | + wordlist matches where the type is already encoded in the parent label. |
| 293 | + """ |
| 294 | + |
| 295 | + reasons: Optional[List[str]] = None |
| 296 | + """Stable codes explaining why a URL was flagged (URL Risk only).""" |
| 297 | + |
| 298 | + signals: Optional[PolicyEntityMatcherOutputMatchSignals] = None |
| 299 | + """Observable properties of a URL (URL Risk only). |
| 300 | +
|
| 301 | + Absent for allow/block list matches. |
| 302 | + """ |
| 303 | + |
255 | 304 |
|
256 | 305 | class PolicyEntityMatcherOutput(BaseModel): |
257 | 306 | """Entity matcher policy.""" |
|
0 commit comments