DEV Community

Sangmin Lee
Sangmin Lee

Posted on • Originally published at claudeguide.io

Building a Sales Outreach Agent with Compliance Guardrails

Originally published at claudeguide.io/claude-sales-agent-ethical

Building a Sales Outreach Agent with Compliance Guardrails

A sales outreach agent without compliance guardrails is a spam machine. A well-built one enforces CAN-SPAM/GDPR opt-out handling, personalizes without fabricating facts, rate-limits to avoid inbox reputation damage, and logs everything for audit purposes in 2026. This guide builds a compliant outreach agent from the ground up, with the guardrails that keep it professional and legal.


The Compliance Requirements

Before building:

Requirement CAN-SPAM (US) GDPR (EU)
Unsubscribe mechanism Required Required
Physical address in email Required Not required
No deceptive subject lines Required Required
Consent before outreach Not required Required (cold email = legitimate interest defense)
Data retention limits Not specified Defined retention period required
Opt-out processing time 10 business days Within 1 month

Practical minimum for B2B cold outreach: unsubscribe link + physical address + honest subject + no fabricated content.


Architecture

Contact list → Filter (unsubscribe check) → Research (company/role) → 
Personalization (Claude) → Compliance check → Rate limit → Send → Log
Enter fullscreen mode Exit fullscreen mode

Each stage has explicit guardrails. The agent cannot skip stages.


Stage 1: Contact Filtering and Opt-Out Check


python
import anthropic
import sqlite3
from dataclasses import dataclass
from datetime import datetime, timedelta


@dataclass
class Contact:
    id: str
    email: str
    name: str
    company: str
    role: str
    linkedin_url: str = None
    last_contacted: str = None


class OptOutRegistry:
    """Permanent opt-out list — never email these addresses."""

    def __init__(self, db_path: str = "outreach.db"):
        self.conn = sqlite3.connect(db_path)
        self._init_db()

    def _init_db(self):
        self.conn.execute("""
            CREATE TABLE IF NOT EXISTS opt_outs (
                email TEXT PRIMARY KEY,
                opted_out_at TEXT NOT NULL,
                reason TEXT
            )
        """)
        self.conn.execute("""
            CREATE TABLE IF NOT EXISTS outreach_log (
                id INTEGER PRIMARY KEY AUTOINCREMENT,
                email TEXT,
                sent_at TEXT,
                subject TEXT,
                personalization_notes TEXT
            )
        """)
        self.conn.commit()

    def is_opted_out(self, email: str) -

[→ Get the Agent SDK Cookbook — $49](https://shoutfirst.gumroad.com/l/ogxhmy?utm_source=claudeguide&utm_medium=article&utm_campaign=claude-sales-agent-ethical)

*30-day money-back guarantee. Instant download.*
Enter fullscreen mode Exit fullscreen mode

Top comments (0)