# Agent design: support ticket triage and draft replies

## Summary

An AI agent classifies every new ticket, looks up order and shipping status for "where is my order" (WISMO) requests, and drafts a reply. Low-risk WISMO replies with high confidence go to a one-click approval queue; everything else goes to a human with the draft attached. Refunds over 50, complaints and anything mentioning legal or safety issues always go to a person. Target: cut median first response from 9 hours to under 2 hours without lowering CSAT.

## Workflow

| Step | Actor | Tool | Output |
| --- | --- | --- | --- |
| 1 | Helpdesk | Helpdesk API (webhook) | New ticket event |
| 2 | Agent | LLM | Intent, sentiment, language, confidence score |
| 3 | Agent | Order database (read-only) | Order status for the customer's email or order number |
| 4 | Agent | Shipping-status API | Carrier status and carrier-given delivery estimate |
| 5 | Agent | LLM | Draft reply using only looked-up facts |
| 6 | Agent | Helpdesk API | Ticket tagged, draft attached, routed to a queue |
| 7 | Human | Helpdesk | Approve, edit or reject the draft |
| 8 | Helpdesk | Helpdesk API | Reply sent; outcome logged |

## Decision rules

- **WISMO, confidence ≥ 0.85, order found, carrier status available:** route to the *Quick approve* queue.
- **Confidence below 0.85 or order not found:** route to the *Human review* queue with the draft attached.
- **Refund or credit requested:** draft only; 50 or under goes to *Human review*; over 50 goes to *Supervisor approval*.
- **Negative sentiment plus the words cancel, chargeback, lawyer, injury or unsafe:** route to *Priority human*, with no draft sent.
- **Delivery dates:** quote only the carrier's estimate. If the carrier gives no estimate, the draft says the order is in transit and offers to follow up.

## Approval gates

| Action | Gate |
| --- | --- |
| Sending any reply | A human approves (one click in *Quick approve*) |
| Refund or credit up to 50 | Support agent approves |
| Refund or credit over 50 | Supervisor approves |
| Closing a ticket without a reply | Not allowed for the agent |

The agent has **no permission** to send messages, issue refunds or change orders.

## Failure handling

- **Order database or shipping API down:** skip steps 3–4, route to *Human review* tagged "lookup failed".
- **LLM error or timeout:** route the ticket untouched to the normal queue; retry classification once after 5 minutes.
- **Malformed or empty ticket:** route to *Human review*.
- **Daily check:** alert the support lead in team chat if more than 5% of tickets fail any step.

## Security and privacy

- Order database access is read-only and limited to the fields needed (status, items, dates).
- Names, emails, addresses and phone numbers are masked in agent logs.
- The LLM is not allowed to use ticket content for training [confirm with vendor terms].
- Logs kept for [measure: retention period agreed with the DPO]; customers' data requests handled by the existing GDPR process.

## Metrics

| Metric | Baseline | Target |
| --- | --- | --- |
| Median first response time | 9 hours | Under 2 hours |
| Share of WISMO tickets via *Quick approve* | 0% | 60% of WISMO |
| Draft approval rate without edits | [measure] | 80% |
| CSAT | [measure] | No decrease |
| Wrong delivery date quoted | [measure] | 0 |

## Rollout plan

1. **Week 1–2:** shadow mode. The agent classifies and drafts, but humans work as usual. Compare its routing with theirs.
2. **Week 3–4:** enable *Quick approve* for WISMO only.
3. **Then:** add other intents one at a time, after each meets its approval-rate target.

---

**Next:** a 2-week pilot plan and a set of test tickets. Constraints respected: GDPR, refunds over 50 need approval, and no delivery dates beyond what the carrier gives.
