Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ All notable changes to this project are documented in this file. The format foll

### Changed

- Public risk-signal slugs are `network_check_incomplete`, `banned_ip`, `private_relay` and `latency_test`. Webhook flag parsers still accept `stun_not_checked`, `rate_limited`, `privacy_relay` and `ws_tcp_latency`. The score marker band stays `rate_limited`. History columns stay `is_stun_not_checked`, `is_rate_limited`, `is_privacy_relay` and `is_latency_test`.
- Public risk-signal slugs are `network_check_incomplete`, `rate_limited`, `private_relay` and `latency_test`. Webhook flag parsers still accept `stun_not_checked`, `banned_ip`, `privacy_relay` and `ws_tcp_latency`. History columns stay `is_stun_not_checked`, `is_rate_limited`, `is_privacy_relay` and `is_latency_test`.
- `DetectionFlags` follows webhook schema `2026-10-13`: 20 public booleans. `vpn` covers a network VPN and an in-browser VPN or proxy. `os_mismatch` covers either operating-system mismatch check. The public set adds `ws_tcp_latency`, `device_spoofing`, `rate_limited`, `ai_bot` and `ai_browser`.

### Added
Expand Down
6 changes: 3 additions & 3 deletions src/shieldlabs/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class SignalName:
DATACENTER_IP = "datacenter_ip"
ABUSER = "abuser"
TIMEZONE_MISMATCH = "timezone_mismatch"
RATE_LIMITED = "banned_ip"
RATE_LIMITED = "rate_limited"


@dataclass(frozen=True)
Expand Down Expand Up @@ -174,7 +174,7 @@ class DetectionFlags:
latency_test: bool = False
anti_detect_browser: bool = False
device_spoofing: bool = False
banned_ip: bool = False
rate_limited: bool = False
incognito: bool = False
search_bot: bool = False
ai_bot: bool = False
Expand All @@ -190,7 +190,7 @@ def from_dict(cls, data: Mapping[str, Any]) -> DetectionFlags:
"private_relay": "privacy_relay",
"network_check_incomplete": "stun_not_checked",
"latency_test": "ws_tcp_latency",
"banned_ip": "rate_limited",
"rate_limited": "banned_ip",
}
return cls(
**{
Expand Down
8 changes: 6 additions & 2 deletions src/shieldlabs/_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"latency_test",
"anti_detect_browser",
"device_spoofing",
"banned_ip",
"rate_limited",
"incognito",
"search_bot",
"ai_bot",
Expand All @@ -72,6 +72,7 @@
"latency_test": "is_latency_test",
"anti_detect_browser": "is_antidetect",
"device_spoofing": "is_device_spoof",
"rate_limited": "is_rate_limited",
"banned_ip": "is_rate_limited",
"incognito": "is_incognito",
"search_bot": "is_search_bot",
Expand Down Expand Up @@ -109,7 +110,9 @@
"Browser VPN/Proxy": "vpn",
"Browser Automation": "browser_automation",
"Port scan routed via proxy (antidetect browser pattern)": "proxy_routed_antidetect",
"User has been banned 1H, to many requests": "banned_ip",
"User has been banned 1H, to many requests": "rate_limited",
"private_relay": "private_relay",
"network_check_incomplete": "network_check_incomplete",
}

_PREFIX_SLUGS: tuple[tuple[str, str], ...] = (
Expand All @@ -118,6 +121,7 @@
("OS mismatch2", "os_mismatch"),
("TCP handshake", "tcp_handshake_v2"),
("Latency test", "latency_test"),
("latency_test", "latency_test"),
("JavaScript disabled", "javascript_disabled"),
)

Expand Down
18 changes: 9 additions & 9 deletions tests/data/normalization-cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"latency_test": false,
"anti_detect_browser": true,
"device_spoofing": false,
"banned_ip": false,
"rate_limited": false,
"incognito": false,
"search_bot": false,
"ai_bot": false,
Expand Down Expand Up @@ -246,7 +246,7 @@
"latency_test": false,
"anti_detect_browser": false,
"device_spoofing": false,
"banned_ip": false,
"rate_limited": false,
"incognito": true,
"search_bot": false,
"ai_bot": false,
Expand Down Expand Up @@ -385,7 +385,7 @@
"latency_test": false,
"anti_detect_browser": false,
"device_spoofing": false,
"banned_ip": false,
"rate_limited": false,
"incognito": false,
"search_bot": false,
"ai_bot": false,
Expand Down Expand Up @@ -485,7 +485,7 @@
"risk_score": 999,
"signals": [
{
"name": "banned_ip",
"name": "rate_limited",
"weight": 999,
"description": "User has been banned 1H, to many requests"
}
Expand All @@ -504,7 +504,7 @@
"latency_test": false,
"anti_detect_browser": false,
"device_spoofing": false,
"banned_ip": false,
"rate_limited": false,
"incognito": false,
"search_bot": false,
"ai_bot": false,
Expand Down Expand Up @@ -621,7 +621,7 @@
"latency_test": false,
"anti_detect_browser": false,
"device_spoofing": false,
"banned_ip": false,
"rate_limited": false,
"incognito": false,
"search_bot": true,
"ai_bot": false,
Expand Down Expand Up @@ -769,7 +769,7 @@
"latency_test": false,
"anti_detect_browser": true,
"device_spoofing": false,
"banned_ip": false,
"rate_limited": false,
"incognito": false,
"search_bot": false,
"ai_bot": false,
Expand Down Expand Up @@ -899,7 +899,7 @@
"latency_test": false,
"anti_detect_browser": false,
"device_spoofing": false,
"banned_ip": false,
"rate_limited": false,
"incognito": false,
"search_bot": false,
"ai_bot": false,
Expand Down Expand Up @@ -1047,7 +1047,7 @@
"latency_test": false,
"anti_detect_browser": false,
"device_spoofing": false,
"banned_ip": false,
"rate_limited": false,
"incognito": false,
"search_bot": false,
"ai_bot": false,
Expand Down
2 changes: 1 addition & 1 deletion tests/data/signal-slug-cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
{
"description": "User has been banned 1H, to many requests",
"slug": "banned_ip"
"slug": "rate_limited"
},
{
"description": "Antidetect browser (turn_block)",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def test_history_page_rows_match_normalization_cases() -> None:
def test_known_signal_names_are_plain_strings() -> None:
assert SignalName.ANTIDETECT_BROWSER == "antidetect_browser"
assert SignalName.STUN_LATE_CORRECTION == "stun_late_correction"
assert SignalName.RATE_LIMITED == "banned_ip"
assert SignalName.RATE_LIMITED == "rate_limited"


def test_models_are_frozen() -> None:
Expand Down
Loading