Twilio compliance traffic

From openai/plugins · View interactive version

Twilio compliance traffic is an AI agent skill from the GitHub repository openai/plugins. Rules you must follow for Twilio messaging and voice traffic. Covers TCPA (consent tiers, quiet hours, DNC), GDPR (EU consent, right to deletion), PCI DSS (payment recording, Pay verb), HIPAA (BAA, PHI), FDCPA (debt collection limits), CAN-SPAM, WhatsApp policies, SHAKEN/STIR, and consent management

How to use this skill

Skill file

Overview

Compliance failures block sends, get numbers suspended, and expose your customer to legal liability. This skill covers the ongoing rules that apply to live traffic — what you can send, when, and to whom.

Lifecycle: Choose numbers (twilio-numbers-senders) → Register them (twilio-compliance-onboarding) → Follow traffic rules (this skill) → Secure everything (twilio-security-hardening)

For registrations required before traffic works (A2P 10DLC, toll-free verification, WhatsApp/RCS sender approval, voice trust programs), see twilio-compliance-onboarding.


TCPA (Telephone Consumer Protection Act)

Applies to all US voice calls and SMS.

Consent Requirements

| Communication type | Consent required | Notes |

|-------------------|-----------------|-------|

| Informational SMS (order updates) | Prior express consent | Providing phone number during transaction usually qualifies |

| Marketing SMS | Prior express written consent | Must be clear and conspicuous, separate from T&C |

| Manual voice calls | None for existing business relationship | 18-month window |

| Autodialed / prerecorded voice | Prior express consent (informational) or written (marketing) | AI voice agents typically count as autodialed and must disclose who is calling |

| Emergency / fraud alerts | No consent required | Must be genuinely urgent |

Quiet Hours

Do Not Call


GDPR (EU/EEA)

Consent for Communications

| Basis | When it applies | Requirements |

|-------|----------------|-------------|

| Explicit consent | Marketing messages, new customer outreach | Must be freely given, specific, informed, unambiguous. Pre-checked boxes do NOT qualify. |

| Legitimate interest | Transactional messages, existing customer relationship | Requires documented balancing test. Must offer opt-out. |

| Contractual necessity | Order confirmations, shipping updates | Directly related to contract performance |

Right to Deletion

Applies to ALL data stored by your application via Twilio:

Implementation: Build a deletion endpoint that removes data from all systems. Twilio retains message logs for 400 days — you can delete recordings via API but cannot delete message logs from Twilio's system before the retention window.

Call Recording Consent


PCI DSS (Payment Card Industry)

Never Record Card Numbers

Python

# Pause recording when customer gives card number
client.calls(call_sid).recordings(recording_sid).update(status="paused")

# Use <Pay> verb instead of collecting card numbers verbally
response = VoiceResponse()
response.pay(
    payment_connector="stripe_connector",
    charge_amount="49.99",
    currency="usd",
    status_callback="https://yourapp.com/pay-status"
)

PCI Mode Warning

PCI Mode is IRREVERSIBLE and account-wide. Once enabled:

Recommendation: If you need PCI compliance for one use case, create a separate sub-account. See twilio-account-setup.


HIPAA (Healthcare)

Requirements

Safe Notification Content

| Channel | Safe | Unsafe |

|---------|------|--------|

| SMS | "Your appointment is tomorrow at 2pm" | "Your appointment with Dr. Smith for diabetes follow-up" |

| Voice IVR | "Press 1 to confirm your upcoming appointment" | "Press 1 to confirm your cardiology appointment" |

| Email | Can include more detail if encrypted/authenticated | Never send PHI in subject line |


FDCPA / Regulation F (Debt Collection)

Requirements

Python

# Track call attempts per debt
def can_attempt_call(debt_id, db):
    seven_days_ago = datetime.now() - timedelta(days=7)
    attempts = db.count_attempts(debt_id, since=seven_days_ago)
    return attempts < 7

# Include Mini-Miranda in IVR
response = VoiceResponse()
response.say("This is an attempt to collect a debt and any information obtained will be used for that purpose.")
response.pause(length=1)
response.say("Please press 1 to speak with a representative.")
response.gather(num_digits=1, action="/handle-keypress")

WhatsApp Compliance

Template Requirements

Quality Rating

Opt-In Best Practices


CAN-SPAM (Email)

See twilio-sendgrid-email-send for SendGrid-specific compliance features.


SHAKEN/STIR (Caller ID Verification)

Attestation Levels

| Level | Meaning | Caller ID display |

|-------|---------|-------------------|

| A (Full) | Carrier vouches for caller identity and right to use number | Green checkmark ✅ |

| B (Partial) | Carrier vouches for caller but not number ownership | Neutral display |

| C (Gateway) | Carrier knows where call entered network, nothing else | May show "Spam Likely" |


Consent Management Pattern

Store Consent Records

# Minimum consent record
consent_record = {
    "phone": "+15558675310",
    "channel": "sms",                    # sms, voice, whatsapp, email
    "consent_type": "marketing",         # marketing, transactional, debt_collection
    "consent_method": "web_form",        # web_form, verbal, paper, api
    "consent_timestamp": "2026-04-13T14:30:00Z",
    "consent_source": "checkout_page",   # where consent was collected
    "ip_address": "203.0.113.42",        # for web consent
    "opted_out": False,
    "opt_out_timestamp": None
}

Opt-Out Handling


CANNOT


Next Steps

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.