Stop Gmail prompt injections & PII leaks.
Screen inbox metadata before reading message bodies. Quarantine hidden unicode hijacks and block OTPs, banking alerts, and medical records.
How do you protect AI email agents from prompt injection and sensitive PII leaks?
Run a deterministic metadata-first firewall before your LLM reads full email bodies. Gmail Privacy Shield scores sender domains, subjects, snippets, and hidden characters locally with zero network calls — quarantining attacks and blocking 2FA codes, banking alerts, and medical records before get_email executes.
Watch the shield quarantine threats in milliseconds
Real terminal execution blocking prompt-injection overrides, spoofed free-webmail billing alerts, and OTP emails while approving clean human threads.
Four deterministic classification tiers
Every email metadata batch is scored offline in privacy_gate.py and mirrored in our hosted Apify MCP tool screen_email_privacy.
QUARANTINE_THREAT
Flags prompt-injection instructions inside email text, hidden zero-width or bidi unicode overrides, free-webmail brand spoofing, and raw-IP or shortened verification URLs. Stops body retrieval immediately.
BLOCK_SENSITIVE
Detects 2FA/OTP codes, password resets, bank/card/wire notifications, medical records, and tax/government ID notices. Prohibits full-body retrieval so secrets never reach the model context.
CAUTION_REVIEW
Surfaces NDAs, legal contracts, HR/payroll updates, and failed or overdue payment notices (reported as REVIEW_CAUTION via hosted Apify MCP). Requires explicit human confirmation.
SAFE_STANDARD
Marks routine human correspondence, customer threads, receipts, and newsletters safe for full read, triage, CRM scoring, or reply drafting (reported as ALLOW via hosted Apify MCP).
Install free in under 3 minutes
Runs alongside local @sar333/gmail-mcp-server with zero cloud token storage.
Install the Open Agent Skill (Free)
npx skills add neutral-Stage/gmail-mcp-server
Works across Claude Code, Cursor, Codex CLI, Windsurf, Copilot, and Gemini CLI — or claim it on Agensi.io for $0.
Connect Local Gmail MCP (Tokens Stay on Disk)
npx @sar333/gmail-mcp-server setup
Authenticates directly against Google's Gmail API with gmail.modify scope only (no permanent delete) and saves your refresh token locally at ~/.gmail-mcp/token.json.
Verify Config & OAuth Health
npx @sar333/gmail-mcp-server doctor
Audits your Node version, client JSON paths, credentials.json, and Gmail token status before your first protected inbox scan.
No local Python? Use our hosted zero-OAuth Apify /mcp server
Connect Claude, Cursor, Windsurf, n8n, Make, or Zapier over Streamable HTTP at $0.01 per privacy screen (screen_email_privacy) with zero Gmail OAuth tokens leaving your machine.
{
"mcpServers": {
"email-guardrail": {
"url": "https://sar333--email-guardrail-mcp-actor.apify.actor/mcp",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
}
}
}
}
Frequently asked questions
Direct answers on stopping email prompt injections, blocking sensitive PII, and choosing local vs hosted guardrails.
How do I stop an AI agent from reading OTP codes or falling for email prompt injections in Gmail?
Screen headers, senders, snippets, and unicode signals before fetching message bodies. Gmail Privacy Shield assigns every message a 0–100 risk score and classifies threats into QUARANTINE_THREAT and BLOCK_SENSITIVE so prompt injections and 2FA/banking secrets stay out of your LLM prompt.
Does Gmail Privacy Shield send my emails to an external LLM or cloud proxy?
No. The open-source skill executes scripts/privacy_gate.py using offline stdlib Python 3 with zero network calls, zero third-party telemetry, and zero environment-variable reads.
Can I run the email prompt-injection scanner in n8n, Make, Zapier, or without local Python?
Yes. Connect any MCP client or workflow runner to https://sar333--email-guardrail-mcp-actor.apify.actor/mcp and invoke screen_email_privacy at $0.01 per batch with zero mailbox OAuth credentials.
What extra workflows do I unlock if I upgrade to Gmail Command Center ($8.49 launch deal)?
Gmail Command Center adds 5 coordinated skills: metadata-first inbox triage & dry-run bulk cleanup, Inbox-to-CRM CSV enrichment (80+ company datapoints + Apollo), verified outreach with live Google/Trustpilot hooks, Reply Copilot with Follow-Up Radar, and 3-minute Setup Doctor.