Navigation
Ai ToolsUpdated July 3, 2026

Outlook Automation plugin

pluginsoutlookemailautomationai-tools

Outlook Automation plugin

Overview

The Outlook Automation plugin provides enterprise-grade email automation from within Claude Code. It uses secure credential management with the system keychain and resilient browser automation to read, search, and process Outlook emails. The plugin supports two-factor authentication, chronological email processing, and AI-powered task extraction.

The plugin operates in read-only mode by default. Write operations such as sending, deleting, or forwarding emails are architecturally prevented and require explicit security validation with user confirmation.

Version: 7.4.1 Author: Thomas Hudak

Installation

claude plugin install outlook-automation@otc-awesome-llm

Prerequisites

  • Python 3.8 or later
  • The keyring package for system keychain integration
  • A browser automation runtime (agent-browser)
pip install keyring

Authentication

The plugin stores credentials in the operating system's native keychain. Passwords are never written to plaintext files.

First-time setup

python scripts/outlook_login.py --setup

The setup wizard prompts for:

  1. Your email address.
  2. Your password (hidden input).

Both values are stored in the system keychain.

Logging in

# First login (visible browser for 2FA)
python scripts/outlook_login.py

# Use saved authentication state for subsequent logins
python scripts/outlook_login.py --use-saved-auth

# Headless mode (after initial 2FA is complete)
python scripts/outlook_login.py --headless

The browser automation uses a multi-strategy element selection approach with primary selectors, CSS fallbacks, and semantic locators to handle Outlook UI changes gracefully.

Capabilities

Skill trigger phrases

The skill activates when Claude detects phrases such as:

  • "check my emails"
  • "create email digest"
  • "extract tasks from emails"
  • "login to outlook"
  • "automate outlook"
  • "email automation"

Email digest creation

Generate a categorized summary of your inbox:

# Generate digest
python scripts/email_digest.py

# Write to a specific file
python scripts/email_digest.py --output ~/Documents/email_summary.md

# Print to terminal
python scripts/email_digest.py --print

Task extraction for Claude

Extract actionable tasks from emails and format them as Claude-ready prompts:

# Extract all tasks
python scripts/task_converter.py

# Filter by priority level
python scripts/task_converter.py --priority high

# Output as JSON
python scripts/task_converter.py --output-format json

# Process more emails
python scripts/task_converter.py --max-emails 50

The task extractor generates structured output with sender context, timestamps, action items, and ready-to-use Claude prompts for each extracted task.

Chronological email processing

Process large email backlogs from oldest to newest with skip and resume capability:

# Process up to 250 emails
python scripts/chronological_processor.py --max-emails 250

# Resume a previously interrupted session (automatic)
python scripts/chronological_processor.py

# Configure skip criteria
python scripts/chronological_processor.py --skip-long 10000 --skip-attachments 5

# Skip emails from specific senders
python scripts/chronological_processor.py --skip-sender "noreply@" --skip-sender "notifications@"

# Review previously skipped emails
python scripts/chronological_processor.py --review-skipped

# Dry run to preview what would be processed
python scripts/chronological_processor.py --dry-run

Processing state is saved every 10 emails to ~/.outlook-automation/chronological_state.json, allowing you to interrupt and resume at any time.

Skip queue management

Emails are automatically skipped based on configurable criteria:

CriteriaDefault
Body length threshold5000 characters
Attachment countMore than 3 attachments
Sender patternsnoreply@, notifications@
Subject patterns"Newsletter", "Automated"

Configuration

Create a configuration file at ~/.outlook-automation/config.json:

{
  "email": "[email protected]",
  "task_conversion": {
    "keywords": ["TODO", "action required", "urgent"],
    "priority_indicators": {
      "high": ["urgent", "ASAP", "critical"],
      "medium": ["important", "priority"],
      "low": ["when you can", "no rush"]
    }
  },
  "digest_settings": {
    "max_emails_per_category": 5,
    "exclude_domains": ["noreply@", "notifications@"]
  }
}

Protect the configuration directory:

mkdir -p ~/.outlook-automation
chmod 700 ~/.outlook-automation
chmod 600 ~/.outlook-automation/config.json

Security architecture

The plugin implements multiple layers of protection:

LayerComponentPurpose
Credential storagesecure_credentials.pySystem keychain integration, email validation, password strength checking
Operation validationsecurity_validator.pyClassifies operations as READ/WRITE/DELETE/SEND, enforces confirmation
Content sanitizationemail_sanitizer.pyNeutralizes prompt injection in email content
Browser clientoutlook_client.pyFail-closed architecture, no shell injection (shell=False with shlex.split())
Audit loggingsecurity_validator.pyTimestamps and logs all operations with rate limiting

Shadow prompting protection

Email content is automatically sanitized against prompt injection attacks. The sanitizer detects 20+ known techniques including:

  • Direct instruction overrides ("ignore all previous instructions").
  • Hidden instructions in HTML comments or invisible Unicode characters.
  • Role confusion attempts.
  • Code block injections disguised as samples.
  • Context manipulation through subtle behavioral changes.

Each email receives a risk score:

LevelDescription
LowClean email with no detected threats
MediumMinor suspicious patterns
HighMultiple threat indicators or known attack patterns
CriticalClear prompt injection attempt requiring special handling

High-risk emails are wrapped with prominent warnings before being presented to the user.

Included scripts

ScriptPurpose
secure_credentials.pySystem keychain credential management with validation
security_validator.pyWrite operation protection and audit logging
email_sanitizer.pyShadow prompting protection and content sanitization
outlook_client.pySecure email client with fail-safe architecture
outlook_login.pySecure login with 2FA support
email_digest.pyIntelligent email categorization and summarization
task_converter.pyAI-powered task extraction for Claude
chronological_processor.pyProcess emails chronologically with skip capability

Comparison with Teams Automation

AspectOutlook AutomationTeams Automation
AuthenticationBrowser automation with keychainOAuth2 with Azure AD tokens
Data sourceEmails from inbox and foldersMessages from channels and chats
Platform supportRequires browser runtimeCross-platform via Graph API
Message formatHTML emailsMarkdown and Adaptive Cards
Security modelSame fail-safe architectureSame fail-safe architecture

Troubleshooting

SymptomCauseFix
"No credentials found"First-time setup not completedRun python outlook_login.py --setup
"Security validator not found"Missing script filesReinstall the plugin
"Element not found"Outlook UI changedUpdate selectors in outlook_client.py
"Session expired"Authentication state staleRun python outlook_login.py to re-authenticate

Related