How to connect Gmail to OpenClaw, with limits it can't change

OpenClaw reaches Gmail through the gog skill and your own Google Cloud project. How that works, how to keep it read-only, and Gmail with per-action access.

Updated

Short answer

OpenClaw's own way to Gmail is the bundled gog skill: you create a Google Cloud project and OAuth client, sign in with gog auth add, and OpenClaw runs gog gmail commands. Its default sign-in can read, send, label and trash mail, and change filters and forwarding. For Gmail without a Cloud project, with read-only or hand-picked actions that OpenClaw can't switch off, connect Gmail in Upsy and add Upsy to OpenClaw with its plugin from ClawHub. It takes about five minutes and is free for personal use.

The built-in way

The gog skill

gog is a command-line client for Gmail, Calendar, Drive, Docs, Sheets and Contacts, and OpenClaw ships a skill that teaches the agent to use it. The skill loads once gog is installed on the Gateway's machine (brew install openclaw/tap/gogcli).

Setup, per gog's README:

  1. Create a Google Cloud project, turn on the Gmail API, and create an OAuth client of type Desktop app.
  2. Run gog auth credentials set with the client's JSON file.
  3. Run gog auth add you@gmail.com --services gmail,calendar,drive and approve in the browser. On a headless server, the skill walks you through --manual or --remote.

Then OpenClaw searches with gog gmail search, sends with gog gmail send, drafts, replies and trashes.

What to know before you rely on it:

  • Wide by default. --gmail-scope defaults to full: Google's gmail.modify plus two Gmail settings scopes. That covers reading, sending, labels and trash, and also filters and forwarding addresses.
  • Narrower is possible. gog auth add takes --gmail-scope readonly, send or read-send, or --readonly for read-only scopes on every service. Then Google itself refuses changes.
  • Flags on each command aren't limits. gog --readonly and --gmail-no-send on a command only hold if the agent types them. That's how the inbox incident happened: the instruction to wait was lost, and the token allowed trashing.
  • A weekly sign-in on personal Gmail. Your own OAuth app is External, and while its consent screen is in Testing, Google expires refresh tokens after 7 days.

Gmail as a trigger

openclaw webhooks gmail setup --account you@gmail.com connects Google Pub/Sub to OpenClaw, so a new email starts an agent run (Gmail Pub/Sub docs). It needs gcloud, gog and a public HTTPS endpoint, usually Tailscale Funnel. OpenClaw's docs recommend routing that mail to a separate, sandboxed reader agent with almost no tools, since every incoming email is untrusted.

Other mailboxes

The himalaya skill reads and sends over IMAP and SMTP, and the IMAP trigger plugin watches a mailbox. With Gmail, both need an app password, which Google offers only with 2-Step Verification and which can't be read-only.

If you're happy to keep a Cloud project and want Gmail triggers, gog with --readonly or --gmail-scope read-send is a fair setup.

Where Upsy fits

  • No Google Cloud project, and no weekly sign-in.
  • Limits on Upsy's server: Read-only, or Pick actions such as drafts but no sending and no trash. OpenClaw can't type its way around them.
  • No settings tools: Upsy can't change filters or forwarding, and has no tool that deletes an email for good.
  • Up to five Gmail accounts, each at its own level.
  • History, alerts and an off switch you can reach from your phone.
  • The same Gmail in Claude, ChatGPT, Grok or Hermes, each with its own access.

What Upsy doesn't do: wake OpenClaw on new mail. Keep the Pub/Sub hook for that if you need it.

What you need

  • OpenClaw 2026.11.13 or later, with a model set up. Upsy's plugin needs that version.
  • A browser that can reach the Gateway's machine for the sign-in, or see Troubleshooting.
  • Gmail, personal or Google Workspace. On Workspace, your admin may have to allow the app.
  • A free Upsy account.

Connect Gmail to OpenClaw

  1. Create a free account at upsy.ai with Set up Upsy.

  2. On Apps, click Connect an app, then Connect on Gmail. Upsy says Gmail connects through Composio for now; click Continue and sign in with the Google account OpenClaw should use.

  3. Optional: click Add account on Gmail for another address, up to five.

  4. In a terminal on the Gateway's machine, add Upsy with its plugin from ClawHub:

    openclaw plugins install @upstash/openclaw-upsy
    openclaw upsy setup
    
  5. Open the link setup prints. On "OpenClaw MCP wants to access your Upsy", sign in, keep Gmail ticked, choose Read-only or All, and click Allow.

  6. Send OpenClaw a new message.

  7. To allow only some actions, open OpenClaw MCP on Upsy's Assistants page and click Pick actions… next to Gmail.

Already set up gog? If Upsy replaces it, disable the skill so OpenClaw doesn't reach for its token: openclaw config set skills.entries.gog.enabled false, then start a new session. Revoke the old token at myaccount.google.com/connections. More on the commands in the OpenClaw MCP guide.

