Agentic Refund Protection

Defensive Intelligence.

Stop Refunds Before They Happen.

RetainAIO deploys a Claude Sonnet agent that monitors every Shopify order for refund-risk signals — reasoning about customer behavior, order value, and engagement history — and acts before the refund request arrives. With full reasoning transparency on every decision.

// agentic_risk_assessment — order #1021
SCANNING
risk_score
0.87
confidence
0.91
prior_signal
0.62

order#1021 · The Collection Snowboard HIGH RISK

"Customer did not open anchor email after 26 hours. Order value $340 increases refund pressure. One prior ignore signal on record — escalating to immediate follow-up."

ACTION → send_followup · urgent · 5m delay
order#1018 · Hydrogen Snowboard MED RISK

"Customer opened but has not clicked after 14 hours. Moderate order value. Standard follow-up queued."

ACTION → send_followup · supportive · 5m delay
decision flow

Every Order.
Every 10 Minutes.

The agent doesn't wait for you to run a report. It runs continuously — scanning, reasoning, and acting before refund pressure builds.

01
Scan

BullMQ worker runs every 10 minutes. All recent orders checked for anchor email status — opened, clicked, or ignored.

revenueLeak.worker.ts
02
Reason

Claude Sonnet evaluates risk signals: order age, value, engagement, customer history, behavioral signals. Returns risk score, confidence, leak type, and reasoning.

scoreLeak() → claude-sonnet-4-6
03
Decide

If confidence ≥ 70% — agent queues recovery email with AI-selected timing and tone. Below 70% — escalated to Action Center for HITL review.

HITL_threshold: 0.70
04
Learn

Every email event — open, click, ignore, bounce — written as a CustomerBehaviorSignal. Agent reads this history before the next decision on that customer.

behaviorSignal.server.ts
ai brief inbox

Daily Intelligence.
On Demand.

Every morning the agent generates a plain-English intelligence brief — what it detected, what it did, and what it recommends next. Confidence-rated. No fluff.

The Brief Inbox is where strategic insight lives. Instead of checking dashboards, you receive a synthesized view of your revenue protection status — written by the same agent that's making the decisions.

detections_today → leaks found
recoveries_today → revenue protected
next_best_action → agent recommendation
confidence → brief reliability rating
// AI_BRIEF_INBOX
CONF 94%
Today · Mar 16 · 06:00 CONF 0.94

3 new leaks detected — $840 at-risk revenue. Agent deployed anchor emails for all 3. One recovery already confirmed ($189). Current recovery rate 71% — above 30-day average of 64%. No HITL escalations pending.

3 leaks detected 1 recovery today $840 at risk HITL: clear
Yesterday · Mar 15 · 06:00 CONF 0.91

5 leaks detected, 3 recovered ($420). Template A/B result: Professional anchor winning at 72% vs Friendly at 58%. Recommend enabling Escalation template for orders above $300.

5 leaks 3 recovered A/B: Professional winning
reasoning transparency

No Black Box.
Every Decision Explained.

Every agent action is stored with a plain-English reasoning string. You see the exact signals evaluated, the confidence rating, and what the agent concluded. No other refund protection tool on Shopify does this.

100%
Decision Coverage
Every agent action — whether it fires or doesn't — is logged with reasoning. Including no-action decisions.
0.70
HITL Threshold
Confidence below 70% means the agent escalates to you instead of acting. Every escalation includes the agent's full reasoning.
Signal Memory
CustomerBehaviorSignals are never deleted. The agent's memory of each customer grows indefinitely — improving every future decision.