Service 16

Inbox and Email Automation

Shared inboxes swallow a full-time role in reading, sorting and retyping. We build the classifier, the drafting layer and the routing rules that carry that load, with a human still holding the send button.

On this page
  1. What inbox and email automation actually is
  2. Who this is for, and who it is not for
  3. What we actually build
  4. How it works technically
  5. How much autonomy the system is given
  6. The build process, stage by stage
  7. What you get at handover
  8. Where these projects go wrong
  9. What it costs to run once it is live
  10. How to tell whether you need this
  11. How to start

What inbox and email automation actually is

The short answer

Inbox and email automation is a system that reads every message arriving in a shared mailbox, decides what it is about, fetches the facts it needs from your systems of record, and then files it, routes it to an owner, or writes a reply for a human to approve. It is two components with very different reliability requirements: a classifier that has to be right nearly every time, and a drafter that only has to be good enough that editing beats writing.

The word automation makes people picture a machine answering customers. That is the last thing you build and the smallest part of the work. The bulk of a shared inbox is reading, not writing: opening a thread, checking whether a colleague already replied, finding the order, deciding whose problem it is. A system that hands a person a labelled, grounded, pre-drafted thread removes most of that cost and none of the control.

What we build is a pipeline, not an assistant inside somebody's mail client. It runs server side against the mailbox API, so it works whether or not anyone has the tab open, and it leaves a trace you can read months later.

  • Two systemsClassification has to be right nearly every time. Drafting only has to beat writing from scratch.
  • Drafts firstThe first release writes drafts and sends nothing. Autonomy is earned per intent class.
  • No loose factsOrder status, refunds and dates arrive from tool calls into template slots. The model is never the source of a fact.
  • Edit distanceThe signal that matters is how much a human changes a draft before sending, tracked per class.
  • One kill switchA single flag returns everything to labelling, with no deploy. If that takes over a minute, do not send.
The vocabulary this page uses
Intent class
A named category of message the system handles in a defined way, such as order_status or refund_request. The taxonomy is a versioned design decision, not a model output.
Quoted-text stripping
Removing reply history, signature and disclaimer before a model reads a message, so it sees new content rather than eight copies of an older thread.
Grounding
Requiring that every factual claim in an outgoing message comes from a tool call made during that run, with the fetched value placed into the reply.
Idempotency key
A stable identifier, usually the RFC 5322 Message-ID plus the mailbox address, guaranteeing a message delivered twice is processed once.
Auto-Submitted header
A header marking a message as machine generated. Honouring it inbound and setting it outbound is the main defence against two auto-responders answering each other forever.

Who this is for, and who it is not for

This is worth building when reading load is the bottleneck and ten to twenty intent classes cover most of a normal week. It is not worth building when the inbox is quiet, when every message is genuinely different, or when the real problem is that three people reply and none knows what the others said.

What is true of your inboxVerdictReasoning
Hundreds a week, a handful of shapes covering mostGood fitAccuracy improves with a narrow taxonomy, and saving scales with volume
Replies quote policy from a help centre or wikiGood fitRetrieval with citations makes policy a tool call, not a memory test
Most replies need one fact from a CRM or billingGood fitThat lookup is deterministic, and the slowest part of the human job
Fewer than roughly fifty messages a weekPoor fitUpkeep costs more than it returns. Write better templates
Every message is bespoke, technical and longPoor fitNo repeated shape to learn. Automate intake and routing only
Nobody agrees who owns which type of messageFix that firstAutomation encodes a routing decision. Absent one, it invents one
The mailbox is a legal record for regulated adviceCarefulSupervision rules come first, and the build follows them
The fit table we work through on a first call, usually in fifteen minutes.
  • You have no baseline. If you cannot say how many messages arrived last month and how often threads reopened, you cannot judge the result.
  • The mailbox is personal, not a function. Personal mail is too varied to automate, and the consent question is a different question.
  • You want your best writer's voice and have collected none of their replies. Style is taught with examples; without them you get the average of the internet.
  • The team already ignores the inbox. Automation makes an ignored inbox faster at being ignored.
The cheaper answer we sometimes give

For plenty of teams the answer is a helpdesk with a real queue, not a model. If your only problem is that two people replied to the same customer, buy a helpdesk. The guide on automating a shared inbox covers the version you can do yourself.

What we actually build

A production inbox system has six parts, and the interesting failures live in the joins between them.

