Opening each supplier invoice, copying the number, due date, and amount into the accounts payable spreadsheet is one of the most boring tasks of the week. The agent can read and calculate, flag duplicate invoices, and flag totals that don’t match. The one thing it never does is pay: the list comes out as a draft, and the bank is yours to handle.
Goal: have the agent read invoices and bills and make the accounts payable list, flagging duplicate invoices and totals that don’t match.
01 · From a stack of invoices to a list of bills
Click each step.
Click each block in the diagram to see what it does.
You always review money going out. The agent only takes care of typing and adding things up.
02 · The sheet and four sample invoices
The invoices are made up. Two have a problem on purpose.
Sheet · invoices and bills agent
Role: You are my accounts payable agent.
About me: [what the business does]; frequent suppliers and categories: [Strong Pine Lumber = raw materials; Baker Accounting = services].
When: when I attach or paste the week's invoices and bills and say "invoices".
Steps: 1) for each document, extract the supplier, number, date, due date, items, and total; 2) add up the items and compare the sum with the printed total; 3) check whether the same supplier with the same number has already appeared in this batch or in the list of invoices already entered that I paste; 4) make a table: supplier, number, due date, total, category, status; 5) add up the week's total using only invoices without issues.
Rules: read only, never change or delete anything; login screen = stop and call me; copy the numbers exactly; if the sum doesn't match or a number is illegible, mark it "doesn't match" and leave it out of the total; duplicate invoice: mark it "duplicate" and leave it out of the total; never pay, approve, or schedule a payment; never ask for a bank password; everything is a draft for me to check; if you're unsure, stop and ask.
Delivery: the table sorted by due date and, below it, the week's total and the list of items left out, with the reason.
First task: run it now with the invoices I’m going to paste.
Practice · four documents
invoices
Document 1 · Invoice 4471 · Strong Pine Lumber · issued Oct 27 · due Nov 10
MDF panels: 1,100.00 · shipping: 150.00 · TOTAL: 1,250.00
Document 2 · Invoice 5120 · Miller Hardware · issued Oct 28 · due Nov 12
hinges: 480.00 · pulls: 320.00 · TOTAL: 900.00
Document 3 · Invoice 4471 · Strong Pine Lumber · issued Oct 27 · due Nov 10
MDF panels: 1,100.00 · shipping: 150.00 · TOTAL: 1,250.00
Document 4 · Bill 311 · Baker Accounting · due Nov 15
November accounting fees · TOTAL: 650.00
Simulation: illustrative example
Invoice 4471 (Strong Pine Lumber): 1,250.00, due Nov 10, OK.
Bill 311 (Baker Accounting): 650.00, due Nov 15, OK.
Invoice 5120 (Miller Hardware): doesn't match. The items add up to 800.00 and the total says 900.00. Left out of the total.
Document 3: invoice 4471 duplicate. Left out of the total.
Week's total: 1,900.00.
Accounts done by hand using the example. You resolve invoice 5120 with the supplier; the agent doesn't decide which amount is correct.
In the my-agents/invoices folder, with the sheet in AGENTS.md (or CLAUDE.md), put the week’s PDFs in a week subfolder and run codex exec --skip-git-repo-check -m gpt-6-luna -s read-only -o bills.md "invoices: follow AGENTS.md using the files in the week folder".
If a PDF is a scanned image and the light model can’t read it, it should say "couldn’t read" (that’s the rule), and you can send it to the top model or type it in.
Letting the agent "fix" the total: it can't know whether the line item or the total is wrong. You resolve it with the vendor.
Sending only the total, without the line items: without the line items, it has nothing to add up.
Giving it bank access "just to read the statement": that's outside this course's scope. Export the statement if you need to.
03 · Check the agent's table
Run the agent with the four sample invoices and paste the table it returned here. The page checks for the duplicate invoice, the one that doesn’t match, and the correct total for the week.
bills.txt
04 · Practice: the week's bills
Practice with the example, then with your invoices.
E1 · The practice run
10 min
Create the "Accounts payable" Project with the sheet, paste the four sample invoices, and say "invoices". Paste the answer into the checker.
Done when: the checker replies OK: 5120 marked as doesn't match, 4471 as duplicate, and total of 1,900.00.
E2 · Your invoices
20 min
Attach real invoices and bills from one week. Before copying them into your spreadsheet, check two totals on paper.
Done when: the two checked totals match the table, and the agent hasn't paid any invoice.
E3 · The category list
5 min
Add your five most frequent vendors to the agent sheet, along with each one's category.
Done when: in the next round, invoices from these vendors get the right category without you asking.
05 · Test what you learned
The explanation appears after your answer.
Question 1 of 3
On invoice 5120, the items add up to 800.00 and the printed total says 900.00. What should the agent do?
Correct
The agent doesn't know where the error is: in an item or in the total. You handle it with the vendor. Its job is to find the difference and keep it out of the calculation.
That's not it
The agent doesn't know where the error is: in an item or in the total. You handle it with the vendor. Its job is to find the difference and keep it out of the calculation.Review: From a stack of invoices to a list of bills
Question 2 of 3
With the four sample invoices, what is the total due for the week?
Correct
Only the invoices without a problem count: 1,250.00 (4471) + 650.00 (bill 311) = 1,900.00. Invoice 5120 doesn't match, and document 3 is a duplicate of 4471. 4,050.00 is the sum of everything, without checking.
That's not it
Only the invoices without a problem count: 1,250.00 (4471) + 650.00 (bill 311) = 1,900.00. Invoice 5120 doesn't match, and document 3 is a duplicate of 4471. 4,050.00 is the sum of everything, without checking.Review: The sheet and four sample invoices
Question 3 of 3
Why should the invoice agent never get the bank password, not even "just to read"?
Correct
Bank read access opens the door to everything else. An exported statement lets the agent read it without risk. The password doesn't go in the agent sheet, AGENTS.md, or the chat.
That's not it
Bank read access opens the door to everything else. An exported statement lets the agent read it without risk. The password doesn't go in the agent sheet, AGENTS.md, or the chat.Review: From a stack of invoices to a list of bills
Test complete
You got {a} out of {n} right. Get them all right to mark the lesson as complete.
Choose an option. The explanation appears after you try.
06 · The lesson in three sentences
Read and add upThe agent extracts the details from each invoice and checks whether the items add up to the total.
Flag it, don't fix itDuplicates and items marked "doesn't match" stay out of the total, with the reason noted. You handle the issue.
Your bank is yoursThe list comes out as a draft. You handle paying, approving, and scheduling.