# Deterministic reconciliation versus agent-led disputes

> Ledger corrections must come from deterministic code that balances every entry. Agents belong at the edges, triaging exceptions and drafting explanations, never applying the correction.

- Canonical: https://www.alpacamango.com/docs/deterministic-reconciliation-vs-agent-led-disputes
- Author: Space Dog Vin
- Published: 2026-11-23 · Updated: 2026-11-23
- Topics: Fintech, AI Agents, AI & Agents

**Payment mismatches that touch a ledger must be resolved by deterministic reconciliation code. An agent may triage the exception and draft an explanation, but it must never apply a correction.** The line is not about whether the model is clever; it is about whether the system can prove every entry balances.

A reconciliation pipeline is a set of pure functions over bank statement rows and internal payment records. Normalise, match, then post. For a payout of 100.00 EUR that settles as 99.94 EUR, the engine matches on the payment reference, holds the 0.06 EUR difference inside a configured tolerance, and posts a balanced set of entries: cash 99.94, settlement-fee clearing 0.06, and payment clearing 100.00. The same inputs produce the same journal, and the pipeline can be re-run against preserved inputs without altering already posted entries. That property is what an audit needs. A language model asked to fix the missing 0.06 EUR will produce an explanation, not an auditable entry. Its output is drawn from a distribution over plausible adjustments, and plausibility is not a ledger property.

## Where deterministic code is non-negotiable

The test is whether the output is the system of record. In accounts receivable, the journal is evidence of what happened, not a note about what might have happened. Deterministic reconciliation preserves a chain: input file, matching rules, thresholds, entry set. If the result is challenged later, the same code can be re-run against preserved inputs. An agent cannot offer that guarantee because two runs with the same prompt are not bit-for-bit reproducible across model revisions, and the only way to make them so is to remove the model.

## What an agent can safely do

Agents fit around the deterministic core as edge-case dispute triage. When the engine cannot match a row, it writes an exception like `state=unmatched`, `reference=PART-7734`, and `amount_delta=0.06`. An agent reads the exception and surrounding context, then returns a classification and an internal note. For the earlier settlement, it might say "intermediary fee on EUR payout" and cite the bank statement line. The deterministic layer then decides: if the classification maps to a configured rule, it posts the same balanced journal it would have posted had the match succeeded. The agent changed nothing. It only labelled an exception so that a rule, not a model, could move money.

## When an agent-led correction is legitimate

The case for an agent-led correction reduces to a non-authoritative workflow. If the ledger is an internal operations dashboard with a human approval before every post, an agent's proposed adjustment is a draft and the human is the control. That is fine for a small ops queue. But once the system produces a book entry without a human in the path, the model must not be in the posting path. The cost of a hallucinated correction is not the correction itself; it is discovering months later that the ledger cannot explain a balance difference. No amount of model memory repairs that.
