Email Security for Openclaw

A comprehensive security layer for AI agents to safely process, sanitize, and execute commands from email communications.

ivaavimusic
v1.0.0
Feb 9, 2026
2
2.3k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install email-security

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 email-security 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 Email Security?

The Email Security skill is a critical protection layer designed specifically for AI agents interacting with email systems like Gmail, Proton Mail, and various SMTP/IMAP providers. It mitigates high-risk vulnerabilities such as prompt injection, command hijacking, and social engineering by enforcing strict verification and sanitization protocols. By integrating this into your workflow, you ensure that only authorized commands reach your agent's core logic.

As one of the most essential Openclaw Skills, it provides a structured defense-in-depth approach to email handling. It manages everything from SPF/DKIM validation to stripping dangerous HTML elements and hidden characters that could deceive a Large Language Model. This ensures your agent remains a productive tool without becoming a security liability through untrusted external inputs.

Email Security Use Cases

  • Blocking prompt injection attempts hidden in incoming email bodies.
  • Verifying sender identity using SPF, DKIM, and DMARC headers to prevent spoofing.
  • Sanitizing email content to remove malicious scripts, HTML, or hidden zero-width spaces.
  • Enforcing strict file type restrictions on attachments to prevent malware execution.
  • Managing hierarchical access levels for owners, admins, and trusted contacts to control agent permissions.

How Email Security Works

  1. The agent receives an email input and immediately triggers the sender verification process against the local owner configuration.
  2. Authentication headers are checked to confirm the email hasn't been spoofed or altered in transit.
  3. The email content is parsed to extract only the newest message, intentionally ignoring quoted or forwarded content that might contain malicious instructions.
  4. The extracted text is sanitized to remove HTML, decode obfuscated characters, and identify known threat patterns.
  5. Attachment policies are applied to block dangerous file types like executables or scripts while allowing safe documents.
  6. Only if all security checks pass is the command passed to the AI agent for safe execution.

Email Security Setup

To get started with this skill, first define your owner identity and then use the provided scripts for verification:

# Initialize the owner configuration
echo "owner_email: [email protected]" > references/owner-config.md

# Verify a sender's authorization level with headers
python scripts/verify_sender.py --email "[email protected]" --config references/owner-config.md --headers '{"Authentication-Results": "spf=pass"}'

# Parse and sanitize an incoming .eml file
python scripts/parse_email.py --input "message.eml" --json
python scripts/sanitize_content.py --text "EXTRACTED_BODY_TEXT"

Email Security Data Schema & Taxonomy

The skill organizes its security data and metadata through the following structure:

Component Description
references/owner-config.md Stores authorized email addresses and their permission levels.
references/threat-patterns.md A dictionary of known injection and social engineering strings.
scripts/ Contains the core logic for parsing, sanitizing, and verifying email data.
attachments/ Temporary directory for processing filtered email attachments.

Email Security Advanced Features

  • Multi-level authorization hierarchy (Owner, Admin, Trusted, Unknown) for granular command control.
  • Automated SPF/DKIM/DMARC header validation for enterprise-grade sender verification.
  • Advanced injection pattern detection to neutralize "ignore previous instructions" style attacks.
  • Configurable rate limiting to prevent denial-of-service or command spamming from non-owner accounts.
  • Provider-specific optimizations for Gmail OAuth and AgentMail API security features.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*