Secure Gmail Skill (Composio-backed) for Openclaw

A security-first Gmail integration for AI agents that enables reading and drafting emails without exposing raw OAuth tokens.

coinvest518
v0.1.0
Mar 3, 2026
0
411
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install secure-gmail

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install secure-gmail using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Secure Gmail Skill (Composio-backed)?

The Secure Gmail skill provides a robust interface for AI agents to interact with Gmail through Composio's managed authentication layer. By utilizing a brokered authentication model, this skill ensures that sensitive OAuth tokens are never stored locally or exposed in the agent's memory. This architecture makes it a premier choice for developers building secure automation within the Openclaw Skills ecosystem.

Built with security as a priority, the skill enforces least-privilege access by physically blocking high-risk actions like sending or deleting emails at the API gateway level. This design prevents unauthorized actions even in the event of agent hallucination or prompt injection, providing a safe environment for checking inboxes, searching for specific threads, and preparing drafts for human review.

Secure Gmail Skill (Composio-backed) Use Cases

  • Summarizing unread emails and checking recent inbox activity.
  • Finding specific messages by sender, subject, or date ranges.
  • Extracting information from email bodies for data processing tasks.
  • Creating draft replies to be reviewed and sent manually by the user.
  • Monitoring for specific replies from clients or team members during workflows.

How Secure Gmail Skill (Composio-backed) Works

  1. The user provides a natural language prompt to the AI agent regarding their Gmail account.
  2. The skill triggers a request to Composio using the COMPOSIO_API_KEY stored in the local environment.
  3. Composio acts as a secure broker, retrieving the necessary OAuth credentials from its encrypted vault to communicate with Google APIs.
  4. The Gmail API executes the requested read or draft action and returns the raw data to Composio.
  5. Composio passes the filtered response back to the local skill, which formats the output into clean JSON for the agent to process.
  6. The agent presents the finalized information or draft confirmation to the user within the Openclaw Skills interface.

Secure Gmail Skill (Composio-backed) Setup

Follow these steps to configure the skill for your Openclaw Skills environment:

  1. Create a free account at app.composio.dev and link your Gmail account under Connected Accounts.
  2. Install the necessary Python dependencies:
pip install python-dotenv composio
  1. Add your API key to the .env file located at ~/clawd/skills/secure-gmail/.env:
COMPOSIO_API_KEY=your_api_key_here
  1. Verify the connection by fetching your recent emails:
cd ~/clawd/skills/secure-gmail && python3 agent.py "fetch last 10 emails"

Secure Gmail Skill (Composio-backed) Data Schema & Taxonomy

The skill organizes Gmail data into structured JSON objects to ensure compatibility with various AI models. Below is the mapping of common actions to their data outputs:

Action Logic Output Schema
GMAIL_FETCH_EMAILS Retrieves a list of recent messages ID, Sender, Subject, Date
GMAIL_SEARCH_MESSAGES Queries inbox based on user criteria Thread ID, Snippet, Timestamp
GMAIL_FETCH_MESSAGE_BY_ID Retrieves specific content Full Header, Body Text, Attachments List
GMAIL_CREATE_EMAIL_DRAFT Saves a message in the drafts folder Draft ID, Recipient, Draft Link
GMAIL_GET_PROFILE Checks authentication status Authenticated Email Address

Secure Gmail Skill (Composio-backed) Advanced Features

  • Gateway-level enforcement: Actions like GMAIL_SEND_EMAIL and GMAIL_DELETE_MESSAGE are blocked by default at the API level.
  • Brokered OAuth: Protects against credential theft by ensuring raw tokens never enter the agent's context window.
  • Audit Trails: Every action performed by the skill is logged in the Composio dashboard with a timestamp and status for full transparency.
  • Multi-Agent Compatibility: Easily integrates with other Openclaw Skills to create complex research and communication pipelines.
  • Human-in-the-loop design: Focuses on draft creation rather than direct sending to maintain user control over communication.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*