> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hex65.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Support agent

> The support example end to end, its checks, its planted weakness, and the fix.

The example agent resolves support tickets. It reads a ticket, finds the customer in the CRM, refunds what the ticket asks (up to 100.00; more goes to a person), and replies. It calls no model: each step is fixed, so the same ticket always gets the same handling.

## The files

| File | What it is |
| - | - |
| `agent.mjs` | The agent, speaking the Lap Protocol over standard input and output (`jsonl`) |
| `servers/ticketing.mjs`, `servers/crm.mjs` | Its MCP servers, with made-up tickets and customers |
| `.mcp.json` | The MCP configuration the agent reads |
| `tasks.jsonl` | Five requests to record, one per ticket |
| `proving/tasks/resolve_ticket.yaml` | The task's specification: stations, error kinds with costs, strata |
| `proving/cases/resolve_ticket/` | Five cases, one per ticket, with the effects each expects |
| `proving/checks/resolve_ticket.yaml` | The default checks, and one rubric check on the reply |

## Run it

```sh theme={null}
mkdir support-guide && cd support-guide
proving init --example support
proving connect
proving record --inputs tasks.jsonl --yes
```

Each recorded session lists the tool calls. Then redact, build the twin and run:

```sh theme={null}
proving redact
proving twin build
proving run --seed 1
proving results
```

```text Output theme={null}
Pass rate: 90% [68.55%, 97.38%] at 95%, n = 25, cases = 5, effective n = 18
  pass^1: 90%, too few cases for an interval, cases = 5
  pass^2: 90%, too few cases for an interval, cases = 5
  pass^4: 90%, too few cases for an interval, cases = 5
  Stratum shared_name (weight 0.2, dangerous): 50% [9.45%, 90.55%] at 95%, n = 12, cases = 2, effective n = 2
  Stratum typical (weight 0.8): 100% [77.19%, 100%] at 95%, n = 13, cases = 3, effective n = 13
  Stratum other (weight 0): no laps, not covered by this run
  Cluster wrong_customer / send / effects_match_expected / ticketing.send_reply: 6 failures, attribution instruction (clu_<id>)
```

## What the checks found

Ticket T-1002 is from Sam Lee, and the CRM has two customers of that name. The agent refunds the first match without checking the email on the ticket, so `effects_match_expected` fails: the case expects the refund to go to the other customer. The failure cluster names the error kind (`wrong_customer`), the station (`send`), the check, and the tool.

Ticket T-1005 also names a shared name, but its customer happens to be the first match: it passes. That is why the stratum, not the case, is the unit to read: "customers who share a name" fails on one of its two cases here, and the strata weights say how often such tickets arrive.

Ticket T-1004 asks for 180.00, over the limit: the agent escalates, as the case expects.

## Fix it

Match the customer by the email on the ticket, not by name alone:

```sh theme={null}
sed -i.bak 's/const customer = customers\[0\];/const customer = customers.find((c) => c.email === ticket.customer.email);/' agent.mjs
proving run --seed 1
```

Redaction replaced every name and email in the recordings with a consistent fake, so the ticket's email and the CRM's still match in the twin. The new run is of a new agent version, and every case passes:

```text Output theme={null}
Run run_<id> completed: 25 laps, 25 graded (25 passing, 0 failing), 0 void.
```

## With your own support agent

Record tickets of every kind your agent sees, and write cases for the dangerous ones by hand: the refund over the limit, the shared name. Add strata for them, with honest weights, so the result reflects the work as it arrives.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.