๐ค SupportPilot
Autonomous AI customer service across every email
SupportPilot receives customer emails, identifies the customer and order, answers questions, executes permitted actions, requests approval for refunds, cancellations, and address changes, replies inside the original thread, and escalates to a human when needed.
It is an autonomous customer-service platform for businesses that want every support email handled quickly without surrendering control over sensitive actions.
Giving a model access to an inbox is easy. Letting it safely represent a company is not. Real customer service requires identity resolution, durable threads, accurate business context, explicit permissions, approval boundaries, delivery handling, human escalation, and a record of every source and action.
SupportPilot packages those pieces into an installable TypeScript SDK, an operational inbox, and a hosted control plane.
๐งฉ Set up an autonomous support agent
A business connects its email transport, company knowledge, available tools, and explicit action policy:
export default defineCustomerService({
transport: agentMail({
inbox: "[email protected]",
}),
knowledge: [
website("https://moltencoffee.shop"),
document("./support-policy.md"),
],
tools: [
shopify.orders.read(),
shopify.addresses.update(),
shopify.refunds.prepare(),
],
policy: {
automatic: ["faq", "order_status"],
approvalRequired: ["refund", "cancel_order", "change_address"],
prohibited: ["invent_product_claim", "override_refund_policy"],
},
});
The platform provisions the inbox workflow, normalizes incoming messages, maintains each customer conversation, gathers business context, runs the agent inside declared policy, and produces one of four clear outcomes:
- Respond โ answer safely using verified company knowledge
- Act after approval โ prepare a sensitive action and wait for a human decision
- Escalate โ hand the case to a person with a complete summary
- Clarify โ ask the customer for information required to proceed
๐ง Customer-service architecture
Customer email
โ
โผ
AgentMail / Resend Transport Adapter
โ
โผ
Webhook Verification, Dedupe & Message Normalization
โ
โโโโโโโโโโโโโโโโบ Durable Thread + Customer Identity Store
โ โ
โผ โผ
GPT-5.6 Support Planner โโโโโโโ Knowledge & Business Context
โ
โโโโโโโโโโบ Policy Runtime โโโโโโโโโบ Allow / Approve / Deny
โ โ
โโโโโโโโโโบ Business Tools โผ
โ Shopify โข CRM โข Billing Human Approval Queue
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โผ
Reply / Action Executor
โ
โผ
In-thread Customer Reply
โ
โผ
Trace, Replay, Metrics & Human Handoff
๐ Policy-controlled autonomy
The platform does not use an unexplained model confidence percentage to decide whether a refund is safe. A business expresses its operational boundaries directly.
Routine questions and order lookups can be resolved autonomously. Sensitive actions such as refunds, cancellations, or address changes are prepared by the agent and paused for approval. Prohibited actions are denied, and unsupported questions are escalated.
Every customer case records:
- The matched policy rule
- The sources used in the answer
- The customer and order context supplied to the model
- Every proposed and completed tool call
- The approver identity and timestamp
- The exact outbound reply
- Delivery, response, and escalation events
That makes autonomous customer service testable, reviewable, and safe to improve.
๐ Complete customer-service lifecycle
1. Receive
- Verify inbound AgentMail or Resend webhooks
- Deduplicate retried events
- Normalize provider-specific payloads
- Extract clean replies, attachments, and participants
- Reconstruct the correct customer conversation
2. Understand
- Resolve the customer's identity
- Retrieve previous conversation memory
- Load the relevant support policy and storefront knowledge
- Fetch current order, billing, or account context
- Classify intent, urgency, and the requested outcome
3. Decide
- GPT-5.6 plans the answer and any required business tools
- The policy runtime evaluates every requested action
- The agent automatically responds, pauses for approval, asks a clarifying question, or escalates
4. Act
- Run only explicitly permitted tools
- Keep customer and commerce actions idempotent
- Reply inside the original email thread
- Handle provider delivery events and failures
- Resume the case after an approval decision
5. Observe and improve
- Display a structured trace for every customer interaction
- Replay a case using a new policy or agent version
- Compare proposed replies before deploying changes
- Track automatic resolution, escalations, and approval outcomes
- Export a complete handoff summary for a human agent
๐งช Customer-service simulator
Businesses should not test autonomous support changes on real customers.
The included simulator runs realistic multi-message conversations against the complete knowledge, tool, and policy configuration:
scenario: late-order-then-refund
messages:
- "Where is order MC-1042?"
- "It will arrive too late. Please refund it."
expected:
first_message: automatic_response
second_message: approval_required
prohibited:
- refund_without_approval
- unsupported_delivery_promise
Each scenario produces a pass/fail trace. Teams can run the suite locally or in CI before changing a prompt, model, policy, integration, or support workflow.
โ Working demonstration: Molten Coffee
Molten Coffee is the first demonstration business.
Scenario 1 โ Routine product question
A customer asks when their coffee was roasted. The agent cites the storefront's roasted-to-order information and answers automatically without inventing a fulfillment date.
Scenario 2 โ Order lookup
A customer emails, "Where is my order?" The platform resolves the customer, retrieves the matching Shopify order, and replies in the same AgentMail thread with the current order status.
Scenario 3 โ Refund requiring approval
The customer requests a refund. The agent prepares the permitted refund operation and a customer-ready reply, then pauses in the approval queue. After the merchant approves it, the tool runs exactly once and the customer receives the final response.
Scenario 4 โ Address change requiring approval
A customer asks to change the delivery address after ordering. The agent verifies the order is still eligible, prepares the address update, and requests approval before making the change.
Scenario 5 โ Unsupported product-safety question
A customer asks a question that is not answered by the product catalog. The agent refuses to invent a product or health claim and escalates the conversation with the missing information highlighted.
๐ AgentMail and Resend provider adapters
AgentMail is the first provider because it supplies agent-owned inboxes, threads, replies, attachments, realtime events, and custom domains. The customer-service platform wraps it behind a transport contract:
interface CommunicationsTransport {
verify(request: Request): Promise<VerifiedEvent>;
normalize(event: VerifiedEvent): Promise<InboundMessage>;
reply(
threadId: string,
message: OutboundMessage
): Promise<Delivery>;
subscribe(handler: EventHandler): Promise<Subscription>;
}
A Resend adapter implements the same contract while the platform owns customer identity, threading, deduplication, ordering, and reply state. Future adapters can bring SMS, live chat, or WhatsApp conversations through the same customer-service policy and trace runtime.
๐งฑ Technical implementation
- GPT-5.6: Customer-intent understanding, grounded answer planning, tool planning, clarification questions, and human-handoff summaries
- Codex: TypeScript SDK, transport contracts, webhook ingestion, idempotency, policy runtime, Shopify tools, trace viewer, scenario simulator, tests, and deployable sandbox
- AgentMail: Agent-owned inboxes, two-way email threads, attachments, webhooks, and realtime events
- Resend adapter: An alternative email transport behind the same communications contract
- Next.js + TypeScript: Customer-service inbox, approval queue, agent configuration, and trace explorer
- PostgreSQL: Threads, customer identities, policy versions, approvals, and execution records
- Shopify: Live order context and controlled support actions for the Molten Coffee demonstration
๐ฌ Three-minute demo plan
- Run
npx supportpilot initand show the generated support configuration. - Send a real customer email to the Molten Coffee support inbox.
- Watch the agent identify the customer, retrieve the order, and reply in-thread.
- Ask for a refund and show the policy runtime pause the action.
- Approve the refund from the customer-service control plane.
- Show the completed action, final customer reply, and replayable execution trace.
- Run the same conversation in the simulator to demonstrate how businesses safely test policy changes.
๐ OpenAI Build Week
Track: Developer Tools
SupportPilot is not a vague chatbot or an inbox wrapper. It is an autonomous customer-service product that understands every email, resolves routine work, performs approved business actions, and brings a human in exactly when needed.
Built With
- agentmail
- codex
- next.js
- openai-gpt-5.6
- postgresql
- resend
- shopify
- typescript