Install
openclaw skills install secure-gmailSecure Gmail skill using Composio brokered OAuth — no raw tokens stored locally. Reads, searches, and drafts emails with least-privilege enforcement. Blocks...
openclaw skills install secure-gmailProvides read-only + draft Gmail access through Composio's managed authentication layer. OAuth tokens never touch your local filesystem or agent memory — Composio brokers every API call on its backend.
Activate this skill when the user says any of the following:
Do NOT activate for:
pip install python-dotenv composioIf COMPOSIO_API_KEY is missing the skill will exit with:
Error: COMPOSIO_API_KEY not found in environment
Direct the user to add it to the .env file before retrying.
cd ~/clawd/skills/secure-gmail && python3 agent.py "fetch last 10 emails"
python3 agent.py "find emails from sarah@example.com this week"
python3 agent.py "find emails about quarterly budget"
python3 agent.py "read email with id MESSAGE_ID_HERE"
python3 agent.py "draft a reply to the last email from John saying I will review by Friday"
| User Request | Composio Action Called | Result |
|---|---|---|
| Check inbox | GMAIL_FETCH_EMAILS | Returns last N emails with sender, subject, date |
| Find email | GMAIL_SEARCH_MESSAGES | Returns matching threads |
| Read email | GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID | Returns full email body |
| Draft reply | GMAIL_CREATE_EMAIL_DRAFT | Creates draft, confirms saved not sent |
| Profile check | GMAIL_GET_PROFILE | Returns authenticated email address |
The following are not in the allowed list and are rejected before reaching Gmail — even if the agent tries to call them due to hallucination or ambiguous instructions:
If a user asks to send or delete, respond: "This skill is read and draft only. To send, please review the draft in Gmail and send it yourself, or install a send-enabled skill with human approval confirmation."
The agent returns JSON. Parse and present it like this:
For email list:
📬 Found 5 emails:
1. From: sarah@co.com | Subject: Q4 Budget | Date: Mar 1
2. From: mike@co.com | Subject: Meeting Notes | Date: Feb 28
...
For drafts:
✅ Draft saved (not sent):
To: john@example.com
Subject: Re: Project Update
Preview: "Hi John, I'll review this by Friday..."
Review it at: mail.google.com/mail/#drafts
| Error | Cause | Fix |
|---|---|---|
COMPOSIO_API_KEY not found | Missing .env key | Add key to .env file |
Gmail not connected | OAuth not completed | Go to app.composio.dev → Connected Accounts |
Token expired | OAuth needs refresh | Reconnect Gmail in Composio dashboard |
Action not permitted | Tried blocked action | Expected — tell user it's read/draft only |
Rate limit exceeded | Too many requests | Wait 60 seconds and retry |
This skill uses Composio's brokered authentication model:
This protects against three attack vectors:
After running, check app.composio.dev → Logs to see:
Gmail access via Composio brokered auth. The agent never sees your raw OAuth tokens.