Import Policies from Gmail
Your insurance documents are already in your email. Use an AI agent to find them, extract the data, and organize everything in Policy Penguin.
Prerequisites
- ✓ An AI agent that can run CLI tools (OpenClaw, Claude Code, or similar)
- ✓ A Gmail account (your existing one, where your insurance emails are)
- ✓ A Policy Penguin account with an API key
Step 1: Install gogcli
gogcli is a CLI for Google Workspace (Gmail, Drive, Calendar). It handles OAuth and gives your agent access to search emails and download attachments.
brew install gogcliAuthorize your Gmail
Set up Google OAuth credentials (one-time):
- Go to Google Cloud Console
- Create a project (or use an existing one)
- Enable the Gmail API
- Create OAuth credentials (Desktop app type)
- Download the credentials file
Then register and authorize:
gog auth credentials ~/Downloads/client_secret.json
gog auth add your-email@gmail.com A browser window opens. Sign in and grant access. Done.
Step 2: Connect to Policy Penguin
Your agent needs your Policy Penguin API key to upload documents. Two options:
Option A: MCP server (recommended)
Gives your agent upload and query tools. Add to your agent's MCP config:
{
"mcpServers": {
"policy-penguin": {
"url": "https://mcp.policypenguin.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
} See the full MCP documentation for available tools and resources.
Option B: REST API via environment variable
If you prefer direct HTTP calls without MCP:
export POLICY_PENGUIN_API_KEY=YOUR_API_KEY Your agent calls the REST API directly. The upload endpoint is POST https://api.policypenguin.ai/v1/upload.
Either way, your API key stays in config or environment. Never paste it into the chat.
Step 3: Run the import
Tell your agent:
Paste this into your agent
Search my Gmail for insurance policy documents from the last 2 years. Look for emails from insurance carriers with PDF attachments (renewal notices, declarations pages, ID cards). Download each PDF and upload it to Policy Penguin.
The agent will:
- Search Gmail with queries like
from:statefarm.com has:attachment filename:pdf - Download PDF attachments from matching emails
- Upload each one to Policy Penguin (about 15 seconds per document)
- Report what it found: carriers, premiums, coverages, vehicles
What you get
Open Policy Penguin and your vault is populated. Every policy organized by carrier, with:
- Coverage limits as numbers (not display strings)
- Premium history across renewals
- Linked vehicles and properties
- Missing discount analysis with estimated savings per discount
- Coverage gap detection across policies
Historical policies get tracked too. With multiple terms from the same carrier, Policy Penguin shows your premium trajectory and how it compares to the state average.
Next steps
- Query your data: With the MCP server connected, ask your agent anything about your coverage. See the full agent tutorial.
- Keep it current: Re-run the Gmail scan when new renewal notices arrive. Your portfolio stays up to date.
- REST API: Build your own integrations with the API reference.
Ready to organize your insurance?
Sign up, upload your first policy (or let your agent do it), and see the full picture.
See all tutorials or the REST API reference.