Agentic Workflow

Revenue Leakage Auditor

Platform
Opus 5.5
Role
Revenue Assurance Analyst
Expertise
B2B SaaS Billing & Payments
Year
2026
Revenue Leakage Auditor screenshot

Project Description

Agents judge, code counts, and a human approves every fix.

This workflow reads every account in a software company’s billing data and finds the revenue quietly slipping through the cracks.

AI agents weigh the evidence on each case the way an auditor would, plain code calculates every dollar, and each fix arrives drafted and ready for a person to approve.

On a synthetic $18.0M-ARR SaaS company, the audit found $423,697/yr of leakage (2.35% of ARR) across 49 accounts, plus $358,176 of at-risk ARR reported separately. Graded against a hidden answer key, it scored 100% precision and 100% recall and cleared all 14 decoys.

The Business Impact

Most companies lose a slice of revenue they've already earned, and nothing ever flags it. A discount that was supposed to end keeps applying. A customer uses more than their plan covers and is never billed for it. A price increase reaches some accounts but not others. A card payment fails and nobody follows up. Each one is small, so they pile up quietly for years. Finding them usually means a manual audit, so it rarely happens.

This auditor does that job in minutes, and a person signs off on every fix.

  • Recovers money the business already earned. On a test company with $18.0M in annual recurring revenue, it found $423,697 a year slipping through billing, about 2.35% of revenue. Under conservative assumptions, $371,183 of that is recoverable. None of it requires winning a new customer.

  • Turns an occasional audit into a six-minute job. It went from raw billing exports to 56 ready-to-review fixes in 5m 54s, ranked by dollar value. Each one comes with the customer email, the billing change, and a note on the risk. That's fast enough to run every billing cycle instead of once a year.

  • Never bills a customer by mistake. A wrong charge costs more than the leak it was meant to fix. The test data included 14 traps: cases that look like leaks but are legitimate, such as a VP-approved discount or a payment recorded outside the billing system. It cleared all 14, so not one wrong email would have gone out.

  • Warns you before revenue walks out the door. It also flagged $358,176 at risk: top accounts whose cards are about to expire with no backup payment on file. That's not lost yet, so it's reported separately from leakage.

  • Keeps people in charge. Nothing changes until someone approves it. Fixes are sorted by how much they could annoy the customer (19 low-friction, 25 medium, 12 high), so the easy wins can be approved in one click and the sensitive ones get a closer look.

Why the model never touches the money math

SQL finds every candidate, and Python computes every dollar with a formula shown on screen, for example 22 extra techs × $45 × 12 = $11,880/yr. The model does what code can't: decide whether "VP Sales approved 20% for 24 months" makes a discount legitimate, weigh the risk of a fix, and write to the customer. Any draft that contains a dollar figure the code didn't produce fails validation and is sent back.

Assumptions (labeled in the demo): recovery odds of 55% (insufficient funds), 40% (do not honor), and 80% (expired card); discounts should end at their intended end date; overage of $45/tech/month persists at the latest month's level; at-risk ARR = ARR × 35% failure rate.

Agentic Workflow Structure

A0 · Ingest & Reconcile: code

  • Purpose: One trusted view of billing.

  • Inputs: 10 CSV tables: accounts, subscriptions, invoices, payment attempts, usage, contracts, CRM notes, and more.

  • Process: Load into DuckDB and reconcile invoices against payment attempts.

  • Outputs: Data-health summary: row counts, ARR, open AR.

  • Checks: Invoice totals tie to subtotal − discount + overage.

A1–A5 · Detectors + Triage: code, then 5 agents in parallel

  • Purpose: Find candidates; judge each from billing data alone.

  • Inputs: SQL candidates with billing-only evidence bundles (no contracts, no CRM).

  • Process: One triage subagent per leak type returns leak, likely_intentional, or insufficient_evidence, with a rationale of 40 words or fewer and cited evidence.

  • Outputs: 70 candidates; none dismissed at triage in Run 2.

  • Checks: Schema validation; every evidence ref must exist in the input.

A6 · Adjudicator: agent (the circuit breaker)

  • Purpose: Stop false positives before they reach a person.

  • Inputs: Each surviving candidate plus contract, CRM notes, and discounts.

  • Process: Challenge each finding: is there an authorized reason that still applies on the audit date?

  • Outputs: 56 upheld, 14 overturned, each with a reason and a confidence level.

  • Checks: Cited notes and terms must exist; anything below high confidence is listed for a second look in the queue.

A7 · Quantifier: code only

  • Purpose: Every dollar figure.

  • Inputs: Detector facts for upheld findings.

  • Process: Fixed formulas per leak type.

  • Outputs: Annualized, recoverable, and at-risk dollars, with a readable equation and assumptions.

  • Checks: Tests re-evaluate every equation, and every figure matches the answer key's independent computation.

A8 · Remediation Drafters: 5 agents in parallel

  • Purpose: A fix someone can send or execute.

  • Inputs: Upheld findings and A7's figures.

  • Process: Choose the action and friction; draft the customer email, internal change, and risk note.

  • Outputs: 56 proposals.

  • Checks: 90-word limit, sign-off, allowed actions, and no dollar figure the code didn't produce.

A9 · Approval Gate: human

  • Purpose: Nothing is applied automatically.

  • Inputs: The queue, sorted by recoverable dollars.

  • Process: Approve or reject. High-friction approvals show their risk note.

  • Outputs: Recovered ARR and forgone dollars.

  • Checks: Every action is a proposal until a person acts.

Send me a message

Ready to ship?
Let's talk.