Fintech

How to Test a Dispute Agent on Contradictory Evidence

Antonio Evans11 min read

A split-screen scene: on the left, two overlapping documents (a policy page and a transaction log) with a magnifying glass hovering over a highlighted amount that differs between them.
Key points

Key points

  1. 1A missing field and a contradictory value are different failures, and they need different prompts and different tests.
  2. 2Write a precedence order into the system prompt so the agent always knows which source wins before it reasons about the case.
  3. 3Make the test fail unless the agent names both conflicting sources, states the clash and records which source it followed and why.
  4. 4Send the case to a human whenever the precedence order cannot resolve the conflict, and log that handover as a pass, not a failure.

Two failure modes that look alike

Dispute agents read evidence packets: transaction records, delivery proof, customer correspondence, terms and conditions. A packet arrives with a claim attached, usually as a network reason code. The code tells you what evidence matters, because each code dictates the documentation that wins or loses the case, along with the deadline for responding per this reason code guide. That makes the evidence the whole game.

When the agent reads the packet, two things can go wrong.

A field gap is a field the packet should contain but does not. No tracking number. No billing address on the order. No signature where one was promised. The agent has nothing to reason with. The correct behavior is to say "not present" and route the case accordingly.

A conflicting value is worse. Two sources both contain a value, and the values disagree. The delivery confirmation says the parcel went to 14 Oak Street; the order record says 41 Oak Street. The customer's email says the charge was unauthorized; the account history shows eleven earlier purchases from the same device with the same CVV result. Nothing is missing. Everything is present and mutually inconsistent.

The difference matters because the tests differ. A field gap test asserts that a missing field produces a specific "missing" marker rather than an invented value. A conflict test asserts that the agent surfaces both values and makes a documented choice. Teams that write one test for both get a system that silently guesses, which is the failure mode that reads as competence in the logs.

There is a measured reason to take this seriously. Research into failure taxonomies for multi-agent systems finds that coordination breakdowns account for roughly 37% of observed failures across major frameworks, and that silent failures, where an agent returns a confident, well-formatted answer that is simply wrong, are the most operationally dangerous according to this write-up on conflict resolution patterns. The same piece reports that unstructured multi-agent networks can amplify errors by more than seventeen times over a single-agent baseline when no conflict resolution layer exists.

In dispute work, silent failure has a hard cost. Reason codes carry strict windows: Visa gives merchants 30 calendar days to respond, Mastercard 45, and some processors require submissions earlier than the network deadline as this evidence packet checklist sets out. A wrong assertion submitted inside the window is worse than a flagged one sent for review, because the second can still be corrected.

The decision rule

If a field is absent, the agent records absence and continues with what remains. If a field is present twice with different values, the agent stops reasoning about merit until it has applied the precedence order. Never let absence and contradiction share a single branch in the code.

Designing the evidence packet so the agent can see conflicts

You cannot test conflict handling on a packet that hides its contradictions. Most payment data arrives normalized and deduplicated, which flattens exactly the signal you need.

The fix is to keep each document as a separate, source-tagged block, and require the agent to answer per field with a list of candidate values rather than a single value. Something like this:

{
  "field": "delivery_address",
  "candidates": [
    {"value": "14 Oak Street", "source": "carrier_tracking_record", "retrieved_at": "..."},
    {"value": "41 Oak Street", "source": "order_fulfilment_record", "retrieved_at": "..."}
  ],
  "resolution": "followed carrier_tracking_record",
  "resolution_rule": "carrier delivery evidence outranks internal fulfilment data",
  "conflict_named": true
}

This shape does three things. It preserves both values, so the reviewer can see what the agent saw. It forces a conflict_named flag, which becomes your test assertion. And it carries the source identifier, so the precedence rule can be checked mechanically.

The underlying claim about evidence quality supports this. Delivery confirmation matters because issuers decide on the full package, and a basic delivered scan may not establish where a package was left or who received it, while photos, address information and detailed tracking can per this guide to delivery confirmation. If two delivery records disagree about where the parcel went, the disagreement is materially relevant to a merchandise-not-received claim, not noise to be smoothed away.

