Give the Agent a Complete Job
Follow one invoice from three source records to a review-ready case, then build the smallest agent that can finish that job.
The invoice says ten. The receiving record says eight. Someone in accounts payable is about to open three systems, check the line items and ask a warehouse colleague what happened to the other two.
That is a useful first job for an agent. It has a clear beginning, records that can be inspected, and an ending that helps the next person act. The first useful result is a review-ready case with the disagreement already isolated.
Prepare the case the reviewer actually needs.
- Starts with
- An invoice and access to its purchase order and receiving records.
- Finishes with
- A checked case file: matched fields, unresolved differences, source references and a named next owner.
- May change
- The case record and, after separately authorized checks, a draft bill.
- Stays with people
- Disputed receipts, supplier changes, posting approval and payment.
Write down the handoff before building the agent
I would begin beside the person who checks invoices. Ask them to finish an ordinary case, then an awkward one, while showing which records they trust. Capture the searches, comparisons and interruptions. The interesting work is often the missing connection between two otherwise competent systems.
In this example, the agent must prepare a case for invoice I-482 against purchase order PO-271 and receipt R-88. The reviewer should not have to discover the mismatch again. They should see the invoice line, the relevant receipt, the comparison performed and the question that remains.
Define that handoff as an acceptance condition. A fluent summary without the source line fails. A mathematically correct comparison attached to the wrong supplier fails. An incomplete case can still be finished correctly if it names the missing record and routes the next action to its owner.
This is the practical continuation of Five Business Agents Worth Building: choose a piece of work whose output another person can use. Do not give the first agent responsibility for the entire finance department.
Give each fact a home
Keep the supplier identity in the approved supplier record, the order in the purchasing system and the receipt in the receiving system. The invoice is evidence of what the supplier is billing. It is not permission to change the supplier’s bank account or a substitute for confirmation that goods arrived.
The first case record should retain the original documents and the versions or retrieval times of the business records. Extraction adds proposed fields alongside them. A reviewer needs to find and correct a misread quantity without losing the original page.
The difference is small enough to point at.
Line 3 · item AX-4
Line 3 · item AX-4
Line 2 · item AX-4
Resolve identities before arithmetic. A supplier’s “case” of ten may be recorded internally as individual units. An invoice can span multiple receipts. A later receipt can change a comparison that was correct yesterday. Store which lines were matched and why; do not infer equivalence from similar descriptions alone.
Build a narrow extraction schema: supplier identifier, invoice number, currency, item identifier, quantity, unit, price and source location. Represent a missing or uncertain field explicitly. A model should not fill a gap just to satisfy a required field in the next system.
Let code compare and the model explain
Ordinary code should perform exact arithmetic, normalize approved units, check required fields and apply the organization’s matching tolerances. The model is useful for interpreting a document, finding a relevant policy passage and writing a concise explanation of an already computed difference.
For this case, the comparison function returns a quantity discrepancy of two units after item and unit checks pass. It does not decide whether a partial receipt is acceptable. The model can explain that result in the reviewer’s language and identify the warehouse owner who needs to clarify it.
Make the tool return business facts rather than a wall of application data. A comparison result can include the two source lines, the rule identifier, normalized values and the unresolved field. Anthropic’s guidance on tool design similarly emphasizes clear tool boundaries and useful responses.
Keep the explanation attached to the check.
item_match: true unit_match: true billed: 10 received: 8 quantity_delta: 2 rule: quantity_review_required
Two billed units are not established by the current receipt. Ask receiving to confirm the remaining delivery before proposing a bill for approval.
Give the model permission to say less. “The current records do not establish receipt of two units” is supportable here. “The supplier overbilled us” is a stronger claim that the records have not settled. Keeping that difference visible saves the reviewer from undoing an invented explanation.
Build a small working version in a harness
A first version can live in a configured agent harness such as Codex or Claude Code. Put approved test documents in a case folder, keep the procedure as a reusable skill or instructions, and supply a comparison script. The person running it should be able to inspect the source files and the script’s result.
Start with a read-only job: extract the proposed fields, compare the approved exports, create the case file and stop. Use synthetic or appropriately approved records while developing. Keep secrets in the environment’s credential facility and connect live systems only through tools with suitable permissions.
Run the same case several times. Ask whether the sources, match decisions and unresolved question remain correct, even if the prose varies. Then change one fact: a duplicate invoice number, a missing receipt, a credit note, a different unit or a receipt that arrives after the first review.
A test should inspect the saved case and any tool effects, not just the final message. Anthropic’s discussion of agent evaluations is useful on evaluating behavior across a complete run. For this workflow, the invariant is that an unresolved quantity never quietly becomes a matched bill.
A useful case gets clearer as it moves.
r1 Extracted and matched
I-482 linked to PO-271 and R-88. Item and unit identity checked. Quantity difference: two units. Status: awaiting receiving review.
r2 Receiving adds evidence
The case retains the first comparison and adds the new receipt or correction. The agent recomputes the difference against the updated source version.
r3 Ready for the next owner
The packet shows the current comparison, the resolved question, the relevant source versions and the next permitted action. Approval and posting remain separate.
Add the write that removes a real handoff
After staff can use the packet reliably, consider a draft-bill action. Give it a narrow input: the approved supplier, invoice identity, checked lines and the expected case version. The action should enforce its own permissions and reject a case whose required checks no longer hold.
Keep a stable operation identifier for the attempted write. If the connection times out, first look for the draft bill by that identifier or another supported correlation field. A second click should not create a second bill merely because the first response was lost.
A thin adapter may be enough to connect the harness to the accounting platform. A shared review screen becomes useful when several people need one queue, consistent field validation or a dependable handoff between shifts. Build those parts for the need they serve; the case work can still run in a harness.
At the end, show the reviewer a receipt for the work: which case version was processed, which draft record was created, which checks passed and what remains for approval. The useful boundary is the verified object the next person receives.
Could another person finish from here?
- 01Find the sourceEvery material field leads back to a document or authoritative record.
- 02Understand the holdThe exact unresolved comparison and its next owner are visible.
- 03Recover the attemptA restart or uncertain write can be investigated without recreating the work.
- 04Use the handoffThe reviewer receives a complete packet or a specific missing-information request.
Measure the staff handling effort and the quality of the downstream handoff against the current process. A fast packet that sends the reviewer back through all three systems has not completed the job you assigned. A modest agent that reliably removes that search and comparison work has earned a useful place in the team.