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

# Document Fraud Detection

> AI-powered fraud analysis for identity documents using computer vision.

Document Fraud Detection uses AI vision models to analyze uploaded identity documents for signs of tampering, forgery, and manipulation. Every document uploaded to Verilock is automatically scanned for fraud signals.

## How It Works

<Steps>
  <Step title="Document upload">
    The user uploads an identity document (passport, ID card, driver's license) through the hosted flow or API.
  </Step>

  <Step title="AI analysis">
    The AI engine analyzes the document image for visual inconsistencies, font anomalies, edge tampering, and metadata manipulation.
  </Step>

  <Step title="Fraud scoring">
    The analysis produces a fraud score (0-100), a recommendation, and a list of specific fraud signals detected.
  </Step>

  <Step title="Decision">
    The fraud score feeds into the session's overall risk score and can trigger orchestration rules for automatic decisions.
  </Step>
</Steps>

## Fraud Signals

Verilock detects the following fraud indicators:

| Signal                  | Description                                                                |
| ----------------------- | -------------------------------------------------------------------------- |
| `font_mismatch`         | Text uses inconsistent fonts compared to known genuine templates           |
| `edge_tampering`        | Visible cut-and-paste artifacts or irregular edges around text or photo    |
| `photo_overlay`         | Selfie photo appears to be digitally overlaid onto the document            |
| `metadata_mismatch`     | Image EXIF data inconsistent with document (e.g., edited in Photoshop)     |
| `resolution_anomaly`    | Inconsistent resolution across different areas of the document             |
| `micro_print_absent`    | Expected security micro-printing not detected                              |
| `hologram_absent`       | Expected holographic elements not visible                                  |
| `color_profile_anomaly` | Color saturation or gradient inconsistencies versus genuine templates      |
| `barcode_mismatch`      | Machine-readable zone (MRZ) or barcode data conflicts with visual text     |
| `screen_capture`        | Document appears to be a photo of a screen rather than a physical document |

## Fraud Score

| Score Range | Level        | Recommendation                                      |
| ----------- | ------------ | --------------------------------------------------- |
| 0 -- 15     | **Low**      | `accept` -- no fraud indicators detected            |
| 16 -- 40    | **Medium**   | `review` -- minor anomalies worth manual inspection |
| 41 -- 70    | **High**     | `review` -- multiple fraud signals present          |
| 71 -- 100   | **Critical** | `reject` -- strong evidence of fraud or tampering   |

## API Response

Fraud detection data is included in the session detail response (`GET /v1/sessions/{id}`):

```json theme={null}
{
  "id": "ses_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "declined",
  "document": {
    "type": "passport",
    "issuing_country": "GB",
    "fraud_detection": {
      "fraud_score": 78,
      "fraud_level": "critical",
      "fraud_recommendation": "reject",
      "fraud_signals": [
        {
          "signal": "font_mismatch",
          "confidence": 0.92,
          "description": "Surname field uses a different font weight than expected for this document type"
        },
        {
          "signal": "edge_tampering",
          "confidence": 0.87,
          "description": "Irregular edges detected around the photo area"
        },
        {
          "signal": "metadata_mismatch",
          "confidence": 0.95,
          "description": "EXIF data indicates image was last modified in an editing application"
        }
      ],
      "analyzed_at": "2026-03-18T10:00:00Z"
    }
  }
}
```

### Clean Document Example

```json theme={null}
{
  "document": {
    "type": "id_card",
    "issuing_country": "DE",
    "fraud_detection": {
      "fraud_score": 5,
      "fraud_level": "low",
      "fraud_recommendation": "accept",
      "fraud_signals": [],
      "analyzed_at": "2026-03-18T10:00:00Z"
    }
  }
}
```

## Response Fields

| Field                         | Type    | Description                               |
| ----------------------------- | ------- | ----------------------------------------- |
| `fraud_score`                 | integer | Document fraud score (0-100)              |
| `fraud_level`                 | string  | `low`, `medium`, `high`, or `critical`    |
| `fraud_recommendation`        | string  | `accept`, `review`, or `reject`           |
| `fraud_signals`               | array   | List of detected fraud indicators         |
| `fraud_signals[].signal`      | string  | Signal identifier                         |
| `fraud_signals[].confidence`  | number  | Detection confidence (0-1)                |
| `fraud_signals[].description` | string  | Human-readable description of the finding |
| `analyzed_at`                 | string  | ISO 8601 timestamp of analysis            |

## Security Features

* **Template matching** -- documents are compared against a library of genuine templates for 190+ countries
* **Cross-field validation** -- MRZ data is validated against visual OCR for consistency
* **Recapture detection** -- detects photos of screens, printouts, or photocopies
* **EXIF analysis** -- image metadata is checked for editing software signatures

<Note>
  Fraud detection runs automatically on all document uploads. No additional configuration is required.
</Note>

<Tip>
  Combine document fraud detection with orchestration rules to auto-decline sessions with critical fraud scores, or route medium-risk documents to your compliance team for manual review.
</Tip>