The precedence order

Write the order into the system prompt as an explicit, numbered list. A defensible default for card disputes:

  1. Network rule and reason code requirements. The code determines what evidence is needed and which party bears liability per the reason code reference. If the code requires signature proof and only one source has it, the code's requirement governs which source is even admissible.
  2. Authenticated third-party records. Carrier tracking, signed proof of delivery, 3-D Secure authentication results, and bank-side authorisation data. These originate outside the merchant's own systems.
  3. Merchant system of record. Order, fulfilment, billing and subscription records.
  4. Customer communications. Support tickets, emails, chat transcripts. Useful for demonstrating resolution attempts, weaker as proof of fact.
  5. Summaries and derived documents. Anything a human or model wrote about the primary evidence. Never outranks the primary evidence.

Two refinements earn their place.

Time. If a source has been superseded, the later version of the same source type wins over the earlier one. Two order records from the same system are not a conflict; one is stale.

Explicit instability. If the conflict crosses levels that the order cannot separate, for example two authenticated third-party records that disagree, the order has no answer. That is the handover trigger, covered below.

Tell the agent what to do when the order resolves the conflict, and what to do when it does not. A prompt that says "prefer the stronger source" without defining stronger is a prompt that will invent a hierarchy per case. The dispute-resolution literature is blunt on this point: AI tools can produce inaccurate, misleading or fabricated content, and users bear responsibility for oversight and independent verification per this analysis of prompting in dispute resolution practice.

If you are running this across several evidence types and want one interface rather than a separate integration per vendor, Quanta Inference exposes text, image and document models behind a single OpenAI-compatible endpoint at https://quantaintelligence.ai/inference.

The test that fails on a buried conflict

The central test is simple to state and hard to pass: the agent must name the conflict. If it produces a confident single value without flagging that a second source disagreed, the test fails, even if the chosen value turns out to be the one a human would have picked.

That rule sounds harsh until you consider what the alternative measures. A test that only checks the final answer rewards lucky guessing and punishes nothing. A test that checks the disclosure rewards the behavior you actually need in an audit trail.

Build the test set around injected conflicts. The legal domain has a structured method for this: generate documents, inject six structured contradiction types, and model both self- and pairwise inconsistencies, with human validation to confirm plausibility per this framework for contradiction detection. You do not need the full academic apparatus, but the discipline transfers. Each test case should carry a known conflict, a known intended resolution, and a known correct handover decision.

A practical conflict test matrix:

Conflict typeExampleExpected agent behaviorPass condition
Cross-level, resolvableCarrier record vs internal fulfilment record disagree on delivery addressApply precedence, follow carrier recordNames both sources, states rule, selects carrier value
Same-level, unresolvableTwo authenticated tracking records disagree on delivery dateNo rule separates themEscalates to human, states both values, no merit decision
TemporalTwo order records, one supersededTreat later record as currentFollows later record, notes supersession instead of naming a conflict
Fraud signalCardholder denies authorisation, device and CVV history suggest otherwisePresent both, follow evidence hierarchyDoes not assert fraud unaided, flags the pattern for review
Self-contradictionSupport transcript contradicts itself on whether a refund was promisedIdentify the internal contradictionNames both statements from the same source
Missing plus conflictTracking absent, but billing and shipping addresses conflictResolve the conflict, record the gap separatelyTwo distinct outputs, not one merged guess

Run each case against a keyword or structural assertion first, then a graded assertion. Assertions in a test harness compare output against expected values or conditions, and include equality checks, structural checks, similarity checks and custom functions per the assertion documentation. Use the structural check for conflict_named being true and for both source identifiers appearing in the output. Use a graded rubric for whether the stated reasoning is coherent, not whether it matches a preferred sentence.

Worked scoring example

Take 200 synthetic cases with 60 seeded conflicts. Suppose the agent names the conflict in 51 of the 60, and in the other 9 outputs a single clean value. Suppose further that of the 51 named, 44 pick the value the precedence order dictates and 7 pick the other one, and that 2 of the 140 conflict-free cases get falsely flagged as conflicting.

