← All ivy-agents
IVYXSTUDIO · IVY AGENT
I

Invoice anomaly check

ivy.agent.invoice-anomaly-check · v0.1.0

ivyx

Holds a list of invoices against each client's usual and names the ones far above it, before they go out. The gap IVYX Agency's "Invoice anomaly checker" change fills with Flows when no tool of the agency covers it: Agency posts the invoices (and the usual per client, when it knows one) to this flow's webhook, and the result goes back through the agency's intake as kind invoice-anomalies, where each one is an Approve output decision. No model, no side effect: a median and a percentage.

Steps

In the order the agent's file lists them, each with where its inputs come from and the values the file fixes. A branch or a loop is a step too.

  1. 01
    Hold each invoice against its client's usual
    ivy.node.invoice-anomaly

    Holds every invoice in a list against its client's usual (the median of the client's other invoices in the list, or the usual the caller gives per client) and names the ones above a threshold, with how far above.

    takes
    invoices from the agent's input
    usual from the agent's input
    threshold_pct from the agent's input
    set
    threshold_pct 30
    returns
    kind, checked, anomalies
    Ivy Node

Nodes it brings

Adding this agent in IVYX Studio adds these nodes with it. A node your workspace already has is kept as it is, even at another version.

What it touches

Collected from what each of its nodes declares, plus the model call when a step is a model turn. A declaration is the author's statement, and it is what policy rules select on.

Its nodes declare no side effects.

Inputs

FieldTypeDescription
invoicesrequiredarrayThe invoices to check: client, number, date, amount.
usualobjectThe usual amount per client, when known.
threshold_pctnumberHow far above the usual counts; 30 when not given.
changeobjectThe IVYX Agency change this run carries out (id, title), echoed for the record.

Outputs

FieldTypeDescription
kindrequiredstringinvoice-anomalies: what this output is, for a receiver that takes several kinds.
checkedrequiredintegerHow many invoices had a usual to be held against.
anomaliesrequiredarrayThe invoices above the threshold, each with client, invoice, date, amount, usual, above_pct and a sentence.

Tests

2 of 2 test cases passed on Oct 25, 2026, in the publisher's own environment, before this version was published. The registry keeps that record; it does not run the cases again.

Requires: python:3.9

  • one-above

    Three invoices of one client, one far above the other two, name that one with how far above.

    given
    invoices [{"client":"Acme","number":"A1","amount":6500},{"client":"Acme","number":"A2","amount":6400},{"client":"Acme","number...
    expects
    kind equals invoice-anomalies
    checked equals 3
    anomalies.0.invoice equals A3
    anomalies.0.above_pct equals 185
  • nothing-unusual

    Invoices near their client's usual name nothing.

    given
    invoices [{"client":"Bluefin","number":"B1","amount":1050}]
    usual {"Bluefin":1000}
    expects
    kind equals invoice-anomalies
    checked equals 1
    anomalies equals []