Skip to main content
ZR
Toggle navigation
Work

Strong evidence

Refund Agent

Policy-bound customer-support agent with deterministic payout decisions.

Tier
Strong evidence
Pillar
Agent governance
Visibility
Public
Status
functional
Date
Jun 2026

Case boundary

AI customer-support demo where Claude can gather context and propose an answer, but a deterministic policy engine decides whether a refund is approved, denied, or escalated.

Claim boundary

Demo policy engine and approval surface, not a general claims-processing product.

Refund Agent is an AI customer-support demo for e-commerce refunds.

Customers chat with the agent, but there is exactly one payout path: a typed tool that re-runs a deterministic policy engine before any refund is issued. The model can propose; code decides.

System

  • Synthetic CRM with customers, orders, edge cases, and a written refund policy
  • Agent loop with typed tools for lookup, order retrieval, policy checks, refund issuance, and escalation
  • Deterministic policy engine for final-sale, digital goods, delivery windows, duplicate refunds, and value thresholds
  • Admin dashboard for inspecting every reasoning trace and tool call

Runtime

  • Next.js API route streams the tool-using agent run to the chat UI
  • In-memory store keeps the demo zero-config while leaving a clear database seam
  • Optional Stripe refund path uses idempotency keys when real payment credentials exist
  • Admin routes can be gated by token while localhost development remains lightweight

Proof

  • issue_refund rechecks policy before touching payout state, so prompt injection cannot force an invalid refund
  • Tool-layer ownership checks prevent customers from refunding another customer's order
  • Trace records include tool inputs, outputs, blocked calls, token cost, latency, retries, and final decision
  • Vitest coverage exercises the policy engine and scenario matrix