Read the numbers in three parts rather than as one score.

  • Detection rate: 51 of 60, so 85% of seeded conflicts surfaced. The 9 misses are the dangerous set, because they look like confident correct answers.
  • Resolution accuracy given detection: 44 of 51, so about 86%. The 7 wrong picks usually trace to an ambiguous rule in the prompt, not to model capability.
  • False flag rate: 2 of 140, about 1.4%. Low enough that human reviewers will not start ignoring the flag.

Two lessons fall out. First, fix the prompt before swapping models: resolution accuracy given detection is a prompt problem, and detection rate is the only part that is mostly a model problem. Second, weight detection far above resolution in your release gate, because a missed conflict is invisible downstream while a wrongly resolved one is at least on the record.

Second, the reverse also happens: models merge conflicting evidence rather than flagging it. The contradiction-detection work notes that when contradictions in input evidence go unresolved, generation models often merge them into a single output, producing unsound results per the same framework. That is precisely the behavior your test must catch, and it is why the assertion has to be about disclosure rather than about the final value.

Handover: the rule for conflicts the order cannot settle

The handover rule is the third leg. State it in the prompt as a condition with a required action, not as guidance.

The rule: if two or more sources at the same precedence level conflict and no temporal rule separates them, the agent must stop, produce no merit decision, and return a structured handover containing the field, both candidate values with source identifiers, both timestamps, the precedence level, and the reason no rule applied.

Then make the handover part of the passing criteria. A test case with an unresolvable conflict passes only when the agent hands over. An agent that picks a side "because the tracking data usually wins" fails that case even if the pick looks reasonable.

Three implementation notes.

Make handover cheap for the reviewer. A handover that dumps the whole packet back to the queue gets ignored. Send only the conflicting field, both values, both sources, and the agent's reason for stopping. Reviewers can resolve a two-value conflict in seconds; they will not reconstruct it from a 40-page packet.

Log handovers separately from errors. A handover is a correct outcome. If your dashboard counts it alongside failures, the team will tune the agent to stop handing over, which is the opposite of what you want.

Set a review window that fits the network deadline. Since merchant response windows are measured in weeks and processors often want submissions before the network cutoff per the evidence packet checklist, a handover sitting in a queue is a deadline risk. Route handovers to a named reviewer with the deadline attached, not to a shared inbox.

The same pattern holds in regulated settings where multi-agent dispute handling has reached production: escalation calibration is named as one of the challenges that determines whether a build survives contact with operations per this multi-agent dispute architecture guide. Calibration means the rate of handovers is tuned to a level reviewers can absorb, and the threshold is tested rather than left to the model's mood.

Gaps still need their own test

It is easy to assume that once conflicts are handled, gaps are covered. They are not, and the tests prove it.

A field gap test asserts three things: the output marks the field as absent, the agent does not substitute a plausible value, and the downstream decision accounts for the absence. The third is where most implementations quietly fail. An agent that correctly writes "tracking_number": null and then proceeds to argue that delivery is proven anyway has passed the first assertion and failed the purpose.

Gap handling connects to reason codes more tightly than it first appears. The code determines the evidence the issuer must assemble to defend the chargeback per the reason code guide, and merchants who engage in representment win roughly 30% to 45% of contested cases, with those numbers dropping when evidence is incomplete, mismatched or late per the same checklist. Incomplete evidence is a gap, and the agent should be able to recognize that a required evidence type is missing for the code in question, not just that a JSON field is null.

Build the gap test set accordingly: for each supported reason code, one case where the decisive evidence type is absent, one where it is present but conflicting, and one where it is present and clean. That gives you a three-state matrix per code, and the contrast between the three states is what teaches you whether the agent is distinguishing them at all.

There is a useful measurement approach here as well. Scoring structured outputs per field, rather than per document, points reviewers directly at the specific fields that warrant attention, and in document-processing settings the lowest-trust documents are the ones likely to contain an error while per-field scores reveal where it sits per this benchmark of structured output error detection. Map that idea onto your own outputs: score the conflicting and missing fields specifically, not the whole packet, so the review queue sorts by field risk.

