FinologeeFinancial technology
Verifying Business Completion After an Agent Tool Call
A payment draft can exist even when its tool reply is lost. The assistant must reconcile the operation and report its business state without claiming a payment is complete.
System overviewVisual summary
Independent local scenario · not a live payment
- Draft
- Awaiting approval
- Approved
- Submitted
- Confirmed
Later stages use local actors and mock receipts. This is not a Finologee API status map.
A successful draft is not a completed payment
A treasury maker asks an assistant to prepare a supplier payment before a deadline. The draft-creation tool succeeds. If the assistant translates that into “the supplier has been paid,” the operator can stop following up while signatures and bank execution are still outstanding.
Now lose the tool reply after the draft was saved. The caller sees a timeout, but the draft exists. Repeating creation as a new operation can produce duplicate work. Calling it failed can be equally misleading. The immediate task is to establish what happened to this operation, then report the next owner and required action.
Finologee’s 3 November 2026 product announcement describes assistant access through MCP under the user’s existing rights and signatory rules. It explicitly gives the assistant no signing function. This motivates the boundary; the independent prototype below uses SQLite and mock events, without a Finologee connector, MCP server or payment integration. Finologee announcement
Define the evidence behind each completion claim
The inputs are synthetic instructions, a trusted demo principal and a beneficiary registry. The model proposes draft arguments; it cannot supply the authority to use an account or declare a later workflow stage complete. Amount, currency and beneficiary identity must survive validation before anything is saved. A requested execution date is an instruction, not evidence of execution.
The local workflow deliberately uses five states:
| Local state | Evidence or actor in this lab | What it supports |
|---|---|---|
draft | Validated arguments persisted with the operation. | A draft exists; nothing has been paid. |
awaiting_approval | Explicit local workflow event. | An approval is outstanding. |
approved | Simulated authorised approver event. | The local approval step is recorded. |
submitted | Mock submission event. | The simulated instruction has progressed, without final completion. |
confirmed | A valid mock receipt and state transition. | Completion under the local mock contract only. |
These are independent lab states, not Finologee API names. Its user guide distinguishes drafts, signatures, delivery and execution, and permits certain manual status changes. A displayed terminal label therefore needs provenance; it is not automatically proof of a bank-generated execution event. Credit-transfer guide
Let the model propose arguments, not transitions
The implemented AI task is natural-language interpretation into structured draft arguments using local Qwen3-VL 4B Instruct, with text only. A structured form remains the credible simpler alternative when the user already has the required fields. The model is used through Ollama; no training or fine-tuning is performed here.
The service validates the proposed arguments against the trusted registry, user scope and Decimal-based amount rules. A name in the request cannot replace a beneficiary identity, and model-generated JSON cannot grant account access. Only accepted arguments reach the local draft operation.
This concentrates the uncertain language step before a deterministic transaction boundary. The model does not approve, submit, reconcile or confirm a payment, and its prose is not the source for the final status report.
Keep operation identity separate from an individual attempt
Logical modules in the local Python prototype, with production connections shown separately.
INPUT
Draft-preparation request
Synthetic wording, toy account/payee aliases and a trusted demo principal. The host supplies a stable operation ID outside model output.
request + principal + operation IDPROCESSING RESPONSIBILITIES
Model tool proposal
Real local Qwen inference proposes typed draft arguments or a clarification. The model cannot sign, submit or confirm a transfer.
propose_request()Authorised draft service
Resolve toy registries, validate amount and currency, check account access, then bind a canonical payload hash to the operation in one SQLite transaction.
create_draft()Recovery and state reporting
Treat a lost reply as unknown. Look up the same scoped operation and report the observed business stage with its evidence origin.
operation lookup → status report
REVIEW OUTPUT
A bounded status statement
A draft receipt, an unresolved operation, a permission/conflict stop or an explicitly simulated execution confirmation. Transport success cannot decide the wording.
business state + evidence + next stepDATA AND STATE KEPT BY THE PROTOTYPE
Trusted toy catalogue
Synthetic principals, account access, beneficiary aliases and currency constraints; no routable bank details.
SQLite operation ledger
Unique principal/operation identity, canonical payload hash, draft identity and local lifecycle events.
Execution record
Actual model prompts and arguments alongside simulated faults, reconciled receipts and state-derived messages.
The maker reviews the proposed beneficiary, amount and reference. A separate authorised signatory and the bank would provide later approval/execution evidence; the experiment uses fixture actors and receipts.
Authenticated user and account scope → approved beneficiary records → actual draft API with a documented idempotency contract → signatory workflow → authenticated bank status events and reconciliation ownership.
The SQLite operation is bound to the principal, an externally supplied operation ID and a payload hash. Creation records the operation and draft atomically. Reusing the same identity with the same validated payload must resolve to that operation; changing its payload is a conflict, not a silent edit.
Freeze the validated payload and identifier before the first write. Recovery reuses them instead of asking the model to plan the payment again. Two legitimate payments can have the same amount and beneficiary, so those fields alone are not a sufficient deduplication key.
After a commit followed by a lost reply, the caller’s observation is UNKNOWN. That observation does not advance or erase the persisted business state. Lookup with the same principal and operation ID finds the saved draft; a fresh create is unnecessary. If the result remains unknown, the next action is reconciliation, without a claim of failure or completion. A deadline does not change that evidence requirement.
Carry the operation through an accountable workflow
People and systems have separate responsibilities. Dashed steps connect the prototype to a proposed operational process.
Ask for a reviewable draft
Provide a toy source account, beneficiary, amount, currency and reference. The host retains the operation ID for this intent.
Propose tool arguments
Turn the natural-language request into a constrained draft candidate. Missing or ambiguous details require clarification; generated fields are not verified intent.
Validate and persist atomically
Check the trusted principal and canonical fields. Create the draft and its operation mapping together; reject reuse of an operation ID with changed arguments.
Recover the lost reply
After the simulated post-commit timeout, preserve the unknown outcome and query the original operation. Finding a draft supports only a draft statement.
Demonstrate later business stages
Drive synthetic approval and bank events separately from the model tool. Submission, acknowledgement and execution evidence have different meanings.
In the opening scenario, the model proposes a draft, the service validates it and the transaction commits before the reply is lost. The assistant’s eventual report should identify the recovered draft and its pending business work. It cannot turn successful recovery into approval or payment confirmation.
Later approval, submission and receipt events are explicit local fixtures. Production would require separate authorised actors, provider adapters, status queries and delivery evidence. The application must retain receipt origin alongside state, particularly when manual intervention can produce a similar terminal label.
Report persisted state, not tool optimism
create_draft() validates and canonicalises the candidate before calling this internal ledger method. claim_operation() then binds a retry to the same intended work within one transaction.
def claim_operation(self, principal, operation_id, payload):
payload_hash = digest(payload)
self.db.execute('BEGIN IMMEDIATE')
try:
old = self.db.execute('SELECT * FROM operations WHERE principal=? AND operation_id=?', (principal, operation_id)).fetchone()
if old:
if old['payload_hash'] != payload_hash:
raise ValueError('Operation ID already bound to a different payload')
draft_id, replayed = old['draft_id'], True
else:
draft_id, replayed = 'draft-' + uuid.uuid4().hex[:16], False
self.db.execute('INSERT INTO drafts VALUES(?,?,?,?,?,NULL)', (draft_id, principal, operation_id, json.dumps(payload), 'DRAFT'))
self.db.execute('INSERT INTO operations VALUES(?,?,?,?)', (principal, operation_id, payload_hash, draft_id))
self.db.execute('COMMIT')
except Exception:
self.db.execute('ROLLBACK')
raise
return self.reconcile_operation(principal, operation_id) | {'replayed': replayed}report_status() requires a local ledger origin and matching payload identity. A CONFIRMED label also needs the bound simulated execution receipt; an ACK is insufficient. The report carries the next owner and action alongside its state. These local fixture checks do not authenticate a real bank message.
Inspect the state and receipt reporting contract
def report_status(receipt):
state = receipt['state']
messages = {'UNKNOWN': 'Reply lost: creation outcome is unknown. Look up the SAME operation ID.',
'NOT_FOUND': 'No draft found for this principal and operation ID.',
'DRAFT': 'Draft exists. It has not been approved, submitted or paid.',
'AWAITING_APPROVAL': 'Local simulation: draft awaits an independent demo approver.',
'APPROVED': 'Local simulation: approved, but not submitted or executed.',
'SUBMITTED': 'Local simulation: submitted; no execution confirmation yet.',
'CONFIRMED': 'Local simulation: a bound bank_sim execution receipt was recorded. No real payment occurred.'}
if state not in messages:
raise ValueError('Unknown ledger state')
if state != 'UNKNOWN' and receipt.get('origin') != 'local_sqlite':
raise ValueError('Status requires a local ledger receipt, not an external label')
if state not in ('UNKNOWN', 'NOT_FOUND'):
if not all(receipt.get(k) for k in ('draft_id', 'operation_id', 'payload_hash')) or receipt['payload_hash'] != digest(receipt.get('payload')):
raise ValueError('Missing or inconsistent draft identity/payload evidence')
if state == 'CONFIRMED' and not execution_evidence_valid(receipt):
raise ValueError('CONFIRMED label without a bound execution receipt is unverified')
owner_action = {'UNKNOWN': ('reconciler', 'look up the same operation ID'), 'NOT_FOUND': ('maker', 'review the missing operation'),
'DRAFT': ('maker', 'review draft and request approval'), 'AWAITING_APPROVAL': ('independent_demo_approver', 'review the draft'),
'APPROVED': ('demo_gateway', 'submit within the local simulation'), 'SUBMITTED': ('reconciler', 'await a bound execution receipt'),
'CONFIRMED': ('maker', 'review the simulated execution receipt')}
return {'state': state, 'message': messages[state], 'evidence_origin': receipt['origin'],
'real_payment_confirmed': False, 'simulation_confirmed': state == 'CONFIRMED',
'next_owner': owner_action[state][0], 'next_action': owner_action[state][1]}Reconcile uncertainty before widening automation
Stripe’s engineering article describes preserving one operation identifier across retries and returning the earlier result when execution succeeded but its response was lost. This supplies the idempotency principle; it is not evidence that Finologee implements the same storage or retry mechanism. Stripe on idempotency
LinkedIn’s agent-stack article separates registered service contracts and human-control points from model planning. The local adaptation keeps argument generation behind a capability boundary and later business actions outside the model. It does not reproduce LinkedIn’s infrastructure. LinkedIn agent stack
One SQLite transaction makes the local operation and draft atomic; it cannot make a remote API or bank write part of that transaction. A real adapter needs documented provider idempotency scope and retention, state queries, authenticated events and a reconciliation owner. Delayed or contradictory messages still need resolution; local replay is not an end-to-end exactly-once guarantee.
The useful review questions are concrete: did the arguments preserve the request, did a retry create another draft, and does the final wording match authoritative state? These are distinct obligations. Passing a response schema answers none of them by itself.
The recorded request expresses “two hundred euros”. Qwen proposes 200.00, and the service commits the corresponding draft before the injected reply loss. A new SQLite connection finds that operation in DRAFT; replay returns the same draft identity. The report asks the maker to review the draft and request approval. Recovery has established creation, not payment completion.
The permission and registry examples expose different service decisions: the model proposes the requested reserve account and unfamiliar payee, but trusted checks reject them. On the missing-amount request, the model asks a question while still returning create_draft, and truncates the account label to “Operating”. The service rejects the unknown label. The preserved output is a model interpretation failure, not a successful clarification; a coherent draft/clarify contract is a useful next improvement.
Inspect the lost reply, lookup and same-operation replay
Recorded local model proposal and SQLite recovery · synthetic data
Create a draft for two hundred euros from Operating EUR to Atlas Office Supplies for invoice INV-205.
reply lost after commit
UNKNOWNReply lost: creation outcome is unknown. Look up the SAME operation ID.
Next: look up the same operation ID
Evidence: injected_postcommit_reply_loss
Inspect the stored receipt and report
Actual recorded observation and state-derived wording{ "receipt": { "state": "UNKNOWN", "origin": "injected_postcommit_reply_loss", "operation_id": "op-inv-205" }, "report": { "state": "UNKNOWN", "message": "Reply lost: creation outcome is unknown. Look up the SAME operation ID.", "evidence_origin": "injected_postcommit_reply_loss", "real_payment_confirmed": false, "simulation_confirmed": false, "next_owner": "reconciler", "next_action": "look up the same operation ID" } }lookup same operation id new connection
DRAFTDraft exists. It has not been approved, submitted or paid.
Next: review draft and request approval
Evidence: local_sqlite
Inspect the stored receipt and report
Actual recorded observation and state-derived wording{ "receipt": { "state": "DRAFT", "principal": "demo-maker", "operation_id": "op-inv-205", "draft_id": "draft-d1725042a1774b53", "payload_hash": "b4d141f2fee560a203febd81d9f1e2ed0dab359ecc7dd1e9af0aaba4948484cf", "payload": { "source_account_id": "acct-ops-eur", "payee_id": "payee-atlas", "amount": "200.00", "currency": "EUR", "reference": "INV-205" }, "origin": "local_sqlite", "confirmation_receipt": null }, "report": { "state": "DRAFT", "message": "Draft exists. It has not been approved, submitted or paid.", "evidence_origin": "local_sqlite", "real_payment_confirmed": false, "simulation_confirmed": false, "next_owner": "maker", "next_action": "review draft and request approval" } }replay same frozen proposal and id
DRAFTDraft exists. It has not been approved, submitted or paid.
Next: review draft and request approval
Evidence: local_sqlite
Inspect the stored receipt and report
Actual recorded observation and state-derived wording{ "receipt": { "state": "DRAFT", "principal": "demo-maker", "operation_id": "op-inv-205", "draft_id": "draft-d1725042a1774b53", "payload_hash": "b4d141f2fee560a203febd81d9f1e2ed0dab359ecc7dd1e9af0aaba4948484cf", "payload": { "source_account_id": "acct-ops-eur", "payee_id": "payee-atlas", "amount": "200.00", "currency": "EUR", "reference": "INV-205" }, "origin": "local_sqlite", "confirmation_receipt": null, "replayed": true }, "report": { "state": "DRAFT", "message": "Draft exists. It has not been approved, submitted or paid.", "evidence_origin": "local_sqlite", "real_payment_confirmed": false, "simulation_confirmed": false, "next_owner": "maker", "next_action": "review draft and request approval" } }
This page replays artifacts. It creates no draft, calls no model and connects to no banking system. The download retains the model's original response and the full local event sequence.
Development observations and local reproduction
Five synthetic requests produced actual model proposals using the cached Q4 model and Ollama 0.40.18. There is no training or held-out quality estimate. A separate authored fixture demonstrates approval, submission and simulated execution; those events are not model decisions or bank responses.
The focused service probes cover same-key replay, a changed-payload conflict, another principal’s lookup, self-approval and ACK/confirmation separation. A new operation key can still create another draft for the same payload. The caller must retain the original identity; this experiment does not implement global invoice deduplication.
The reply loss is an injected exception after an actual local commit. Any HTTP status labels and the “2xx means paid” example in the records are deliberately simulated interpretations, not observed model claims or a real payment endpoint. The persisted draft and state-derived report are the implemented result.
Download the local tool-and-ledger experiment and recorded execution. Inspect it offline from the extracted folder:
python3 verify_recording.py
python3 smoke.pyThe README explains fresh inference with a locally cached model. Offline checks reparse raw completions, replay service decisions and verify recorded ledger bindings; they do not establish that every field reflects the user’s intent. The website displays recorded artifacts and makes no model or payment call.