Intake and normalisation

A listener on push notifications, plus a scheduled delta sync as a backstop, because notifications get missed and subscriptions expire. Every message is stored under an idempotency key of Message-ID plus mailbox address. Threading is rebuilt from In-Reply-To and References rather than a provider thread identifier, which groups by subject line in ways that surprise you. Then it is stripped: quote boundary cut, signature and footer removed, attachments stored separately.

Classification

One model call returning a single JSON object against a taxonomy you approved, with a confidence value and a mandatory unknown class. The taxonomy is versioned beside the prompt, because adding a class means re-running the evaluation set, and a taxonomy living in someone's head never gets re-evaluated. Below the floor, unknown, or escalation-triggered goes to a human queue.

Grounding and retrieval

Before a word is drafted the system fetches the order record, the invoice, the subscription state, recent tickets, the policy passage that applies. Facts come through typed tool calls with timeouts and breakers. Policy comes from a retrieval layer returning citations, covered under RAG and knowledge systems. If a tool call fails, the pipeline routes to a human and names it.

Drafting

A second call, given the stripped thread, the fetched facts, the citations, and a handful of real replies your team wrote for that class. Style is taught with examples, not adjectives. Asking for warm and professional produces something no customer recognises; four of your own replies produce something your team does. The draft lands in the mailbox natively.

Routing and the clock

Assignment rules reading classification, customer record and current load: skills first, then round robin inside the eligible group, with a response clock starting at receipt and not at assignment. The queue is visible to everyone, because a routing system nobody can see becomes one nobody trusts.

Send control and observability

The send path carries the safety machinery: hourly rate caps, per-recipient cooldown, loop detection, suppression lists, outbound Auto-Submitted marking. Every decision is logged with prompt version, model identifier, classification, confidence, tool calls, the draft, and the text sent, so the gap between the last two is measurable.

  • A versioned taxonomy file with a definition and three example messages per class
  • Typed tool wrappers per system of record, with timeouts, retries and a breaker
  • A golden set of real messages labelled by your team, used as the regression suite
  • A review queue for low confidence, unknown and escalation-triggered messages
  • A one-flag kill switch that drops the system back to labelling

How it works technically

A message travels through eight stages and each fails in a way you have to design for. The interesting engineering sits in stages two, three and seven.

  1. Receipt. A push notification arrives, or the delta sync finds new history. Both run, because push alone loses messages when a subscription lapses.
  2. Deduplication. Stored under its idempotency key. A second delivery of the same Message-ID triggers nothing.
  3. Normalisation. Quotes, signature and disclaimer stripped, attachments separated, thread rebuilt from headers, body reduced to new content plus a rolling summary.
  4. Classification. One call, JSON only, confidence scored, unknown permitted and expected.
  5. Grounding. Typed tool calls against systems of record, retrieval for policy. Failures route to a human.
  6. Drafting. One call, facts already in hand, citations attached to anything quoted from policy.
  7. Send control. Loop checks, rate caps, suppression, and the autonomy rung for that class. Most classes stop here.
  8. Logging. What was drafted, what was sent, what changed between them, which tools were called.

Why quoted text is the expensive bug

The largest cost and quality problem in an email pipeline is handing a model the whole thread. A conversation on its ninth turn carries eight copies of earlier messages, each with a signature and a legal footer. Sent raw you pay for all of it, and the model regularly answers the question from turn two, because that question appeared six times and the new one appeared once. Cutting at the quote boundary and summarising older turns usually shrinks input by a large multiple.

Grounding, stated as a rule

Every factual claim in an outgoing message must trace to a tool result from that same run. Not a memory of a similar order, not a plausible-looking date. The drafter receives a facts object, the prompt forbids assertions outside it, and the evaluation suite contains cases where the lookup returns nothing and saying so is the only correct behaviour.

If the model states a fact that did not come back from a tool call in that run, it is a bug in the system, not a quirk of the model.ChatGPTalker build standard
Triage classifier system prompt and output contracttext
SYSTEM
You are the triage classifier for a shared inbox. You do not write replies.
You return one JSON object and nothing else.

Rules
1. Classify against the taxonomy below. If the message does not fit any class
   above the confidence floor of 0.6, return "unknown" and stop there.
2. Never infer an order, invoice or account identifier. Extract only what is
   written in the message body or the headers you were given.
