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"
}
ArrayMeaning
rejected_flagsChecks that caused the rejection
suspected_flagsChecks that raised concern
🚧

A REJECTED result can carry both arrays. Don't assume rejected_flags is 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 a REJECTED result. Fields such as given_name and birthdate are 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.

FlagMeaning
image_qualityThe image wasn't good enough quality to process
colour_pictureThe image was black and white, which prevents a full assessment
conclusive_document_qualityThe image wasn't sufficient to determine genuine or fake
face_detectionNo 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.

FlagMeaningRetry?
face_detectedA face of sufficient quality couldn't be determined from the live photoYes
face_matchThe live photo doesn't match the portrait on the documentNo
source_integrityThe live photo was untrustworthy — digitally tampered with, or taken from a webcamNo
spoofing_detectionThe live photo wasn't real — a photo of a portrait, or a screenshotNo

Document authenticity

Signs the document may not be genuine. Not worth an automatic retry.

FlagMeaning
visual_authenticityVisual 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_consistencyThe 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_validationDocument data isn't in the expected format — a wrong date format, or an unexpected length
compromised_documentThe document has been flagged as compromised by the scanning service. Not an authoritative check.
police_recordReported 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.

FlagMeaningWhat to do
supported_documentThe document type isn't supported by the serviceAsk for a different document
filtered_documentA supported document, but not one of the document types you acceptAsk the user for a document type you accept
document_expirationThe document has expiredAsk for a current document, or ask for Expired documents (allowExpiredDocs) to be set to true
minimum_accepted_ageThe document belongs to someone under 16No retry possible
field_validationA field your client requires as mandatory couldn't be read — often the document numberRetry may help if it was a quality problem
📘

Tell users up front which documents you accept

filtered_document means 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.

CategoryFlagsTypical handling
Qualityimage_quality, colour_picture, conclusive_document_quality, face_detection, face_detectedOffer a retry with guidance on lighting and framing
Eligibilitysupported_document, filtered_document, document_expiration, minimum_accepted_ageExplain the problem; offer a different document where possible
Authenticityvisual_authenticity, data_consistency, data_validation, compromised_document, police_recordDon't auto-retry. Offer another way to verify, or decline.
Selfie mismatchface_match, source_integrity, spoofing_detectionDon't auto-retry. Offer another way to verify, or decline.
❗️

Don't show raw flag names to users. spoofing_detection tells 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