> ## Documentation Index
> Fetch the complete documentation index at: https://docs.proofage.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Liveness and anti-spoofing

> Liveness detection and anti-spoofing check that a live person is at the camera, not a photo, a screen or a print, on the selfie and on the document images.

Someone trying to pass as another person, or as older than they are, can hold a photo, a screen or a mask up to the camera. Liveness and anti-spoofing check that the selfie shows a real, present person.

## How it works

* **During capture**, the widget takes the selfie from the live camera only: there is no way to upload a file instead. The widget guides the person through the capture, including a short head movement, so it records a live face.
* **After submit**, the selfie is analysed for signs of a presentation attack: a face shown on a screen, printed on paper, or one that is not a real human face.
* On KYC and age verification by ID document, the **document images** are checked the same way, for a document photographed from a screen, printed, or shown as a photo of a photo.

## When the head movement cannot be completed

Where ProofAge's own head-movement check decides, a facial age estimation never falls back to an ordinary selfie. A check that cannot finish for technical reasons (the connection drops or the camera stream breaks) is tried up to three times. A temporary outage of ProofAge's check does not use up a try. After the third failed try, the verification ends `resubmission_requested` with the reason `selfie.liveness.incomplete`, and the person can start again, on a stable connection or on another device. A try where the camera never started sending, for example because the person had not yet allowed the camera, does not count.

A person who does not complete the head movement (does not turn, turns too little or not back to the centre) is asked again, up to three times in all. If none of the three is completed and none showed signs of a presentation attack, the verification ends `resubmission_requested` with `selfie.liveness.not_completed`, and the widget explains how to make the movement. If any of them showed such signs, it is declined with `selfie.liveness.failed`, also when a later try broke off for technical reasons. Either way the attempt limit of the verification still applies. A check that finished and showed no live person is still declined. If the check fails on ProofAge's side after the person finished it, the verification ends `resubmission_requested` with `verification.processing.failed`, never declined.

## Where it runs

| Workspace type | Selfie | Document images |
| - | - | - |
| Identity (KYC) | Yes | Yes |
| Age verification by ID document | Yes | Yes |
| Facial age estimation | Yes | Yes, when it falls back to a document |

## In the API and the webhook

A presentation attack declines the verification; a selfie too poor to judge asks the person to retake it. A document that only might have been photographed from a screen is retaken once, with a `quality` reason, before a screen declines it. Either way the verification's `reason` names it; there is no separate liveness object.

## Reasons

| Code | Outcome |
| - | - |
| `selfie.spoof.screen_suspected` | Declined |
| `selfie.spoof.print_suspected` | Declined |
| `selfie.spoof.non_human_suspected` | Declined |
| `document.front.spoof.screen_suspected`, `document.back.spoof.screen_suspected` | Declined |
| `document.front.spoof.print_suspected`, `document.back.spoof.print_suspected` | Declined |
| `document.front.spoof.photo_suspected`, `document.back.spoof.photo_suspected` | Declined |
| `selfie.quality.screen_attack_suspected`, `selfie.quality.spoof_suspected` | Resubmission requested |
| `selfie.liveness.incomplete` | Resubmission requested |
| `selfie.liveness.not_completed` | Resubmission requested |
| `document.front.quality.screen_suspected`, `document.back.quality.screen_suspected` | Resubmission requested |

All reasons are listed in [Decision reasons](https://docs.proofage.net/core-technology/decision-reasons.md).

## What the person is asked to do

On a resubmission the widget asks for a new selfie, taken live, in even light, with the face fully visible. A declined verification is final; if you decide to let the person try again, create a new verification.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.