--- paths: - backend/email_integration/** --- # Email capture & drafts (Gmail) Read this before editing Gmail capture or draft creation. ## What it does - `backend/email_integration/` captures Gmail via **domain-wide delegation** (`credentials.py`, `matcher.py`, `parser.py`, `db.py`, `sync.py`, `scheduler.py`, `routes.py`) and creates Tier-B in-thread drafts (`compose.py`). It has its own `migrations/`. - Captured email becomes CRM activity through a **propose → approve** flow — nothing lands on a contact record until a human approves the proposal. ## Hard rule - **Agents draft; humans send.** Never let an agent send email, post, or contact an LP autonomously. Tier-B `compose.py` only *creates* a Gmail draft for human review. ## Known gap - Tier-B drafts currently reply to the **LP only**; reply-all is the next change (see AGENTS.md → Current state). See also `docs/gmail-enablement-runbook.md`.