Prompting and orchestration details that make the tests pass

Three prompt-level habits move the pass rate more than model choice.

Separate thinking from answering. Ask the agent to first list candidate values per field with sources, then apply the precedence rules, then produce the answer. A prompt that splits the output into a reasoning section and a response section keeps the model grounded, because if it works out in the reasoning section that it cannot answer, the response stays factual per this account of hallucination-resistant prompting. In dispute work the reasoning section is also your audit record.

Give the precedence rules as data, not prose. A numbered list with explicit source-type names, matching the source tags in your packet, is checkable. Prose like "use the most reliable source" is not, because the model decides what reliable means per case, and your test can then only grade the outcome, never the rule application.

Ask for the handover decision explicitly. End the reasoning section with a forced choice: resolved by rule, or handover. When the model must answer that question, it cannot slide past the conflict.

Teams building this into a product usually keep the orchestration thin: one agent per role (triage, evidence retrieval, resolution, documentation), with a conflict layer that every role writes to. That mirrors the multi-role dispute architecture pattern and, more importantly, keeps the conflict record in one place rather than scattered across agent logs.

If the build is inside a payments or fintech line of business and you want the dispute work handled as a deliverable rather than a side project, Quanta Experts assemble an expert that reads your context and returns finished work at https://quantaintelligence.ai/agents.

FAQ

FAQ

Why can't one test cover both missing fields and conflicting values?

Because the correct behavior is different. For a missing field, the agent should record absence and continue; for a conflict, it should surface both values and apply a precedence order before touching merit. A single assertion that checks "the answer is right" cannot distinguish a correct refusal from a lucky guess, so it rewards the silent-failure pattern you are trying to eliminate.

What belongs in the precedence order?

Network rules and reason code requirements first, then authenticated third-party records such as carrier tracking and authentication results, then merchant systems of record, then customer communications, then summaries. Add a temporal rule so later versions of the same source type supersede earlier ones. Number the list in the system prompt and use source tags that match your evidence packet exactly.

How should the test treat a correct handover?

As a pass. Unresolvable conflicts that cross precedence levels should end in a handover with both values, both sources and the reason no rule applied. Count handovers separately from errors in your dashboard, because if they are lumped together the team will tune the agent to stop escalating, which removes the safeguard you built.

Which conflict types should the test set cover?

At minimum: cross-level resolvable conflicts, same-level unresolvable conflicts, temporal supersession, fraud-signal conflicts where the cardholder's claim clashes with authentication data, self-contradiction within one document, and cases that carry a missing field and a conflict at once. Seeding known conflicts with a known intended resolution per case lets you measure detection separately from resolution accuracy.

How do the network deadlines change the design?

They shorten the review loop. Response windows are measured in weeks, and some processors want submissions earlier than the network cutoff, so a handover that waits in a queue is a real deadline risk. Attach the deadline to every handover, route it to a named reviewer, and keep the handover payload small enough to resolve in seconds rather than minutes.

Sources

Sources

  1. The complete guide to chargeback reason codes for card ...
  2. When Your Agents Disagree: Conflict Resolution Patterns ...
  3. Building a Winning Chargeback Evidence Packet
  4. Fighting Chargebacks with Delivery Confirmation
  5. The Art of AI Prompting in Law and Dispute Resolution ...
  6. A Multi-Agent Generation Framework for Contradiction ...
  7. Assertions and Metrics - LLM Output Validation
  8. AI Dispute Resolution: Multi-Agent Architecture Guide
  9. Real-Time Error Detection for LLM Structured Outputs
  10. Building Hallucination Resistant Prompts
About the author

About the author

Antonio Evans
Antonio Evans

Antonio Evans is the founder of Quanta Intelligence and a fractional CTO who builds HIPAA-ready AI systems for health and life-science companies. Before that he was technical co-founder of FriendsEAT for twenty years, CEO of Socialdraft, and a data engineer at IBM. Antonio lives with his dog Santino in Lisbon, Portugal.

All articles