AI rules overview
Automate tagging, vendor cleanup, exclusions, and extraction hints with conditional rules.
AI rules overview
Admin+AI rules do the repetitive cleanup for you. Instead of renaming the same vendor on every invoice, tagging each subscription by hand, or deleting the newsletters that slip through, you write the instruction once and it runs on every document from then on.
What a rule can do
A rule watches for something, then acts on it. Common jobs:
- Tag every charge from a software vendor as a subscription.
- Replace a messy legal name with a clean one, so "Amazon Web Services, Inc." becomes "AWS".
- Exclude order confirmations and newsletters so they never turn into invoices.
- Add a tag like "travel" or "software" to make filtering and export easier later.
- Pass a hint to the AI, such as "always treat this sender's documents as receipts".
How a rule is built
Every rule has two halves: conditions (what to watch for) and actions (what to do).
Conditions live in two groups. All means every condition must match. Any means at least one must match. The rule fires when both groups are satisfied.
Actions are what happens when the rule fires. A single rule can add or remove tags, set the vendor name, mark the document as a subscription, exclude it, add an instruction for the AI, or stop the remaining rules from running.
If one rule adds a tag and another removes the same tag, the removal wins.
Before or after the AI reads the document
Each rule runs in one of two passes.
- Before (the pre phase) can look at the email and the file name. It can exclude a document before any credit is spent.
- After (the post phase) can use what the AI extracted, such as the vendor, total, or currency.
- Both runs in each pass.
A document excluded by a "before" rule never reaches extraction, so it costs nothing.
Priority
Rules run in order, and lower priority numbers run first. The Stop action halts the rest, which is useful when one rule should win outright.
Where rules live
Open Dashboard → Rules (admin or owner only). The list shows each rule's priority, phase, and whether it is switched on. You can toggle a rule off without deleting it.

Rules apply going forward. Existing documents are not re-checked when you add or change a rule. To apply a new rule to older documents, reprocess them from the document detail view.

The same builder powers Email Routing
The condition language here also drives Email Routing. Email Routing is a separate paid add-on, but once you have built an AI rule, the routing editor works the same way.
Reference
Condition fields
| Field | When you can use it | Type |
|---|---|---|
| Email from | Before | |
| Email subject | Before | text |
| Email to | Before | |
| File name | Before | text |
| File type | Before | text |
| Vendor name | After | text |
| Merchant name | After | text |
| Total | After | number |
| Currency | After | text |
| Document kind | After | text |
| Invoice number | After | text |
| Receipt number | After | text |
| Is subscription | After | yes/no |
| Tags | After | list |
A "before" rule cannot use the "after" fields, because the AI has not read the document yet.
Operators by field type
- Text and email: equals, not equals, contains, does not contain, starts with, ends with, matches regex, is empty, is not empty. Email fields add "domain is", which matches the part after the
@and includes subdomains, somail.amazon.commatchesamazon.com. - Number: equals, not equals, greater than, less than, greater or equal, less or equal, is empty, is not empty.
- Yes/no: equals, is empty, is not empty.
- List (Tags): contains, does not contain, is empty, is not empty.
Text comparisons ignore case.
Related
AI rule examples
Ready-to-copy recipes.
Tags
What rules add and remove.
Vendors
The other axis of categorization.
Ready to try this?
Inbox Ledger turns your inbox into clean accounting data. The free tier includes 10 credits, refilled every 30 days.
Start free