PIIGuard / Detectors
IP Address
Detects IPv4 and IPv6 addresses. Private/RFC 1918 addresses (192.168.x.x, 10.x.x.x, 172.16–31.x.x) are detected but flagged with lower severity — they identify a network segment, not an individual.
Endpoint: POST /v1/pii/detect/ip
Validation & Confidence
Structural validation for IPv4 (0–255 per octet) and IPv6 (full and compressed forms).
Public IPs: 1.0, medium severity. Private/RFC 1918: 0.7, low severity. Loopback (127.x.x.x): not returned.
Example
from instructeer.guards import PIIGuard
# api_key = os.environ["INSTRUCTEER_API_KEY"]
pii = PIIGuard(api_key="rg_your_key")
result = pii.detect_ip("Request from 203.0.113.42 and internal 192.168.1.5")// Response
[
{ "entity_type": "IP_ADDRESS", "value": "203.0.113.42", "severity": "medium", "confidence": 1.0,
"extra": { "version": "ipv4", "is_private": false } },
{ "entity_type": "IP_ADDRESS", "value": "192.168.1.5", "severity": "low", "confidence": 0.7,
"extra": { "version": "ipv4", "is_private": true } }
]Notes
- IPv6: Full (2001:db8::1) and compressed forms detected.
- Loopback: 127.0.0.1 and ::1 are not returned — they carry no identity information.
- Private IPs: Returned with low severity and is_private: true. Filter or down-rank based on your policy.