dvo88 / Reference
Canonical source: docs/published/email-automation-reference.md

Agent Email Automation Reference

A searchable field manual for Gmail OAuth, Google Workspace agent mailboxes, app passwords, SMTP/IMAP, Cockpit draft approval, email-driven coding agents, built-in model tools, and transactional email providers.

Fast Read

The hard part was not "email." It was choosing the correct identity, permission model, and runtime. These methods solve different problems.

Showing all sections
Method Best For Plain English Main Risk
Personal Gmail OAuth Personal automations that act as David The app has permission to use David's Gmail for approved scopes. Consent, refresh tokens, and scope mistakes.
Dedicated Workspace App Password Named agent mailboxes like jules@agents.dvo88.com The agent logs into its own mailbox with SMTP/IMAP credentials. Broad mailbox password and Workspace admin friction.
Agent Draft and Cockpit Approval Human-reviewed outbound agent email The agent proposes; David approves and sends. Backend validation and approval UX.
Email-Driven Coding Agent Local command execution triggered by email An email becomes a work order for a local coding agent. Highest security risk; must be sandboxed and tested adversarially.
Built-In Model Connectors Quick personal assistant tasks ChatGPT, Gemini, or Claude uses connected Gmail/Calendar tools. User-scoped and less portable into custom systems.
Transactional Email Provider Product/system notifications and inbound webhooks A provider sends and receives application email through APIs. DNS setup, cost, vendor APIs, and rate limits.

Method Cards

Use these cards as the practical choosing layer before adding another mailbox or email feature.

Gmail OAuth

Personal Gmail OAuth

Technical: a Google OAuth client authorizes selected Gmail or Calendar scopes such as gmail.send, gmail.modify, gmail.readonly, or calendar.events.

Plain English David gives an app permission to use his Gmail for specific actions. It can only do what the approved scopes allow.
World Cup email scope checks GCP Secret Manager
Workspace Mailbox

Dedicated Agent Mailbox

Technical: a real Google Workspace user gets 2-Step Verification and a 16-character App Password for SMTP send and IMAP receive.

Plain English The agent has its own inbox, such as jules@agents.dvo88.com, and code logs in with a special password.
SMTP IMAP agent identity
Review Flow

Agent Draft and Cockpit Approval

Technical: an agent submits a draft through a protected endpoint; the backend creates a review card and sends only after approval.

Plain English The agent puts a draft on David's desk. David clicks approve before it leaves.
human in loop approve and send Cockpit
Local Automation

Email-Driven Coding Agent

Technical: a local monitor reads task emails, parses instructions, runs allowlisted commands, edits files inside allowed roots, commits, and replies.

Plain English Email becomes a work order for a local coding agent. Treat it like remote command execution.
sandbox allowlist security tests
Built-In Tools

Model Connectors

Technical: ChatGPT, Gemini, and Claude expose user-authorized Gmail, Calendar, Drive, Docs, and Workspace-style connectors depending on tier and admin settings.

Plain English For a simple personal reminder email, asking the assistant directly may be faster than building infrastructure.
ChatGPT Gemini Claude
Product Email

Transactional Providers

Technical: providers such as Resend, Postmark, SendGrid, and Amazon SES send application email through APIs or SMTP and can route inbound email to webhooks.

Plain English Use a mail delivery company for app notifications, alerts, receipts, and inbound product workflows.
Resend Postmark SES

Extensibility

Adding send, receive, archive, label, delete, or another user is mostly an authorization problem. The safest path is to expand one capability at a time and smoke-test the exact action.

