Prompt
How do I add human approval before an agent sends emails?
Latest observation
Oct 20, 2026
OpenAI APIWeb search: off
To add human approval before an agent sends emails, the safest pattern is to make the agent draft the email, then send it only after a person reviews and approves it.
Simple workflow
-
Agent composes email draft
- Subject
- Body
- Recipients
- Optional attachments/metadata
-
Pause execution
- Mark the action as
pending_approval - Store the draft somewhere persistent
- Mark the action as
-
Notify a human
- Send a message in Slack/Teams/email/UI
- Include the draft and an approval link/button
-
Human approves or rejects
- Approve: agent proceeds to send
- Reject: agent discards or revises the draft
Recommended implementation patterns
1) Manual approval step in your app
If you control the app/UI:
- Show the draft in a review screen
- Buttons: Approve, Reject, Edit
- Only call the email-sending API after approval
This is the cleanest option.
2) Event-driven approval workflow
If you’re using backend jobs/workflows:
- Agent creates draft
- Workflow pauses at an approval node
- Human acts via:
- Slack button
- Web dashboard
- Email approval link
- Workflow resumes only after approval
Good for production systems.
3) “Human-in-the-loop” guardrail
If you use an LLM agent framework:
- Configure email sending as a tool that requires approval
- Tool call is intercepted
- Human signs off before tool execution
Example pseudocode
draft = agent.compose_email(user_request)
save_to_db({
"status": "pending_approval",
"to": draft.to,
"subject": draft.subject,
"body": draft.body
})
notify_human_review(draft)
# later, after approval:
if approval_received(draft.id):
send_email(draft.to, draft.subject, draft.body)
else:
cancel(draft.id)
Good safeguards
- Never auto-send emails from an agent by default
- Require approval for:
- External recipients
- Large recipient lists
- Sensitive content
- Legal/financial messages
- Log:
- Draft content
- Reviewer identity
- Approval timestamp
- Final sent content
- Add a “final diff” if the draft changed after approval
If you’re using an agent framework
Different frameworks support this differently, but the key idea is:
- mark the email-sending tool as non-autonomous
- intercept the tool call
- require human approval before tool execution
If you tell me what stack you’re using — for example LangChain, OpenAI Assistants/API, AutoGen, CrewAI, n8n, Zapier, or a custom backend — I can show you the exact way to implement it.