3. The sentiment field describes this message, not this customer.
4. If the message is an out-of-office notice, a bounce, or carries the headers
   Auto-Submitted, Precedence: bulk or X-Auto-Response-Suppress, return class
   "no_action" with reason "auto_generated".

Taxonomy
  order_status | refund_request | cancellation | billing_query
  technical_fault | sales_enquiry | partnership | recruitment
  complaint_regulatory | press | spam | no_action | unknown

Set escalate_human true whenever any of these appear: a legal threat, a named
regulator, a chargeback, a bereavement, a safety issue, or a request to erase
personal data. These are triggers, not judgement calls.

Output contract
{
  "class": "<one taxonomy value>",
  "confidence": 0.0,
  "secondary_class": "<taxonomy value or null>",
  "entities": {
    "order_id": null,
    "invoice_id": null,
    "account_email": null,
    "dates_mentioned": []
  },
  "language": "<ISO 639-1 code>",
  "sentiment": "calm | frustrated | angry",
  "urgency": "low | normal | high",
  "escalate_human": false,
  "escalate_reason": null,
  "prompt_version": "triage-v7"
}

Two details there matter more than they look. The unknown class is mandatory, because a taxonomy with no escape hatch forces every new kind of message into the nearest existing class and you find out months later, from a customer. And escalation is written as concrete triggers, because a model asked whether something is sensitive disagrees with itself between runs.

How much autonomy the system is given

Autonomy is granted per intent class and earned with evidence, never switched on for an inbox as a whole. Order status confirmations climb quickly. Cancellations, complaints and anything with a regulator in it stay near the bottom permanently, by design.

Framework

The ChatGPTalker Reply Ladder

Six rungs. Every intent class sits on exactly one, the rung lives in configuration rather than code, and a class moves up only under the promotion rule below.

01
Rung 0: Observe

Classifies and logs, touching nothing anyone can see, for at least two weeks, while its decisions are compared with what humans actually did.

02
Rung 1: Label and route

Classification drives assignment and the response clock. No text is generated. Much of the saving already exists here, and the worst error is a misrouted message.

03
Rung 2: Draft, unsent

A grounded draft appears in the mailbox and a human edits and sends. Edit distance per class is recorded, and that decides whether a class is ready to climb.

04
Rung 3: Draft with pre-send review

Queued for one-click approval with facts and citations beside it. Suits high volume classes where checking evidence beats reading the thread.

05
Rung 4: Send with a recall window

Sends after a few minutes during which a reviewer can cancel. Cheap, and it converts an irreversible action into a reversible one.

06
Rung 5: Send immediately

Reserved for effectively deterministic classes: acknowledgements, receipts, appointment confirmations, where every fact came from a tool call and the template holds no free text.

The promotion rule is deliberately dull. A class climbs after fifty consecutive reviewed messages with no factual correction, edit distance inside the agreed threshold, and no missed escalation trigger. Any correction resets the run to zero. Demotion needs no meeting: one wrong fact reaching a customer drops the class a rung.

Promote per intent classPromote the whole inbox
Blast radius of a mistakeOne class, one kind of messageEvery customer who wrote in that day
Evidence neededA clean run in one class, arriving in weeksConfidence across the whole mix, which never arrives
A new message type appearsIt lands in unknown, waits at rung oneIt is handled as whatever class it resembles
RollbackDrop one class a rung, nothing elseSwitch it off and answer a backlog by hand
Political cost internallyThe team watches classes graduateOne bad send defines the whole project
The rung most inboxes should stay on

Plenty of teams get everything they came for at rung two and never go further. Reading, sorting, fetching and a first draft is the bulk of the work. Sending is the risky remainder and the smallest saving. If someone says the goal is a fully autonomous inbox, ask what the reversal plan is.

The build process, stage by stage

