Composite study

This is a product-class write-up, not a named-client story and not a results press release. Counts below describe the pack we actually write (approach points, tools, layers) — not invented bug totals or conversion lifts.

4
Approach points
5
Tools in the pack
5
Layers covered
3
Challenges documented

Overview

The happy path sent one payout. When the tool timed out, the agent retried with a new idempotency key because the model “helpfully” generated a fresh reference.

A second issue: the model called refund and payout in one turn when the ticket text was ambiguous.

Industry pattern this is grounded in

Double-pay from retries is a classic payments defect. Putting an LLM in front of the same APIs adds a second retry loop the PSP never saw.

Highlights

Typical launch bar: Block until pass rules hold on the money, identity, or safety path.

Challenges

01

Staging PSP and production PSP behaved differently on timeout.

02

The agent’s planner issued parallel tool calls; our first eval only looked at the final chat text.

03

Support wanted speed. Confirmation felt slow until we showed the duplicate payout in the ledger.

How we tested

01

Tool layer owns idempotency. The model must not mint payment references.

02

Write tools require confirmation for amount, beneficiary, and reason. Ambiguous tickets must not execute.

03

Replay duplicate webhooks and out-of-order PSP events.

04

Trace every tool call: arguments, HTTP status, whether money moved.

Starting point vs what we required

Starting point versus the controls we required
Starting pointWhat we required
Staging PSP and production PSP behaved differently on timeout.Tool layer owns idempotency. The model must not mint payment references.
The agent’s planner issued parallel tool calls; our first eval only looked at the final chat text.Write tools require confirmation for amount, beneficiary, and reason. Ambiguous tickets must not execute.
Support wanted speed. Confirmation felt slow until we showed the duplicate payout in the ledger.Replay duplicate webhooks and out-of-order PSP events.

What we delivered

01

LLM traces / evals

  • LangSmith — Multi-step tool traces
02

API / contract

  • Postman / Newman — Webhook duplicates and idempotency
03

Journeys / UI

  • Playwright — Confirmation UI and cancel-back
04

Adversarial evals

  • Promptfoo — Ambiguous tickets that must not pay
05

Failure telemetry

  • Sentry — Timeout and retry storms

Outcomes

Pass rule: chat can look successful and the case still fails if two movements exist. We tested the ledger, not the bubble.

Schema lock: payment tools reject missing idempotency keys generated server-side. Promptfoo plus Newman collections ran on every agent prompt change.

Stack

Testing stack used on this product class
LayerToolWhat we validated
LLM traces / evalsLangSmithMulti-step tool traces
API / contractPostman / NewmanWebhook duplicates and idempotency
Journeys / UIPlaywrightConfirmation UI and cancel-back
Adversarial evalsPromptfooAmbiguous tickets that must not pay
Failure telemetrySentryTimeout and retry storms

Same method as the rest of our work: severity-ranked findings, pass rules in writing, and a ship / wait / block call. See the evaluation method and tool comparison.