Invoice fraud detection

From XuShuwenn/RedAct · View interactive version

Invoice fraud detection is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Detect invoice fraud by checking vendor approval, IBAN matching, PO validity, and amount consistency.

How to use this skill

Skill file

Invoice Fraud Detection

When to Use

Input Files

Required Workflow

  1. Inspect the real schemas of vendors.xlsx and purchase_orders.csv before writing lookup logic; verify actual column names, types, and a few sample rows instead of assuming headers from this skill.
  2. Extract and inspect sample text from multiple invoice pages before applying fraud rules; confirm how vendor name, IBAN, PO number, amount, and any Vendor ID actually appear, and whether layouts vary.
  3. Validate extraction quality before matching: inspect representative pages from early, middle, and late portions of the PDF.
  4. Treat truncated, garbled, or partial extraction as incomplete evidence. If any page looks malformed or fields are missing unexpectedly, fix extraction first or use a fallback method; do not assume the field is absent from the invoice.
  5. Parse defensively: initialize missing values to null, guard all field lookups, and do not silently skip pages. Confirm expected page count matches extracted invoice records and that every page is accounted for.
  6. Before classifying fraud, inspect parsed vendor_name, iban, po_number, and invoice_amount on representative pages, including at least one flagged and one unflagged invoice when available.

Fraud Criteria (in priority order)

  1. Unknown Vendor: Vendor name not in vendors.xlsx (use fuzzy matching for typos)
  2. IBAN Mismatch: Vendor exists but IBAN doesn't match
  3. Invalid PO: PO number not in purchase_orders.csv
  4. Amount Mismatch: PO exists but amount differs by > 0.01
  5. Vendor Mismatch: PO linked to different Vendor ID

Output Format

JSON at /root/fraud_report.json:

[
  {
    "invoice_page_number": 1,
    "vendor_name": "Acme Corp",
    "invoice_amount": 5000.00,
    "iban": "US1234567890",
    "po_number": "PO-1001",
    "reason": "IBAN Mismatch"
  }
]

Verification Before Finalizing

Verification Before Finalizing

Tips

Extraction Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.