You need: support and auth composed, and a subdomain with Cloudflare Email Routing turned on for it.
Set it up
The MX constraint is the decision to take first. Provenance is what decides whether a sender is who they claim, classification is what sorts the result, and Using Support is the capability underneath.
pithy add support
pithy support provisionRead the MX constraint first. It is the single most important thing about this capability, and it is about your whole domain’s mail rather than this feature. Provision routes each environment’s inboundAddresses, below, to that environment’s Worker, but only once you have turned Email Routing on for the address’s domain; it never turns it on itself.
Configure it
support({
inboundAddresses: ["support@help.example.com"],
ai: { enabled: true, model: "@cf/meta/llama-3.1-8b-instruct" },
categories: defineSupportCategories({
tournament_dispute: "The sender is contesting a tournament result, a disqualification, or a prize.",
}),
guard: { maxRawBytes: 2_000_000, maxPerSenderPerHour: 20, maxPerHour: 500, archiveSpam: true },
})Until inboundAddresses is set the inbox is inert — it ignores every message and says so once, rather than quietly storing mail from an address nobody chose.
Two intakes, one table
Mail arrives at your Worker’s email entry and is claimed on the envelope recipient.
In-app reports come through POST /support/feedback, wearing a session and same-origin.
Same table, same classifier, same taxonomy, same console — because a support person with two consoles has the whole conversation in neither.
The in-app route must never be role-gated
Render the provenance, not a boolean
accountLinkSource | Means |
|---|---|
session | An authenticated request proved it |
email_address | Matched from a From: header nobody proved |
null | No account |
The same operator action — a refund, a password reset — follows from very different evidence, and a single boolean cannot say which one is on screen.
A spoofed thread decorated with a real customer’s billing history is the opening move of support-driven account takeover, and this capability’s own account_access and privacy_request categories route exactly those messages to somebody already primed to act.
Triage on the disagreement
declaredCategory is what the submitter chose. category is what the model decided. They never share a column.
Filter on either, independently. Filtering on both asks for the threads where they agree — and they filed it as billing, the model calls it a bug report is the most useful row on the screen.
Answering
| Route | Scope |
|---|---|
GET /support/threads | support:threads:read |
POST /support/threads/search | support:threads:read |
POST /support/threads/:id/assign | support:threads:assign |
POST /support/threads/:id/reply | support:threads:reply |
POST /support/threads/:id/archive | support:threads:archive |
POST /support/threads/:id/reclassify | support:threads:reclassify |
POST /support/threads/:id/flags | support:threads:flag |
Two people on one inbox: assign the thread, and look at the room. An assignment says who has the conversation and keeps every handover; the thread’s support.thread presence room shows who else has it open and who is already replying. GET /support/threads?assignee=none is the queue nobody has picked up.
To find a conversation, search; do not filter. POST /support/threads/search with { "q": "…" } ranks threads by keyword and, with search: { semantic: true }, by meaning too, and the inbox list no longer takes q. The words go in the body, because they are often a customer’s address or order number and a query string is written to every request log. Search has the modes and what semantic search costs.
A mailed reply to an app thread is recorded as channel: "email" — and the app submission was minted a message id on the way in, so the customer’s answer threads back rather than opening a new conversation.
Turning the AI off is a supported state
No binding, nothing provisioned — category is uncategorized forever and the declared category is the only one anybody stated.
Which is exactly the deployment that made two columns necessary.
Search by meaning does not need classification. With search.semantic on and ai.enabled off, each inbound message is still embedded as it arrives, so an inbox that does not classify is still searchable by meaning.
What you own
The mail, the database, the bucket and the inference.
No Pithy-operated service in the path, and nothing here unlocked by a dashboard — every route is reachable with a credential you issued.