Build an AI support assistant that escalates cleanly
A guide to support automation that knows when to answer, ask for missing context, or hand off to a human.
Open source docReal workflow example
A SaaS company wants an assistant to answer customer questions about billing, onboarding, product settings, and account errors. The first version answers common questions well, but it also guesses when the account is missing, apologizes without creating a ticket, and sends engineers vague escalation notes.
The improved assistant has four explicit outcomes: answer from trusted knowledge, ask one focused follow-up question, execute an authorized support action, or escalate with a complete handoff summary. The product becomes more reliable because escalation is a first-class success path instead of a failure.
Implementation approach
Design the assistant around support states. Before the model writes an answer, classify the request as answerable from public docs, requires account context, requires an action, unsafe, or needs human judgment.
Keep tools narrow. A trained support agent might be allowed to look up invoice status or resend a verification email, but not change plan ownership or refund payments without approval. The AI assistant should follow the same boundary.
When escalation is needed, ask the model to produce a structured handoff: user intent, account identifier, facts already gathered, sources checked, attempted actions, urgency, and the exact reason a human is needed. That summary saves time for the next operator and gives you useful quality metrics.
Code or config snippet
const escalationSchema = {
type: "object",
additionalProperties: false,
required: ["category", "summary", "knownFacts", "reason", "urgency"],
properties: {
category: {
type: "string",
enum: ["billing", "account_access", "bug", "policy", "other"],
},
summary: { type: "string" },
knownFacts: { type: "array", items: { type: "string" } },
reason: {
type: "string",
description: "Why the assistant cannot complete this safely.",
},
urgency: { type: "string", enum: ["low", "normal", "high"] },
},
};
Mistakes to avoid
- Do not let the assistant invent account state when a lookup fails.
- Do not hide escalation behind generic "contact support" copy.
- Do not give tools broader permissions than a support operator would have.
- Do not measure only containment; bad containment creates reopened tickets.
- Do not pass sensitive ticket history into the model unless the user is authorized to see it.
Ready checklist
- Request classes and escalation categories are documented.
- Account lookup tools check authentication and authorization.
- The assistant can ask one focused follow-up question.
- Escalation output includes summary, facts, attempted actions, and urgency.
- Unsafe requests have a predictable refusal or handoff path.
- Metrics separate answered, escalated, reopened, and unresolved tickets.
Practical tip
Review the first fifty escalations manually. The best prompt improvements usually come from vague handoff summaries, missing account facts, or cases where the assistant should have asked one more question before escalating.
