Aidan Aniciete

AIS Audit Sandbox

Case study

A practice audit of a made-up company’s purchase payments, checked against its own policy, people and vendor list.

JavaScript · a new random company every round · three-way match · built with a lot of help from AI

Why I built it

I hadn’t started my accounting classes yet, and I didn’t want to wait for them to start learning how fraud shows up in a company’s records.

So I built something to practice on. I leaned on AI to write most of the code. I decided what it should do and checked what came out, which is how the two fixes further down this page happened.

I expected the rounds to be easy, since I’d made them. They weren’t, which was the point.

How it works

Each round makes up a company with a procurement policy, a staff directory with approval limits, an approved vendor registry, and a year of 18 to 22 purchase payments. Four to eight of those payments break the policy. You open each payment’s documents, check them against the company files, and flag the ones that break the rules with the type of problem.

Duplicate payment
A PO that was already paid gets paid again on a second invoice.
Split purchase
Two or three POs for the same project from the same vendor within 30 days. Each is within the approver’s limit, but together they’re over it.
Unregistered vendor
The vendor paid isn’t on the registry. Some are near-copies of registered names, like “Metro Cleaning Service” for “Metro Cleaning Services”.
Vendor mismatch
The PO and receiving report name one vendor, and the invoice and payment go to another.
Missing receiving report
A PO and an invoice, but nothing shows the goods arrived.
Unauthorized approval
The PO total is over the approver’s limit, or the approver can’t approve for that department.
Qty mismatch
The invoice bills for more units than the PO ordered and the receiving report shows arrived.
Price mismatch
The invoice charges a higher unit price than the PO agreed to.

The company files

Policy, people and vendors

Every round comes with a short procurement policy, a directory of the company’s staff with their departments, reporting lines and approval limits, and a searchable registry of approved vendors. Those are what you check the documents against.

The documents

Three-way match

Each payment opens its purchase order, receiving report and invoice. The match is worked out from the documents themselves: vendor, quantity, unit price, and whether the invoice adds up. The PO also lists every payment made against it and any other POs for the same project and vendor.

The traps

Clean payments that look wrong

Each round has two or three clean payments built to look suspicious: an amount right at an approver’s limit, a large payment a director approved, two orders from the same vendor a few days apart for different projects, or a registered vendor with a vague name. Flagging them counts as a wrong flag.

The result

Scoring

The score balances precision, how many of your flags were right, against recall, how many of the problems you found (an F1 score). Flagging everything finds every problem and still scores badly.

Fix one: my risk math

The first version double-counted duplicate payments. When a PO was paid twice, the at-risk total added up both payments, so a $5,000 duplicate showed as $10,000 at risk.

That was wrong. The first payment was for goods the company actually received. Only the second is money that shouldn’t have gone out.

I changed the total so it counts only the duplicate payment, and changed the issue count so a duplicate pair counts as one issue instead of two.

Fix two: an answer key the evidence has to support

The bigger problem came later. The answer key came from whatever the generator had planted, not from the evidence. A single $24,700 payment was marked as threshold splitting, though one purchase under a limit doesn’t show splitting. An “unregistered” vendor was really a name that differed between the PO and the invoice, and there was no vendor list to check it against. The three-way match was decided by the answer key instead of the documents, some totals were a few cents off from rounding, and wrong flags didn’t lower the score.

So I rebuilt it:

What it simplifies

Real fraud is quieter than this. A few things the sandbox makes easier than real life:

Under the hood

Technical appendix

Each round

The sandbox picks one of eight companies and a fiscal year, then builds its staff (a CEO, a CFO, two directors, a manager and a supervisor for each of four departments, and two receiving clerks) and a registry of twelve vendors.

Problems are planted first, then two or three trap payments, then ordinary payments until the ledger has 18 to 22 rows. Document numbers run in date order. Every round comes from a seed, so a test can rebuild exactly the same company.

How each problem is made

Duplicate payment
The original payment is clean. The duplicate comes 6 to 30 days later on the same PO and receiving report, with the invoice resubmitted under the same number plus “-A”.
Split purchase
Two or three POs a few days apart with the same project, vendor and approver, a supervisor or a manager. Each is within the limit and together they’re over it.
Unregistered vendor
A vendor the department buys from that isn’t registered this round, or a near-copy of a registered name. The PO, receiving report and invoice all use it.
Vendor mismatch
The invoice goes to a different registered vendor in the same department.
Missing receiving report
No receiving report is created for the PO.
Unauthorized approval
A supervisor or manager approving more than their limit, or approving within it for another department.
Qty mismatch
The invoice bills 10 to 40 percent more units than were ordered and received.
Price mismatch
The invoice unit price is 12 to 35 percent above the PO’s.

Try the sandbox

A different company and a different set of problems every round.

Back to top ↑