> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/document-ai/guides-1/fraud-detection.md).

# Fraud Detection

Fraud Detection runs alongside [Document Extraction](/document-ai/guides-1/document-extraction.md) in two background phases so it does not block processing.

Use [Set up fraud detection](/document-ai/working-with-document-ai/set-up-fraud-detection.md) for rule configuration and testing steps. This page defines phases, scoring, and access.

* **Pre-OCR** checks the raw file for visual forensic signals during upload.
* **Post-extraction** evaluates extracted data against configurable rules such as math or logic checks, compliance checks, and completeness checks.\
  Rule configuration for a document type is reached via **Document Types > Configure > Fraud Detection > Edit Rules**. **Rules** can come from pre-built templates, be authored in natural language, or be written as custom logic.

**Rule configuration** for a document type is reached via **Document Types > Configure > Fraud Detection > Edit Rules**.

<figure><img src="/files/Cw79hbDZsVgt1OOdPDA0" alt=""><figcaption><p>Fraud Detection for a document type, listing each configured rule with its description, Enabled state and weight, and Edit Rules top-right</p></figcaption></figure>

| Capability               | Description                                                                                      | Limit                                            |
| ------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
| Pre-OCR analysis         | Visual forensic checks on the raw file, before OCR                                               | Runs automatically if enabled; background thread |
| Post-extraction analysis | Rule-based evaluation of extracted field data                                                    | Runs automatically if enabled; background thread |
| Rule categories          | `math_logic`, `visual_forensic`, `social_engineering`, `compliance`, `completeness`, `threshold` | Defined categories used in scoring               |
| Rule sources             | Pre-built templates, natural-language rules, custom rule logic                                   | 70+ document types have recommended templates    |
| Rule weighting           | Each rule contributes a weight toward the overall risk score                                     | Weight range documented as 0–100                 |
| Risk levels              | Aggregate score maps to a risk level                                                             | CLEAN, LOW, MEDIUM, HIGH, CRITICAL               |
| Testing harness          | Run fraud rules against a previous extraction before enabling them live                          | Test extraction listing capped at 100 results    |
| Tenant configuration     | Enable or disable phases, adjust category weights, and set risk thresholds per document type     | Master on or off switch is admin-only            |

{% hint style="info" %}
Generic pre-OCR templates apply to all document types automatically when the pre-OCR phase is enabled. Only custom rules can be toggled per document type.
{% endhint %}

{% hint style="warning" %}
The documented rule weight range of 0–100 does not match the live rule-editing UI, where rule cards and the Create or Edit Custom Rule form both use a 0–10 scale with a default of 5.
{% endhint %}

<figure><img src="/files/tom9lQanVgwP7aKJnakv" alt=""><figcaption><p>Fraud Detection Checks — the 22 auto-enabled system checks grouped by category, each tagged Pre OCR with its weight on the 0–10 scale</p></figcaption></figure>

### Workflow

1. **Configure** — set up fraud rules for a document type by starting from a recommended template, writing a natural-language rule, or defining custom rule logic.
2. **Tune thresholds** — enable the pre-OCR and post-extraction phases you want, then set category weights and risk thresholds for the document type.
3. **AI review** — before saving, the assembled rule set is scored by an LLM with an overall score, strengths, and improvement suggestions that can be turned into additional rules.
4. **Test** — before going live, run the rule set against a previous extraction using the testing panel to confirm expected behavior.
5. **Pre-OCR check** — when a document is uploaded, visual forensic checks run against the raw file if the pre-OCR phase is enabled.
6. **Post-extraction check** — once extraction completes, the post-extraction phase evaluates extracted fields against the configured rules.
7. **Score and flag** — each rule passes, fails, is skipped, or errors. Category scores roll up into an overall score and risk level.
8. **Review** — open the fraud analysis for an extraction to see the risk level, category breakdown, and details for each failed rule.

<figure><img src="/files/sr5ZJknOdEF9sXhR3Zwm" alt=""><figcaption><p>Step 1 of Fraud Detection Ruleset under Templates, offering pre-built rules such as P.O. Box Domicile Prohibition and Collateral Asset Eligibility Filter, each with a category tag</p></figcaption></figure>

<figure><img src="/files/FJqmlTjZ7hmxEn582gyx" alt=""><figcaption><p>The same step under Manual, where selected custom rules are listed with edit and delete controls and New Rule</p></figcaption></figure>

```
Rule config → Pre-OCR analysis ⎫
⎬→ Consolidated result → Risk level
Post-extraction analysis ⎭
```

{% hint style="warning" %}
**Owner** and **Admin** have full access to rule configuration, including the AI review step and the testing harness. **Member** and **Viewer** can view the same rule set and use the testing harness under **Validate**, but cannot edit rules.
{% endhint %}

### Related pages

* [Set up fraud detection](/document-ai/working-with-document-ai/set-up-fraud-detection.md) explains rules, testing, and verdict review.
* [Document Types](/document-ai/guides-1/document-types.md) defines the document types and recommended templates used during setup.
* [Document Extraction](/document-ai/guides-1/document-extraction.md) provides the extracted fields this flow evaluates after processing.
* [Test Dashboard](/document-ai/guides-1/test-dashboard.md) helps validate extraction quality before you tighten fraud rules in production.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.uptiq.ai/document-ai/guides-1/fraud-detection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
