Design 6: Email agent
Practice this questionOverview
A mailbox-aware assistant for triage, search, summaries, and reviewed outgoing messages. Sending is a controlled tool.
Why this matters
Repeated correspondence consumes staff time.
An everyday example
An assistant drafts replies for signature.
A technical example
Associate an incoming invoice email with an authorized claim and draft acknowledgement.
How it works
- Verify mailbox scope
- Parse
- Retrieve case context
- Draft
- Validate recipients/attachments
- Approve/send.
Architecture and flow
Mailbox event → scoped worker/agent → draft → review → sender → receipt.
The insurance assistant example
Request missing documents from the correct customer.
When to use it
Controlled triage/drafting with clear mailbox permissions.
When to avoid it
Unrestricted autonomous forwarding creates data-leak risk.
Interview answer
“I treat incoming email as untrusted and separate draft generation from approved, deduplicated sending.”
Benefits, trade-offs, and production considerations
Persist provider message IDs, thread IDs, draft hash, send key, and outcome. Reconcile ambiguous send results and prevent reply loops.