I want to create a scenario where I want to read my unread emails from Gmail and have the AI to check if they are promotional or FYI emails. If yes then unsubscribe from them and move them to “Review” folder if not then move them to “Action” folder and also create a task for them in Google Tasks.
Changing the model will not make unsubscribe happen. Make AI, ChatGPT, and Gemini can classify the message, but the model only returns data; a later module still has to perform the action.
I would separate this into **decision** and **execution**:
Gmail watches an unread message.
The AI returns strict structured output such as `{“route”:“ACTION|REVIEW”,“confidence”:0.00,“reason”:“…”}`. Do not let it return or choose a URL to visit.
A router applies the `1_Action` or `Review` label. Add a separate `Processed` label (or remove the source label) so the same email cannot create duplicate tasks on the next run.
Only the ACTION branch creates the Google Task, using the Gmail message ID in the task notes as an idempotency key.
For unsubscribe, I would **not** let any LLM click a link found in the email body. That can follow a phishing link or prompt-injected instruction. Read the message headers and look specifically for `List-Unsubscribe` plus `List-Unsubscribe-Post: List-Unsubscribe=One-Click`. If a trusted sender has the one-click HTTPS form, call that endpoint in a separate, allowlisted HTTP step; otherwise label it `Review` for manual confirmation. Gmail’s own unsubscribe UI may also send you to the sender’s website, so it is not guaranteed to be fully automatable.
Also use a confidence threshold: for example, only auto-route at >= 0.90 and send everything else to Review. Test with duplicates, forwarded newsletters, missing unsubscribe headers, and a malicious email that tells the AI to ignore its instructions.
So the missing piece is an unsubscribe **action/tool and safety rule**, not a different model.