Method Add Another User or Inbox Add Delete/Edit Inbox Additional Steps
Personal Gmail OAuth Each user must authorize unless Workspace delegation is used. Use gmail.modify for archive, labels, read state, and trash-style actions. Update scopes, re-consent, store refreshed secrets, update scope check scripts.
Workspace App Password Create another Workspace user, activate 2FA, generate an App Password. IMAP can move/delete folders; Gmail labels/settings need Gmail API. Add mailbox registry entry, GCP secret, SMTP/IMAP smoke tests.
Agent Draft Approval Add mailbox config, allowlist, secret, and full-address validation. Add explicit actions and keep destructive actions approval-gated first. Add propose, approve, reject, send, archive, and delete audit logs.
Email-Driven Coding Agent Add sender policy and mailbox routing. Possible but dangerous; limit to post-success cleanup at first. Write failing security tests before expanding command or inbox actions.
Built-In Connectors Depends on account, product tier, and admin policy. Depends on connector capability and user confirmation flow. Enable connector, grant access, confirm policy, test with a real prompt.
Transactional Provider Add aliases, domains, routes, or inbound addresses. Does not edit Gmail inboxes; it manages provider queues/webhooks. Verify DNS, create API key, configure webhook, set rate limits.

Decision Guide

Pick the identity and control model first, then choose the implementation.

Fast personal reminder For "email me about the World Cup every morning," a built-in ChatGPT or Gemini task may be enough. Use custom Gmail OAuth only when the workflow needs to live in dvo88.com infrastructure.
Durable agent infrastructure For Hermes, CTO, or other named agents, prefer a dedicated Workspace mailbox or a draft-approval system. Keep the credential in GCP Secret Manager and record the capability in the registry.
Product or public app email Use a transactional provider for notifications, receipts, alerts, and inbound webhooks. Do not use David's personal Gmail as a product mail relay.
Inbox cleanup and deletion Start with Gmail OAuth plus gmail.modify and a human review queue. Only automate destructive actions after logs and rollback behavior are clear.

Transactional Email Providers

These are not Gmail replacements. They are product email systems with APIs, SMTP relay, domain verification, inbound webhooks, analytics, templates, and rate limits.

Provider Strong At Authorization Cost Shape
Resend Developer-friendly API, React-style templates, sending and receiving. Domain DNS verification plus API key and optional webhook secret. Free limited tier; paid plans start around $20/month for higher volume.
Postmark Transactional deliverability, inbound processing, message streams. Domain verification, server token, inbound webhook configuration. Small free allowance; paid plans start around $15/month for 10k emails.
SendGrid High-volume email API, templates, marketing add-ons. Domain authentication, API key, sender identity, webhook signing. Free plan changed after May 2025; Essentials commonly starts around $19.95/month.
Amazon SES Low-cost AWS-native sending and inbound processing. Domain identity, IAM permissions, production access, SNS/S3/Lambda routing. Usage-priced, roughly cents per thousand emails plus data and inbound charges.

Capability Registry Template

Every future mailbox or email provider key should be recorded with these fields.

Identity and Auth

  • Capability name
  • Mail identity or provider domain
  • Auth method: Gmail OAuth, App Password, transactional API key, or delegation
  • Secret location in GCP Secret Manager

Controls and Tests

  • Allowed actions: send, read, draft, archive, label, delete
  • Human approval requirement by action
  • Allowed recipients or sender policy
  • Exact smoke test command or endpoint and last verified date

Recommendations

These are the defaults unless a project has a reason to override them.

Rule Reason
Use personal Gmail OAuth sparingly It should mean "this app can act as David," not "we needed any email sender."
Use dedicated Workspace mailboxes for named agents Hermes, CTO, Jules, and similar systems need separate identities and secrets.
Use Cockpit approval for important outbound messages The agent can draft while David keeps final authority.
Use transactional providers for product email They are built for delivery, templates, webhooks, analytics, and rate limits.
Smoke-test the actual capability A token check is not the same as proving send, read, modify, archive, delete, or approve.

Sources Checked

Source details are summarized in the canonical markdown file. This page intentionally excludes secrets and private operational details.

No matching sections. Try a broader term like Gmail, agent, inbox, provider, OAuth, or app password.