Six stages. The first two produce no software at all, and skipping them is why these projects produce a demo instead of a system.

  1. Baseline and samplingWeek one

    Several hundred real threads exported across a full month so seasonal traffic is included, then measured: volume by day, first response time, resolution time, reopen rate. Without that number every later claim is an opinion.

  2. Taxonomy and rules workshopWeek one to two

    Your team labels a few hundred real messages against a draft taxonomy. Disagreement between labellers is the useful output: two people labelling the same message differently means the class definition is wrong, and a model reproduces that confusion faster.

  3. Pipeline and groundingWeek two to four

    Intake, deduplication, normalisation, storage, tool wrappers, retrieval, observability. Ordinary engineering, and most of the hours. Anyone quoting two weeks plans to skip it and hand you a prompt.

  4. Classifier and evaluation harnessWeek three to five

    Built against the labelled set, which becomes the regression suite, using the method in writing evals for systems that are not deterministic. A change that improves one class and quietly ruins another is normal.

  5. Shadow runWeek four to six

    Live mail at rung zero, recording classification and draft against what the team actually did, reaching no customer. Where the taxonomy gets its real corrections and the message types nobody mentioned appear.

  6. Staged rolloutWeek six onward

    Classes promoted one at a time, highest volume and lowest risk first. Each promotion is a configuration change, reviewed, logged and reversible in a minute.

What reliably adds weeks

Three things stretch the timeline: a system of record with no usable API, a mailbox whose permissions need a security team on their own calendar, and a taxonomy the business cannot agree on. The third is slowest, because engineering does not fix it.

What you get at handover

A running system, the ability to change it without us, and the evidence to judge it. Everything sits in your accounts and your repository from the first commit, with no vendor console in the middle.

  • Pipeline source in your repository, infrastructure as code, deploying from your own continuous integration
  • Taxonomy, prompts and routing rules as versioned artifacts, each with the evaluation score it shipped at
  • The labelled golden set plus its harness, so a model change can be tested rather than hoped about
  • Dashboards for volume by class, confidence, edit distance, escalation rate, tool failures and cost per thousand
  • A runbook: adding a class, promoting or demoting one, rotating credentials, what each alert means and who answers it
Handover acceptance checklist
0 of 8 done

Where these projects go wrong

The failure modes are consistent enough to list, and none are about the model being insufficiently clever. They are about email being an older and stranger protocol than people expect.

FailureHow it shows upWhat prevents it
Auto-reply loopTwo systems answering each other overnight, found when the provider suspends the mailboxHonour inbound Auto-Submitted and Precedence, mark outbound auto-generated, per-recipient cooldown, hourly cap on a breaker
Quoted thread bloatCost climbing with thread age, replies answering an earlier turnStrip at the quote boundary, summarise older turns, cap input and alert
Ungrounded factsA confident, wrong delivery date or refund amount in a sent replyFacts object plus template slots, and adversarial empty-result test cases
Taxonomy driftAccuracy quietly falling as the business changes, with no day it brokeA mandatory unknown class, weekly review of it, scheduled re-labelling
Subscription or token expiryThe inbox looks calm because nothing is arrivingHeartbeat on arrival rate, alert on unexpected quiet, early renewal
Identity and permission mistakesReplies from the wrong alias, or a reply that orphans out of its threadDelegated send on the shared identity, In-Reply-To and References set
Nobody owns itStale prompts, unreviewed unknowns, the team drifting backA named owner, a monthly review in the calendar, dashboards someone answers for
The loop is the one that gets somebody fired

Every other failure here is embarrassing and recoverable. A reply loop between your system and a customer's autoresponder can send thousands of messages before anyone notices, damage your sending reputation for months, and get the mailbox suspended. Build the send cap and the circuit breaker before anything clever, then test the loop deliberately against a mailbox you control.

The failure nobody plans for: the team stops trusting it

Trust dies predictably. A draft goes out with a wrong fact, one reviewer starts checking every draft against the original thread, checking takes longer than writing, and they quietly stop using drafts. Within a month the system runs and nobody looks at it. The defence is transparency: show fetched facts and citations beside the draft so verification takes seconds, and publish the error rate yourself.

Measuring the wrong thing

Messages handled is a vanity number, and a system that classifies everything while helping with nothing scores beautifully on it. Measure first response time, reopen rate, escalation rate, edit distance per class and cost per thousand against the week one baseline.

What it costs to run once it is live

Running cost has three parts: model tokens, infrastructure, and human maintenance. Tokens are the part everyone asks about and usually the smallest. Maintenance is the part nobody budgets and usually the largest.

Token cost is arithmetic you can do yourself, and you should, because published prices move and any figure printed on a page is stale within weeks. Every message costs one classification call, and drafted messages cost a second, larger call. Input dominates.

Model spend for an email pipeline

Set both price fields to your provider's current published rate per million tokens. The defaults are illustrative figures for the arithmetic, not quoted prices.