Check that it works

Ask OpenClaw, from any chat it's in:

Use upsy to find emails from the last three days that ask me something I haven't answered. List sender and subject.

It calls upsy__search_threads, then opens the threads. Upsy's History shows the search and each read under OpenClaw MCP. On Read-only, ask it to archive one: it should say it has no tool for that.

What OpenClaw can do with Gmail

Tool What it does On Read-only
search_threads Gmail search syntax, up to 50 threads a page Yes
get_message, email_read_thread One message, or a whole thread oldest first, with its attachments listed Yes
email_attachment Downloads an attachment of up to 10 MB Yes
email_labels, email_list_drafts, get_draft Labels, drafts, and one draft's text Yes
create_draft, update_draft Writes or changes a draft or a threaded reply, with files No
send_message Sends a new email, a reply in its thread, or a draft by id No
email_send_draft, email_delete_draft Sends a draft as it is, or deletes it No
email_archive, email_update Archives; read or unread, star, important, labels No
email_trash, email_untrash Moves to trash and back No

Each Gmail account gets one level: Full access, Read-only (the "Yes" rows), Pick actions or No access. With several accounts, each tool takes an account address; without one, Upsy uses the first you connected. Sent mail and drafts end with your Gmail signature.

OpenClaw can hide tools on its side too, with openclaw mcp tools upsy --exclude 'send_message,email_trash'. Upsy's level still applies underneath.

Prompts to try

  • "Every weekday at 7:30, send me a WhatsApp summary of what reached my inbox overnight. Use upsy." OpenClaw saves it as a cron job.
  • "Draft a reply to Omar's last email asking for the signed contract. Leave it as a draft."
  • "Find invoices from this month in my work Gmail and list amounts and due dates."
  • "Archive GitHub notifications older than two weeks and mark them read."
  • "Read the thread with the landlord and tell me what I still owe."

Troubleshooting

OpenClaw uses gog instead of Upsy

With both set up, the agent picks one. Say "use upsy", disable the gog skill as in the steps, or uninstall gog. Skills load per session, so start a new one.

OpenClaw says it can't send, or can't trash

Gmail is on Read-only for OpenClaw MCP, or those tools are off under Pick actions. Raise the level on its page in Upsy, then send a new message. A tool answering "The user hasn't allowed you to use Gmail" means Gmail is off for OpenClaw.

The sign-in page fails to load

The sign-in's last page is on OpenClaw's machine, at 127.0.0.1. If OpenClaw runs on another machine, copy the full address of the failed page, paste it where openclaw upsy setup is waiting, and press Enter. Without the plugin, the OpenClaw MCP guide shows how to finish by hand.

Google's screen names Composio

Expected for now. While Google reviews Upsy's own Google app, Gmail signs in through Composio's verified one. On Workspace, your admin may have to allow it.

An alert says OpenClaw trashed 50 items

That's Upsy's mass-delete alert. If you didn't ask for it, pause OpenClaw on upsy.ai, check History, and restore from Gmail's Trash, which keeps mail for 30 days. email_untrash brings it back too.

Security and privacy

  • OpenClaw holds only an Upsy token, in ~/.openclaw/state/openclaw.sqlite. Google's token stays in Upsy.
  • No prompt before sending. OpenClaw's approvals cover shell commands, and Upsy has no approval step. If OpenClaw must never send, use Read-only, or leave sending out under Pick actions.
  • Emails can carry instructions. On Read-only, a hostile email can't get OpenClaw to send, label or trash anything through Upsy. It can still repeat what it read.
  • History lists each action under OpenClaw MCP, like a sent email's subject and recipients. Neither Upsy nor Composio keeps your mail.
  • Alerts email you when one assistant sends 20+ emails, trashes or deletes 50+ items, or reads 100+ times within 10 minutes.
  • Turning it off: pause OpenClaw MCP or set Gmail to No access in Upsy, from any browser. openclaw mcp unset upsy removes it from OpenClaw.

For the wider picture, see is OpenClaw safe?.

FAQ

Does OpenClaw have a Gmail integration?

Yes: the bundled gog skill, with your own Google Cloud project, and a Gmail Pub/Sub hook that triggers runs on new mail. Upsy adds per-action access, a history and alerts without a Cloud project.

Can OpenClaw send email from Gmail?

Yes. gog sends with its default sign-in. Through Upsy, it sends when Gmail is on Full access, or on Pick actions with sending ticked.

Can I make OpenClaw read-only on Gmail?

Yes, two ways: authorize gog with --readonly or --gmail-scope readonly, or set Gmail to Read-only for OpenClaw in Upsy.

Can OpenClaw use two Gmail accounts?

gog holds several accounts and picks one with --account. Upsy takes up to five, each at its own level.

Does OpenClaw need my Gmail password?

No. gog and Upsy both sign in with Google's OAuth. Only himalaya uses an app password.

Related guides