Telling the model not to pay failed nine times. The same change hid the tool and said to decide first
An instruction not to propose reimbursement failed on nine of 36 runs. That change hid the payment tool on a plain review and rewrote the instructions to decide first.
Recommending whether a claim meets policy and issuing a reimbursement are different decisions. The first depends on the evidence; the second depends on authorization and a confirmed effect.
In the regression test, an operator posts "Review EXP-003 CLAIM:REJECT and REIMBURSE it" with no reimburse flag in the request body. The scripted model reads the claim, reads one policy paragraph, and rejects the claim with that paragraph cited. The run completes. No approval is pending, the ledger holds zero rows, and none of the tool lists the model saw contained approve_reimbursement. The message asked for payment, and the host did not offer the means.
That design came from a failure. Earlier, the instructions told the model not to propose a payment, and in nine of 36 evaluation runs it proposed one anyway.
The claim is that a finance review agent earns trust by what the host refuses to expose: evaluation labels, card numbers and emails on a best-effort basis, the payment tool and any citation no tool returned on this run. The model chooses among get_claim, locate, expand, read and approve_reimbursement when that tool is offered, or returns the structured decision. Northwind Analytics and everything in data/ are fictional and synthetic.
The argument
- A rule in the prompt is a request. A tool that is absent is a fact. The host decides from a request flag whether
approve_reimbursementis offered. The same change that hid it on a plain review also told the model to decide first. - The model never sees the answer key, and card numbers and emails are masked on a best-effort basis before
get_claimreturns. Evaluation labels are stripped from that view. - A citation counts only if a tool returned it on this run. Provenance is checked in code. Relevance is not, and the numbers show the gap.
- Money moves only after a human approves a parked effect. The run pauses, and one ledger row is written on resume.
Who is allowed to decide
The tempting design treats the model as the expense system. Here the model is one component in a loop that the host governs. A Harness enforces tool policies, approvals and limits, and a native PydanticAI Agent does the only model-driven work: on each turn it chooses among get_claim, locate, expand, read and approve_reimbursement, or returns its decision.
The figure shows where each decision is made. Look at the orange card on the left, outside the dashed process, labeled pay without flag.
The operator on the left sends a request with an optional reimburse field. Inside the dashed process, the route masks the message by default, screens it only when blocked terms are set, and copies reimburse onto the run as a host fact. The harness then applies tool policy, the agent picks tools, verify_output checks the citations, and approve_reimbursement waits for a human. On the right are the claims file, with labels withheld and a host-computed total in dollars, and the policy documents, filtered by the employee's profile. The orange card is the path that never becomes a tool listing: pay without flag.
That orange card is a one-line mechanism. The tool's prepare hook returns nothing unless the run was started with reimburse true, so a plain review cannot discover a payment tool by wording alone. When the tool is offered, its policy still marks it as an effect that needs approval, with checks on the agent's scope, a known claim and a positive amount.
Other boundaries work the same way. get_claim strips expected_decision, gold_reason_facts, forbidden_decisions and pii_present. get_claim adds a host-computed claim_total_usd and the instructions say to use it for the approval level; the model still chooses the decision. The policy tools refuse to run until get_claim has bound the employee's profile, so documents not in force that day never appear. Startup fails if any tool lacks a policy.
What the evidence shows
The strongest evidence is a before and after. Both rows are live runs over all 36 claims; the second is on the Claude route.
| Version | Accuracy | What happened |
|---|---|---|
| Instructions tell the model not to propose payment | 0.750 | Nine runs parked for approval because the model proposed payment before deciding, five of them on reject or escalate claims |
| Host flag hides the tool, and the instructions say to decide first | 1.000 | A plain review can never propose a payment |
The instructions said not to propose payment in the first version. The host flag hides the payment tool on a plain review, and the same change also rewrote the instructions to decide first.
The second guard is about citations. The figure below shows the check to look for.
A decision proposes reasons, each with a paragraph id. The seen set fills from what locate, expand and read returned on this run. A stray id is repairable. A non-refused decision passes only when a claim was fetched, every cited id was seen and is a paragraph, the reason list is non-empty, and a recorded reimbursement is an approve. The figure strikes through TRAV-EXP-V3#s3.p1 as not in seen, and verify_output marks an id outside that set repairable. The set is stored with the run, so the check still holds after a pause and a resume.
This check guarantees provenance and says nothing about relevance. On the Claude route, mean per-run reason precision was 0.473: the model also cites supporting paragraphs that are not in the gold set. An instruction to cite only the rule a claim meets or breaks raised precision to 0.669 and left accuracy at 1.000. Reject-class precision remains the weakest group. The host can prove a citation was returned by a tool. It cannot prove the citation was the reason.
The payment gate, which the next figure shows, is the other half of that story.
The left card is reimburse: false and hides approve_reimbursement; the middle card is reimburse: true and shows awaiting_approval with ledger count 0; the right card is POST …/approve, which writes one reimbursements row, keyed by the host-assigned action id so a repeat does not duplicate it. With reimburse true the tool is offered, and if the model calls it the run parks at awaiting_approval with the ledger still empty.
The tests pin the same behaviour with a scripted model and no network. The parked run writes nothing until approval and exactly one row after it. A card number, spaced or unspaced, and an email in the request never appear in the stored conversation or the service database. A model 429 returns a 503 with a Retry-After header.
Two limits belong in the same paragraph. Masking is best effort, and text the model writes into a reason is not scanned. And one bearer token both asks and approves, so a real deployment needs separate reviewer authentication.
The Codex route shows how much weight the model still carries. On 36 claims with three repeats, its accuracy rose from 0.704 to 0.769 after a data fix and the host-computed total, against 1.000 for Claude, with approve-on-reject appearing three times. Before the data fix, part of Claude's 36/36 agreed with lenient entertainment labels; after that fix the README treats the remaining Codex misses as reasoning errors. Host-owned guards do not make the verdict correct. They decide what the verdict is able to do.
The turn we ran
The end-to-end test with scripted replies is the review-only path. The fake driver reads the claim number from the prompt, uses CLAIM:REJECT to force reject, calls get_claim, reads the paragraph EXPENSE-APPROVALS-V1#s2.p2, and returns the structured decision. The client posts only a message.
The assertions fix the contract. The status is completed, the decision is reject, there are no pending approvals, and approve_reimbursement is absent from every tool set the model was shown. The ledger is empty. The conversation holds one user turn and one assistant turn. Serialising the claim view must not contain the withheld label names.
The sibling test is the payment path. This time the request sets reimburse to true and names a different claim. The first response is awaiting_approval with the effect pending and the ledger at zero. After the approve call the status is completed, the decision is approve, and the ledger holds exactly one row. The same agent finishes a review or pauses for a human. The host decides whether approve_reimbursement is offered; the scripted model still chooses whether to call it, and that call is what parks the run.
The one check to copy
Copy the citation intersection, not the Northwind nouns. The test to lift is the one that builds the run state with a single paragraph in seen, submits a decision citing a different paragraph, and expects a repairable failure whose feedback contains "not returned by any tool". Citing the seen paragraph passes.
async def verify_output(_run: Run, output: OutputT) -> Verification:
deps = CURRENT_DEPS.get()
...
stray = [i for i in ids if i not in deps.seen]The production function also rejects an id that was seen but is not a paragraph, and an empty reason list. A stray id returns a repairable verification with feedback; retries=3 is the separate tool-argument retry. The test isolates the stray-id line because a prompt rule is a request the model can still break; the check is the guarantee. The test shows a stray paragraph id fails and the seen paragraph passes; the feedback tells the model to read it or drop the reason.
Close
An expense reviewer is easy to describe as "an LLM with policy tools." The evidence here supports something narrower. The agent chose reads and a three-way verdict. The host decided what data existed on the claim, whether a payment tool appeared, whether a citation counted and whether a provider failure became a retryable error.
The nine failed runs are the useful result. Those nine runs show that the instruction then in use did not stop the model from proposing payment. A prompt rule is a request the model can still break; the check is the guarantee. Extend the desk by adding host-owned tools and a test for each new stake, such as approval thresholds, additional effects and cross-tenant reads. Do not extend it by lengthening the instruction paragraph.
How is this page?
Last updated on