Production notes

What would have to change to put this agent in front of real customers. Each section says what is built here and what is proposed. Nothing under "Proposed" exists in the code.

A real billing system behind execute

Built. Handlers write to an in-memory SQLite database that is created fresh for each conversation (src/backend/db.ts). Rules read the same database. execute runs the schema check, the rules and the write in one synchronous call, so nothing can come between a check and its write. New ids are the row count plus one (nextId).

Proposed.

Human approval queues

Built. Each rule has a humanCanApprove flag. It is shown on the site's policy page and used nowhere else: a refusal does not carry it, and the agent decides from the prose whether to hand off. hand_off opens a ticket with a reason from a fixed list and a free-text summary written by the model.

Proposed.

Refused calls per rule as a live signal

Built. Every attempt is logged with its outcome and rule id, and summarize in src/eval/run.ts counts refusals by rule. In the saved runs this is the number that moved most between versions: 66, 54 and 8 refused calls for v1, v2 and v3.

Proposed. Track refused calls per rule per thousand conversations, by agent version and model, and alert on a step change.

Releasing a new agent version or model

Built. Versions are kept side by side in AGENT_VERSIONS. npm run eval scores a version on the full set with scripted or model-played customers, saves every conversation, and exits with an error on any breach or errored run. --resume fills in missing runs.

Proposed release gate, run before switching traffic:

Privacy of transcripts

Built. Saved runs hold full transcripts, every call's arguments and the data changes. That is publishable here only because every person is invented, and scripts/privacy-check.mjs checks the repository for real email addresses and local paths.

Proposed. The identity answers appear twice in every record: in the customer's message and in the arguments of verify_identity in the action log. Redact them before storage. Set retention and access controls on transcripts, and check what the model provider keeps. A test set built from real conversations has to be scrubbed and its customers replaced before it can be shared.

Rate limits

Built. Three failed identity checks per conversation (ID-2). Twelve rounds of tool calls per agent turn. A cap of 1,500 output tokens per reply and a 180-second timeout in the adapter. The model-played customer is limited to the script length plus three messages, in evaluation only.

Proposed. Count failed identity checks per customer across conversations, with a lockout that expires. Limit conversations per client and messages per conversation. Cap executed money actions per customer per day. Rate-limit find_customer, which reveals whether an email has an account.

Cost and latency of hosted models

Built. Token use is recorded per conversation. Averages from the saved runs, for the agent alone:

VersionInput tokensOutput tokensModel calls
v1about 15,000about 8005.6
v3about 17,600about 8105.5

A model-played customer added about 1,200 input and 900 output tokens per conversation. Input dominates: each model call resends the instructions and tool definitions (about 11,000 characters for v3) plus the conversation so far, about 3,400 input tokens per call on average for v3 on Qwen with scripted customers. Wall-clock time per conversation is not recorded.

Proposed.

What to re-measure

Next: Extending Backstop