ChargebackOps
Analyze chargebacks and get actionable recommendations
A customer disputes a card payment.
The merchant has a deadline. Evidence is scattered across order logs, payment records, shipping scans, support chats, refund ledgers, and fraud-risk systems.
Some evidence helps. Some evidence hurts. The agent can fight, refund, concede, or escalate. But arbitration costs a fixed $250.
So the real question is not simply:
Can an LLM answer questions about chargebacks?
The better question is:
Can an LLM agent make evidence-backed, cost-aware decisions in a real operational workflow?
That is the idea behind ChargebackOps: an OpenEnv environment for training and evaluating LLM agents on merchant-side chargeback operations.
When a customer disputes a transaction, the merchant can lose the transaction amount immediately. To recover the money, the merchant must submit a representment packet before a strict deadline.
A human analyst needs to answer several questions:
This is why chargebacks are a useful environment for agent training. They combine:
Most benchmarks test whether an LLM can produce the right answer. ChargebackOps tests whether an LLM can make the right sequence of decisions.
ChargebackOps is a simulated merchant dispute operations environment built on OpenEnv.
The agent receives a structured observation, takes a typed action, and receives the next observation after the environment updates.
The loop is simple:
The workflow is not simple.
The agent must triage cases, query internal systems, collect evidence, avoid harmful artifacts, submit representment packets, handle issuer responses, and decide whether arbitration is worth the fee.
The agent cannot act with free-form text. It must choose from a typed action space.
select_caseinspect_casequery_systemretrieve_policyadd_evidenceremove_evidenceset_strategysubmit_representmentresolve_caserespond_to_pre_arbescalate_to_arbitrationaccept_arbitration_losswait_for_updatesThe six merchant systems are:
orderspaymentshippingsupportrefundsriskThis makes the environment closer to a real back-office workflow than a static prompt benchmark.
Imagine a goods_not_received dispute.
The customer says:
I never received the product.
A weak agent might submit immediately with no evidence.
A better agent does this:
orders.shipping.contest.That is a complete evidence-backed operational path.
The environment has five main layers:
ChargebackOpsEnvironment runs reset, step, delayed events, deadlines, issuer review, arbitration, and final grading.CaseProgress.Arbitration is where the environment becomes especially interesting.
Both sides pay a fixed $250 fee.
If the merchant wins arbitration:
If the merchant loses arbitration:
So escalation is rational only when:
This single inequality changes the behavior we want from the agent. The best policy is not “always fight.” The best policy is to fight when the expected value is positive.
The flagship task is:
monthly_dispute_backlog_marathon
It includes:
This task tests memory, prioritization, and portfolio-level reasoning.
The agent has to decide not only what to do, but what to do now.
ChargebackOps uses a composable OpenEnv rubric instead of one monolithic reward.
| Dimension | Weight | What it measures |
|---|---|---|
| Strategy correctness | 0.20 | Did the agent choose the right strategy? |
| Evidence quality | 0.15 | Did it attach useful evidence and avoid harmful evidence? |
| Packet validity | 0.10 | Was the packet complete and clean? |
| Deadline compliance | 0.10 | Was the case handled on time? |
| Efficiency | 0.10 | Did the agent avoid wasted actions? |
| Outcome quality | 0.10 | Did the final result match the correct resolution? |
| Note quality | 0.05 | Was the representment note coherent? |
| Escalation ROI | 0.20 | Was arbitration economically rational? |
The case score can be written as:
The environment also includes a deadline gate. If a case is truly abandoned past deadline, it can be hard-zeroed:
The final episode score is a weighted average across cases:
This gives the environment a useful property: results are not just scores, they are diagnosable.
Yes.
I tested four scripted policies across the headline catalog and multi-seed grid.
| Policy | Headline avg | Multi-seed avg | Behavior |
|---|---|---|---|
naive |
0.000 | 0.000 | Submit empty packets immediately |
concede_all |
0.444 | 0.445 | Always accept the chargeback |
escalate_all |
0.767 | 0.768 | Always contest and always escalate |
heuristic |
0.813 | 0.763 | EV-rational rule-based policy |
The headline discrimination delta is:
That means the benchmark clearly separates weak shortcut behavior from stronger operational behavior.
The naive policy collapses. The concede-all policy gets partial credit but misses positive-EV contests. The escalate-all policy looks strong but pays unnecessary arbitration costs. The heuristic wins because it balances evidence, deadline, and ROI.
The training setup uses:
Qwen/Qwen2.5-3B-Instruct + fp16 LoRA
on a single T4.
The training pipeline has two phases.
The SFT phase teaches the model the typed-action interface and basic dispute workflow behavior.
The GRPO phase uses outcome reward and format reward.
The outcome reward is based on terminal merchant P&L:
The format reward provides a small signal for structured output:
The combined reward is:
The reason for using outcome reward is simple: the goal is not just to imitate a heuristic. The goal is to optimize business outcome.
The clearest legitimate learning signal is the SFT checkpoint.
| Checkpoint | Overall score |
|---|---|
| Untrained Qwen2.5-3B base | 0.456 |
| SFT checkpoint | 0.536 |
The absolute improvement is:
The relative improvement is:
The SFT model learned the interface and improved over the base model.
The easy and medium cases improve most clearly after SFT.
The hard and nightmare tasks remain difficult because they require:
That is exactly what makes the environment useful. The easy cases teach the interface. The harder cases test whether an agent can manage operational complexity.
The GRPO phase produced an important lesson.
Later GRPO checkpoints appeared to match the heuristic baseline exactly. At first, that looked like success.
But diagnostic rollouts showed the model was emitting:
{"action_type": "accept_case", "case_id": "CB-E1"}
accept_case is not a valid environment action.
The closest valid actions are:
accept_chargebackaccept_arbitration_lossselect_caseThe invalid action parsed as JSON but failed action validation. Because the evaluation helper fell back to the heuristic on invalid model output, the final score reflected heuristic behavior rather than trained-model behavior.
This produced a clear rule for typed-action RL environments:
A model should not get credit for a fallback policy’s work.
A corrected evaluation can penalize invalid actions:
where:
This is a side lesson, not the core product. But it is an important one: typed-action training needs strict attribution.
ChargebackOps is about more than disputes.
The same structure appears in many real-world workflows:
These workflows share the same pattern:
ChargebackOps turns that pattern into a benchmark.
Open the Hugging Face Space:
https://huggingface.co/spaces/mitudrudutta/ChargeBackOps
Or run locally:
git clone https://github.com/MitudruDutta/chargebackops.git
cd chargebackops
pip install -e ".[dev]"
pytest -q tests
openenv validate .
uvicorn server.app:app --host 0.0.0.0 --port 8000
Then open:
http://localhost:8000/docs
http://localhost:8000/demo
A simple demo path is:
goods_not_received_easy.orders.shipping.contest.The next improvements are clear:
ChargebackOps is a reproducible OpenEnv benchmark for long-horizon, cost-sensitive, evidence-driven agent behavior.
It does not ask an LLM to merely summarize documents. It asks the agent to act.
The agent must gather evidence, avoid harmful signals, handle deadlines, respond to issuer pushback, and decide whether arbitration is worth the fee.
In short:
ChargebackOps is not about teaching an agent to click buttons. It is about teaching an agent to make evidence-backed decisions when every step has a cost.
Try it here:
Analyze chargebacks and get actionable recommendations