MailKite: A Gmail API Alternative for Autonomous AI Agents
MailKite replaces Gmail API's OAuth, CASA review, and 7-day Pub/Sub renewal with a simple signed webhook for autonomous AI agent inboxes.
Gmail API is where most AI agent demos start — the account already exists and the API is right there. The friction appears once a demo becomes a real service, in three specific places: the OAuth review needed to touch a real inbox, a Pub/Sub push subscription that quietly expires every 7 days and must be renewed on a cron, and message bodies that have to be base64url-decoded and walked through the MIME tree by hand.
MailKite reduces that whole path to a single signed JSON webhook: no OAuth client, no Pub/Sub topic, no MIME parser. A roughly 25-line Express handler verifies the signature, reads the sender's SPF/DKIM/DMARC verdict straight from an event.auth field, and sends the reply from the right address. The published demo repo ships both the MailKite and Gmail API paths side by side, runnable locally via npm start with no account or domain, so the contrast can be tested rather than taken on faith.
The piece is also careful to note where Gmail API remains the right tool: for an assistant agent operating inside a real person's mailbox, drafting replies for approval, Gmail's search, labels, threading, and deliverability are genuinely valuable. The real friction only shows up for fully autonomous agents with their own address running unattended, where Gmail's rules built for human accounts — CASA security assessment, annual re-verification, a constantly-expiring watch() subscription — turn into an ongoing operational and cost burden.