Fraud flags
What each document and selfie check means, and whether a retry is worth offering.
When a document scan isn't CLEAR, Hub returns flags explaining why. This page tells you what each one means.
You only receive flags if Partial document results (allowPartialResults) is true. Otherwise you get Document S or Document R with no detail. See Document verification.
Where they appear
Flags are claims in the userinfo response from Step 5, next to scan_result. In dual mode and subject matching, they're inside the document result (com.securekey.vids). With detailed error reporting, the Auth Report API also returns them.
Here are the relevant claims from a userinfo response. The second tab shows the full response.
{
"scan_result": "REJECTED",
"suspected_flags": ["visual_authenticity", "face_match"],
"rejected_flags": ["document_expiration", "data_consistency"]
}{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "drivers_license",
"source": "driving_licence",
"scan_result": "REJECTED",
"suspected_flags": ["visual_authenticity", "face_match"],
"rejected_flags": ["document_expiration", "data_consistency"],
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"address": {
"street_address": "4101 Yonge Street",
"locality": "Toronto",
"region": "ON",
"postal_code": "M2P 1N6",
"country": "CAN"
},
"doc_number": "S12345678901234",
"issue_date": "2016-03-15",
"expiry_date": "2021-03-15",
"issuing_country": "CA",
"issuing_authority": "ON",
"nationality": "N/A",
"dcn": "RG1234567",
"acn": "0012345678",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}| Array | Meaning |
|---|---|
rejected_flags | Checks that caused the rejection |
suspected_flags | Checks that raised concern |
AREJECTEDresult can carry both arrays. Don't assumerejected_flagsis the only one populated — read both.
scan_result follows the priority REJECTED > SUSPECTED > CLEAR.
Four rules for reading the arrays
1. An empty array is absent, not empty. If nothing was flagged as suspected, there is no suspected_flags key at all. Use a default:
suspected = claims.get("suspected_flags", [])
rejected = claims.get("rejected_flags", [])const suspected = claims.suspected_flags ?? [];
const rejected = claims.rejected_flags ?? [];// path() returns an empty node when the key is absent
JsonNode suspected = claims.path("suspected_flags");
JsonNode rejected = claims.path("rejected_flags");var suspected = claims["suspected_flags"]?.AsArray() ?? new JsonArray();
var rejected = claims["rejected_flags"]?.AsArray() ?? new JsonArray();2. Document flags come first, then selfie flags. Both are appended into the same array, so a single suspected_flags can mix document checks and selfie checks.
3. The same flag can appear in either array. data_consistency, for example, lands in rejected_flags when it's serious enough to reject and in suspected_flags when it isn't. Don't hard-code a flag to one array — read whichever array it arrives in.
4. REJECTED can carry both arrays. The result is rejected because rejected_flags is non-empty, but concerns raised elsewhere still appear in suspected_flags.
Example responses
The same driver's licence, failing three different ways. Only the flags and scan_result differ.
{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "drivers_license",
"source": "driving_licence",
"scan_result": "SUSPECTED",
"suspected_flags": ["face_match"],
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"address": {
"street_address": "4101 Yonge Street",
"locality": "Toronto",
"region": "ON",
"postal_code": "M2P 1N6",
"country": "CAN"
},
"doc_number": "S12345678901234",
"issue_date": "2021-03-15",
"expiry_date": "2031-03-15",
"issuing_country": "CA",
"issuing_authority": "ON",
"nationality": "N/A",
"dcn": "RG1234567",
"acn": "0012345678",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "drivers_license",
"source": "driving_licence",
"scan_result": "REJECTED",
"rejected_flags": ["document_expiration"],
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"address": {
"street_address": "4101 Yonge Street",
"locality": "Toronto",
"region": "ON",
"postal_code": "M2P 1N6",
"country": "CAN"
},
"doc_number": "S12345678901234",
"issue_date": "2014-03-15",
"expiry_date": "2024-03-15",
"issuing_country": "CA",
"issuing_authority": "ON",
"nationality": "N/A",
"dcn": "RG1234567",
"acn": "0012345678",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "drivers_license",
"source": "driving_licence",
"scan_result": "REJECTED",
"suspected_flags": [
"data_validation",
"visual_authenticity",
"spoofing_detection",
"face_match"
],
"rejected_flags": [
"document_expiration",
"data_consistency",
"conclusive_document_quality"
],
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"address": {
"street_address": "4101 Yonge Street",
"locality": "Toronto",
"region": "ON",
"postal_code": "M2P 1N6",
"country": "CAN"
},
"doc_number": "S12345678901234",
"issue_date": "2014-03-15",
"expiry_date": "2024-03-15",
"issuing_country": "CA",
"issuing_authority": "ON",
"nationality": "N/A",
"dcn": "RG1234567",
"acn": "0012345678",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}In the third example, data_validation and visual_authenticity are document checks and spoofing_detection and face_match are selfie checks — merged into one array in that order.
Don't trust the extracted data on aREJECTEDresult. Fields such asgiven_nameandbirthdateare still returned, but the checks that would confirm them are exactly the ones that failed.
Document image quality
Usually a bad photo rather than a bad document. Worth offering a retry.
| Flag | Meaning |
|---|---|
image_quality | The image wasn't good enough quality to process |
colour_picture | The image was black and white, which prevents a full assessment |
conclusive_document_quality | The image wasn't sufficient to determine genuine or fake |
face_detection | No face was found in the document portrait |
Live selfie
Relates to the selfie, not the document. Retry value varies — a lighting problem is worth retrying, a face mismatch is not.
| Flag | Meaning | Retry? |
|---|---|---|
face_detected | A face of sufficient quality couldn't be determined from the live photo | Yes |
face_match | The live photo doesn't match the portrait on the document | No |
source_integrity | The live photo was untrustworthy — digitally tampered with, or taken from a webcam | No |
spoofing_detection | The live photo wasn't real — a photo of a portrait, or a screenshot | No |
Document authenticity
Signs the document may not be genuine. Not worth an automatic retry.
| Flag | Meaning |
|---|---|
visual_authenticity | Visual features don't match a genuine document — missing portrait, a photo of a screenshot, wrong fonts, an altered portrait, missing security features, or the wrong template |
data_consistency | The same data in two or more places on the document didn't match, such as the printed text versus the barcode or machine-readable zone |
data_validation | Document data isn't in the expected format — a wrong date format, or an unexpected length |
compromised_document | The document has been flagged as compromised by the scanning service. Not an authoritative check. |
police_record | Reported lost, stolen or compromised to law enforcement. Not available in Canada. |
Eligibility and configuration
Not about the document's authenticity at all — the document simply can't be used.
| Flag | Meaning | What to do |
|---|---|---|
supported_document | The document type isn't supported by the service | Ask for a different document |
filtered_document | A supported document, but not one of the document types you accept | Ask the user for a document type you accept |
document_expiration | The document has expired | Ask for a current document, or ask for Expired documents (allowExpiredDocs) to be set to true |
minimum_accepted_age | The document belongs to someone under 16 | No retry possible |
field_validation | A field your client requires as mandatory couldn't be read — often the document number | Retry may help if it was a quality problem |
Tell users up front which documents you accept
filtered_documentmeans the user presented a valid document that isn't one of the document types you chose during onboarding. Listing the documents you accept before the user starts helps them come prepared with the right one.
Deciding what to do
A rough guide. Your own risk policy takes precedence.
| Category | Flags | Typical handling |
|---|---|---|
| Quality | image_quality, colour_picture, conclusive_document_quality, face_detection, face_detected | Offer a retry with guidance on lighting and framing |
| Eligibility | supported_document, filtered_document, document_expiration, minimum_accepted_age | Explain the problem; offer a different document where possible |
| Authenticity | visual_authenticity, data_consistency, data_validation, compromised_document, police_record | Don't auto-retry. Offer another way to verify, or decline. |
| Selfie mismatch | face_match, source_integrity, spoofing_detection | Don't auto-retry. Offer another way to verify, or decline. |
Don't show raw flag names to users.spoofing_detectiontells a genuine user nothing and tells a fraudulent one exactly what to fix. Map flags to a neutral message and handle the detail server-side.
Availability
Not every flag can be raised for every verification. The checks available depend on the document type and on the scanning service used for your client, and the set may change over time.
Treat this list as non-exhaustive. Write your handler so an unrecognised flag falls back to a sensible default rather than throwing. New flags can be added.
Related
Updated 3 days ago