0Model spend per working day
0Spend per month at 21 working days

That arithmetic teaches two things. Input dominates, so the stripping work in stage three is a cost control rather than a nicety. And a smaller model on the classification call, a narrow task with a fixed output shape, often scores the same for a fraction of the price.

  • Infrastructure. A queue, a worker, a small database and a log store. Modest for this workload.
  • Retrieval index upkeep, if policy comes from a knowledge base, plus someone who owns the fact that documents change.
  • Model deprecation. Providers retire versions on their own schedule. Budget a re-evaluation and a prompt pass each time.
  • Taxonomy maintenance. An hour a month on the unknown bucket, and a re-label of a fresh sample each quarter.
  • The human review that never goes away. At rung two every draft is read. That is the design working.
The number worth holding on to

For most teams the model bill on an inbox pipeline is smaller than one seat of the helpdesk software the inbox already runs on. The build is the expensive part, and maintenance decides whether it was worth doing. Ask any vendor to quote the second year rather than the first.

How to tell whether you need this

There is a test that takes one week, costs nothing except attention, and answers the question better than any vendor call.

  1. For five working days, whoever works the inbox tags each message with what it was about, in their own words. Give them no categories to pick from.
  2. Group the tags. If ten to twenty groups cover four fifths of the messages, you have a taxonomy. Sixty groups means you do not, and you should automate routing only.
  3. For the biggest groups, write down what a person must look up before replying. One lookup in one system means grounding is straightforward. Four plus a judgement call means a longer build.
  4. Count the messages that needed a fact already sitting inside your own systems. That is the honest size of the opportunity.
  5. Count the threads reopened because the first reply missed something. That is your quality problem, and it usually matters more than speed.

If your inbox turns out to be genuinely varied and quiet, we will tell you not to buy this. Fifty messages a week needs three good templates and a rule about who replies.

How to start

The first call is a scoping call and the useful version is technical. Come with a month of message volume, the top intent classes, the systems a reply usually needs, and whoever controls mailbox permissions.

  • Read-only access to a sample of real threads. A taxonomy cannot be designed from a description of an inbox.
  • The baseline numbers, or an agreement to spend an afternoon taking them first.
  • The constraint list: retention, data residency, who may see what, and any regulator with an opinion about your mail.
  • Expect the first deliverable to be a taxonomy and a shadow run, not a chat interface with your logo on it.

If your problem is closer to public-facing support at volume, read AI customer support agents instead. If most of what arrives is attachments rather than questions, document processing is the better place to begin.

Cite this

ChatGPTalker, Inbox and Email Automation: intent classification, quoted-text stripping, grounded drafting and staged autonomy in a shared inbox pipeline.

Questions we get asked

Will an AI system reply to our customers without a human reading it first?
Not unless you decide it should, and never for every kind of message. Autonomy is granted per intent class on a ladder, and most classes stay at the drafting rung where a person reads and sends. One wrong fact demotes a class automatically.
How accurate does the classifier have to be before it is useful?
Useful and safe are different thresholds. Routing tolerates error, because a misrouted message is annoying and easy to recover, so a class is useful well before it is excellent. Anything triggering an outbound action needs a far higher bar plus a confidence floor.
Can this work with Gmail and Microsoft 365, or do we need a helpdesk first?
Both platforms expose what a pipeline needs: change notifications, delta sync, draft creation and send. A helpdesk is not a prerequisite. If you already run one we integrate with it rather than around it, because the queue and the audit history are things your team already trusts.
What happens to the system when the model provider retires a version?
That is why the golden set and the evaluation harness are part of handover rather than an extra. You run the same labelled messages through the new version, compare scores per intent class, see which moved, and only then shift traffic. Without it, a deprecation is guesswork.
How do you stop the system from making up an order status or a refund amount?
By never asking it to know one. Facts are fetched through typed tool calls before drafting, handed over as a structured object, and placed into template slots. The prompt forbids assertions outside that object, and the evaluation suite includes cases where the lookup returns nothing.
What access do you need to our mailbox and our customer data?
Read access to a sample of threads to design the taxonomy, then a scoped service identity with the narrowest permission set that does the job: read the mailbox, create drafts, and send only for promoted classes. Residency, retention and redaction are decided beforehand.

Tell us what is eating the hours.

Send the process, the volume and the tools it touches. You get a scoped plan with a build shape and a timeline, not a brochure.

Start a project