> 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/fraud-detection.md).

# Fraud Detection

Fraud Detection runs alongside document extraction in two background phases so it does not block processing.

* **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**

A document type is reached via **Document Types > Configure > Fraud Detection > Edit Rules**.

| 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 %}


---

# 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/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.
