TOOLS  11 TYPEDEVAL TASKS  50RUNS  248 REAL-MODELTESTS  911
LEVEL P-060 DUPLICATE REFUNDS
◂ ALL PROJECTS
CASE FILE P-06 ── AGENTS · EVALS

REFUND
GUARD

CUSTOMER SUPPORT RESOLUTION AGENT + LLM EVALUATION PLATFORM

An AI agent that takes a complaint from “where is my refund?” to a verified outcome, plus an evaluation platform that measures whether it can be trusted with money.

Built for a fictional electronics store: order status, refund request and damaged item.

THE ONE RULE
The model proposes; the application decides and executes through typed tools. No refund is ever issued without a human approval bound to one exact, immutable proposal.
SCREEN ── EVAL SCORECARDMAIN EXPERIMENT
REFUNDGUARD — AGENTIC SUPPORT WITH LLM EVALUATION screenshot
▸ RUN EXPERIMENT
SCORESCOREBOARD
VERIFIED SUCCESS
84%
Specialist agents (v1) on all 50 tasks; single agent 76%.
DUPLICATE REFUNDS
0
Across all 248 real-model eval runs.
EVAL TASKS
50
Versioned, 9 categories, split dev 30 · validation 10 · test 10.
TESTS
911
Deterministic tests, no model calls.
PATHRESOLUTION FLOW
NEVERCHAT MESSAGE▸TREATED AS APPROVAL
EVERY RUNCLASSIFY▶INVESTIGATE + POLICY▶PROPOSE▶RULES IN CODE▶HUMAN APPROVAL▶EXECUTE + VERIFY▶TICKET

The run pauses with LangGraph interrupt() and a PostgreSQL checkpointer, survives restarts, and only updates the ticket with the status the payment provider confirmed.

BOSSHOW IT HOLDS UP
CORE ASAFETY BY DESIGN

Identity comes from auth, never the model. Proposals are immutable and hashed, and the reviewer's decision is re-checked against the hash before execution.

IDENTITYFROM JWT
PROPOSALSIMMUTABLE + HASHED
MONEY TOOLNEVER GIVEN TO LLM
REFUNDSIDEMPOTENT KEY
Lost provider responses are reconciled by key before any retry.
CORE BEVALUATION PLATFORM

Each attempt gets a clean world with injected faults, and four deterministic evaluators score the business state: outcome, policy, trajectory and response. No LLM judge decides whether money moved correctly.

EVALUATORS4 DETERMINISTIC
FAULTS5XX · DELAY · TIMEOUT
MANIFESTHASHED, RERUNNABLE
RATESWITH DENOMINATORS
Synthetic tasks against mock services: not production numbers.
FIG 1 ── VERIFIED SUCCESS, MAIN RUNALL 50 TASKS
SINGLE V1
76%
SPECIALIST V1
84%
SPECIALIST V2
70%
Specialist v2 had 1 executed policy violation, caught by the evaluator
VERDICT
Safety held: no duplicate refund in 248 runs, and the one forbidden action was caught by the policy evaluator.
No claim that specialists beat the single agent: they led on the main run (84% vs 76%) but trailed on repeated validation (57% vs 63%).
NEXT LEVEL
▸ Public agent benchmarks (BFCL, τ²-bench).
▸ An LLM judge for response quality only.
▸ Concurrent attempts per environment.
▸ A recorded walkthrough of demos A to E.
SELECTDEMOS
A
P-06 · 01
APPROVED REFUND

Complaint → evidence → reviewer approves → exactly one provider refund.

B
P-06 · 02
BLOCKED REQUEST

An ineligible refund is explained with policy, and no money moves.

C
P-06 · 03
FAILURE RECOVERY

The provider accepts but the reply is lost; reconciled by key, still one refund.

D
P-06 · 04
CONVINCING BUT WRONG

The reply says refund issued while the provider holds none; the evaluators catch it.

E
P-06 · 05
PROMPT TRADEOFF

Which tasks improved or regressed between prompt v1 and v2.

RULES OF PLAY
▸ Chat text authorizes nothing.
▸ Eligibility and amounts are computed in code, never by the model.
▸ Never claim a refund before the provider confirms it.
▸ Every step lands in a redacted, append-only audit trail.
ARTEFACTS
STACK ▸ Python 3.13 · LangGraph · FastAPI · Pydantic v2
DATA ▸ PostgreSQL 17 + pgvector · Alembic
MODELS ▸ Gemini Flash-Lite / Flash (free tier)
CI ▸ Docker Compose · GitHub Actions
DEMO ▸ Hosted on Render free tier · first load can take ~1 min
[ ▸ WATCH DEMO ]
[ ▸ LIVE DEMO ]
[ ▸ REVIEWER SCREEN ]
[ ▸ API DOCS ]
[ ▸ SOURCE CODE ]
◂ P-05 SECUREBANK CONTINUE? ▸ ALL PROJECTS P-07 EVTARIFF ▸
LOKESH KUMAR
IIT Roorkee engineer building AI agents, LLM evals and data systems that change real decisions.
CONTACT
MAIL ▸ lokeshkumar22119032@gmail.com
GHUB ▸ github.com/lokifergusion9
LNKD ▸ in/lokesh-kumar-1768262b9
INDEX
░▒▓ END OF FILE ▓▒░LOKESH KUMAR · MMXXVI