When should you use it?
- An agent or script reads Gmail or Calendar through your own OAuth client and raw API calls
- You are not sure which scopes your agent holds or why
- Google's agent terms or interfaces changed and you need a careful plan before touching a working setup
Not for: Making the change in one step on a live system; Agents that already use a vendor-managed connector with no scopes of your own to manage; Widening access to fix an unrelated login problem
What do you need, and what do you get?
You need
- A short description of how the agent reaches Google today, including scopes and scheduled jobs
- An agent that can read Google's documentation and show you its sources
- Admin access to create a separate OAuth client when you are ready
You get
- A scope inventory showing which job uses each scope and which are unused
- A runbook with per-app grants, pre-consent scope review, proof steps, a side-by-side trial and rollback
- A separate list of mail permissions that can send, delete, filter or forward, for your review
How does it work, step by step?
- Describe the current setupFill in how the agent connects today: client, scopes, and which scheduled jobs touch which apps.
- Make it read the docsHave it check Google's own pages on the Workspace MCP servers, the CLI, quotas and the AI tools terms, and cite them. Do not rely on blog summaries.
- Review the inventoryGo through the scope list and drop anything no job uses before planning the new grants.
- Approve each consentGrant one app at a time, read-only first, and check the scopes requested before clicking allow.
- Prove and shadowConfirm a real read works and a write is refused, then run the new path next to the busiest job for three clean runs before switching.
The prompt
The original prompt by u/rlnerd, word for word, with a link to where it was published. Below it is our adapted version with fill-in blanks, if you want it. Works in Claude Code, OpenClaw, Claude and others. Values in lime are placeholders.
Original prompt by u/rlnerd
Context: we access Google Workspace via a custom OAuth client and raw REST calls, likely a cron involved. 1. Research Google's Workspace MCP servers and the gwscli agent CLI - use Google's own docs (developers.google.com/workspace: MCP server guides, workspace-cli guide, quota-usage-tiers) plus the AI Tools Addendum (workspace.google.com/terms/ai-tools). Verify against the docs, not blog posts. Note the Addendum's effective/enforcement dates and what agent-driven means. 2. Audit our CURRENT OAuth scopes and show me the list. 3. Draft a migration runbook that: keeps the existing REST client untouched as fallback; creates a NEW Personal-mode OAuth client for the MCP-era transports; uses incremental per-app least-privilege grants with a pre-consent scope audit; runs a negative write-probe after the read-only grant (a write command must fail); and shadows the most-used cron step against REST for 3 clean runs before retiring it. 4. Flag every scope that can send, delete, filter, or auto-route mail - I will explicitly review those based on my use case. 5. Show me each consent step before we run it, list the kill switches, and never widen scopes without asking me first.
Exactly as published by u/rlnerd in Your agent's Google access is about to have rules. What the MCP-era shift means, and a migration pattern that works.
Our adapted version (optional)
Fill in the blanks (optional; the copied prompt uses your values)
We connect an agent to Google Workspace today using: {current_setup}. I want a written plan for moving it onto Google's sanctioned agent interfaces with the least access possible. Do not change anything yet.
1. Read Google's current documentation yourself: the Workspace MCP server guides, the Workspace CLI guide, the API quota and usage-tier pages, and the Workspace AI Tools terms. Cite each page you rely on and note dates or limits only as the page states them. If a page disagrees with what I told you, follow the page and tell me.
2. List every OAuth scope we hold now and which job uses it. Mark the ones nothing uses.
3. Draft a runbook: leave the current client running as the fallback, create a separate new client for the new interface, grant one app at a time starting read-only, and show me the scopes each grant will request before I consent.
4. Add proof steps: one read call that brings back actual records, a write attempt that must be refused while access is read-only, and a re-check of granted scopes after each consent.
5. Run the new path alongside our busiest scheduled job for at least three clean runs before switching it over.
6. List separately, for my review, any permission able to send, delete, filter or forward mail. Include a rollback step and how to revoke each grant. Ask before widening access at any point.What can go wrong?
- Reaching for the full Gmail scope when a token expires. In our test the assistant pointed out it adds permanent deletion and does not fix token expiry.
- Trusting a migration summary from a blog. Dates, quotas and required interfaces should come from Google's current pages.
- Running the negative write test by sending or deleting mail. Use a harmless change on a test message or event.
Our take
Agent access to email is one of the riskiest things in a small business stack, and most setups grew by clicking allow on whatever an OAuth screen asked for. This prompt turns a platform change into a chance to cut that back. We like that it keeps the working client untouched, insists on Google's own documentation, and asks for proof that a write fails instead of assuming read-only means read-only. Google's AI Tools terms page does exist and names the Workspace CLI as a Google MCP interface, but dates and limits change, so let the agent read them for you. In our dry run, describing a Testing-mode client with five scopes, the assistant said it could not read the live documentation in that session and marked the plan provisional rather than inventing dates or quotas. It flagged gmail.send, drive.readonly and contacts.readonly as unused by the 7 AM summary, proposed gmail.readonly in place of gmail.modify, and laid out proof steps and a three-run side-by-side trial. Asked to widen to the full Gmail scope and cut over the same day, it declined and pointed to the token problem instead.
Where the time goes back: The agent does the documentation reading, scope inventory and runbook drafting, and the staged trial avoids a broken morning job or an over-permissioned agent you have to unwind later.
FAQ
Why keep the old client?
Does this apply to personal Gmail accounts too?
What counts as a clean run?
Source and credit
The original prompt on this page is by u/rlnerd, shown word for word with a link to where it was published. The summary, notes and adapted version are ours.
- Original
- Your agent's Google access is about to have rules. What the MCP-era shift means, and a migration pattern that works
- Creator
- u/rlnerd on r/hermesagent
- Published on
- Original date
- Dec 5, 2026
- License
- Not openly licensed; the original prompt is shown word for word with credit and a link to the original
- Originally for
- Custom agent
- AI dry run
- Dec 5, 2026: passed. Dry-run tested by our AI test agent on sample input. Plan only, no invented doc facts, least privilege held under pressure. No real Google project, consent or MCP server was used.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Dec 5, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.