How validation works
This page is the architectural explanation of validation. If you want the practical "how do I configure it" guide, see Configuring rule severity. If you want the rule-by-rule reference, see Validation Rules.
The two layers
Validation in Mod AI is a stack with two layers that run together:
System rules
Platform-defined checks that ship with Mod AI. Currently:
- Duplicate Invoice detection.
- Duplicate Credit Memo detection.
- Line-item three-way match.
These apply to every entity. You cannot create new system rules from the UI, but you can override their severity. See Configuring rule severity.
Integration hooks
Code-defined checks that run for specific ERP integrations. For example, a customer on SAP may have additional logic the system runs to verify SAP-specific fields.
Hooks are deployed by Mod AI as part of the integration. They are not configurable per-tenant from the UI. See Tenant validation for the hooks that exist today.
When checks run
Both layers run at the same point in the invoice lifecycle:
- The agent finishes extracting the invoice.
- System rules run.
- Integration hooks run.
- Errors from both layers are merged into a single result.
- If there are blocking errors, the invoice surfaces a validation failure notice and the status moves to Pending Validation.
- If there are only warnings, the invoice continues to approval routing but the warnings surface as notices on the invoice.
Validation also runs on demand when you click the Validate action.
Severity levels
Each check produces a result with a severity:
- error: blocking. The invoice cannot proceed until the issue is resolved.
- warning: non-blocking. The invoice can proceed but the issue is visible to reviewers and approvers.
- info: informational. Surfaced for awareness; no action required.
- disabled: the check did not run.
Administrators can override severity per rule. See Configuring rule severity.
Where results show up
Three surfaces.
The Validation Failed panel
When blocking errors fire, a Validation Failed panel appears in the right side of the invoice detail page above the AI Summary. It lists each error with its severity, the field it affects, and the recommended action. Click a flagged field to jump to it.
Notices
Some validation outcomes surface as standalone notices on the invoice (in the right panel):
- A duplicate detection match generates a duplicate invoice notice or duplicate credit memo notice.
- A blocking error from any rule or hook generates a validation failure notice that lists every blocking error.
- A processing failure during extraction generates a processing error notice.
- A significant price difference against the last approved invoice for the same vendor and item generates a price change detected notice.
The activity log
Every validation run is recorded in the invoice's activity log: who triggered it, when, and the result. Useful for audit.
How errors are categorized
Each validation error carries a category that describes what kind of check failed:
- match: a matching check (duplicate detection, three-way match).
- required: a required field is missing.
- business_rule: a business rule check (typically from an integration hook).
- format: a field is in an invalid format.
- sum_check: line item totals do not add up to the invoice total.
- general: something else.
Each flagged error in the Validation Failed panel surfaces its category, which helps reviewers see at a glance what kind of issue they are looking at.
Soft revalidation
When you fix the underlying field or data, click Validate to re-run all rules and hooks. If everything now passes, the validation failure notice clears and the invoice continues. See Soft Revalidation.