Back to all workflow recipes
Safe Email Triage·gmail + slack·Zero Public IP

Let Codex Triage Gmail Into Drafts — Physically Blocked From Sending

DIRECT ANSWER & GUARDRAILS

Set `access: "draft"` on TagTag’s built-in Go Gmail connector. Even if a malicious email tries prompt injection or context compaction drops your instructions, AccessGuardSink rewrites every reply to `/users/me/drafts` and rejects explicit send flags with `ErrDraftOnly`.

Recommended Harness
OpenAI Codex CLI (`codex`) or AGY (`agy`)
AccessGuardSink
Gmail: draft (Go AccessGuardSink enforced)
Stripped Prefixes
GMAIL_*, SLACK_*

What It Looks Like in Chat

TagTag Go Core

Gmail delta cursor synced 9 new threads · AccessGuardSink locked to draft-only

@inbox-bot (Codex)

Morning triage done: 6 newsletters archived in digest, 3 customer emails have reply drafts saved in Gmail Drafts (0 sent). Review links attached.

Setup Steps

1. Lock Gmail access to "draft"

AccessGuardSink enforces draft mode outside the LLM; direct send attempts fail deterministically in Go.

2. Route daily summaries to your private IM DM

Point `default_target` to your Slack or Feishu owner DM so you review drafts in 60 seconds without checking inbox noise.

Sanitized Config & Zero-Token Check

connectors.json (zero secrets embedded)
[
  {
    "id": "gmail:work",
    "type": "gmail",
    "enabled": true,
    "bot_id": "inbox-bot",
    "access": "draft",
    "default_target": "slack:personal/D01234567",
    "env_keys": ["GMAIL_CLIENT_ID", "GMAIL_CLIENT_SECRET", "GMAIL_REFRESH_TOKEN"],
    "config": { "interval_sec": 300 }
  }
]
Zero-token dry-run verification
tagtag connector check --data-dir "$TAGTAG_HOME" --env-file .env --json gmail:work
Local agents
IM platforms