How do I build a human-in-the-loop workflow?
AgentMail provides several mechanisms for keeping humans involved when agents send emails. You can combine these approaches to match the level of oversight your workflow requires.
1. CC or BCC a human on every email
The simplest approach: copy a human on every email your agent sends so they have full visibility.
The manager sees every outgoing email and can step in if something looks wrong. Use bcc instead of cc if you want the oversight to be invisible to the recipient.
2. Drafts for review before sending
Use Drafts to let your agent compose emails that a human reviews and approves before they go out. This is ideal for high-stakes emails like contracts, legal communications, or financial matters.
You can also list all pending drafts across your entire organization, which is useful for building a central approval dashboard:
For more details, see the Drafts core concept documentation.
3. Labels for escalation
Use labels to flag messages that need human attention. Your agent can detect situations it cannot handle and tag them for review.
Then build a dashboard or scheduled job that queries for flagged messages:
4. Allowlists as guardrails
Use a send allowlist to restrict which addresses your agent can email. If the agent tries to send to an address or domain not on the list, AgentMail will reject the request and the email will not go out.
This acts as a hard safety boundary. Your agent can only email recipients you have explicitly approved, regardless of what the agent logic tries to do.
Best practices
- Start with CC + drafts for new agents until you trust their behavior
- Graduate to autonomous sending for routine emails, and keep drafts for high-value communications
- Always have an escalation path: agents should know when to stop and ask for help
- Use labels consistently across your agents so dashboards and alerting work reliably
- Combine approaches: for example, use allowlists for autonomous sending to known recipients, drafts for unknown recipients, and CC a human on everything during the first week
