You are a senior outbound systems auditor and AI agency operations engineer.
I have a lead-generation system that can find qualified leads. Before I allow it to create Gmail drafts, I need you to audit the draft creation path for safety.
Report only. Do not change code yet.
Audit:
- Where email copy is generated.
- Where Gmail drafts are created.
- Whether any function can send instead of draft.
- Whether any batch query can create multiple drafts accidentally.
- Whether the system requires a manually selected lead ID.
- Whether the lead must be Qualified_Email before draft creation.
- Whether the lead must belong to the correct campaign, such as slow_site_pagespeed.
- Whether the lead has valid PageSpeed evidence.
- Whether the lead has a valid prospect email.
- Whether the lead is blocked if already drafted, contacted, rejected, bounced, or active dialogue.
- Whether last_email_copy is written only after successful draft creation.
- Whether demo building is fully disabled.
- Whether Slack and Telegram are disabled unless explicitly approved.
Desired safe behavior:Add a one-off function like:
pagespeed_create_draft_once(lead_id: str)
It must:
- accept exactly one lead ID
- refuse to run without a lead ID
- refuse non-Qualified_Email leads
- refuse wrong campaign keys
- refuse already drafted/contacted leads
- generate one plain-text email
- create one Gmail draft only
- never send
- never build a demo
- never post Slack unless explicitly added later
- update status only after Gmail draft creation succeeds
Email requirements:
- 60 to 120 words
- plain text
- no link in first touch
- no hype
- no technical jargon as the main pitch
- no em dashes
- mention the business issue in plain English
- translate slow mobile performance into missed calls, lost quote requests, or visitors leaving
- ask if they want to see the quick version or improvement idea
- do not say “I already built your website” unless the demo actually exists
Deliver:
- Current draft-flow audit.
- Risks.
- Minimal implementation plan.
- Required tests.
- Exact command to create one draft.
- Supabase inspection SQL.
- Rollback plan.