check_password_breach
Check if a password has been exposed in data breaches using anonymized hash lookup. Use to validate new passwords or flag compromised credentials.
Instructions
Check if a password has appeared in known data breaches.
Uses the k-anonymity method: only the first 5 characters of the SHA-1 hash
of the password are ever sent over the network. The API returns a list of
matching hash suffixes which are compared locally — the full password and
hash are never transmitted. Data sourced from HaveIBeenPwned and similar
breach databases.
Use this to validate new passwords at registration or to prompt users
to change a compromised credential. Safe to call with real passwords due
to the k-anonymity design.
Args:
password: The password string to check. Transmitted as a partial hash
(first 5 chars of SHA-1 only) — never the plaintext password.
Returns:
breached (bool): True if the password appears in breach databases.
count: Number of times this password has been seen in breaches.
A count > 0 means the password should not be used.
A count of 0 means it has not been seen (not a guarantee of safety).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| password | Yes |