agentleFS
wittyreferencewittyreference/twilio-claude-plugin/skills/verify/SKILL.md

verify

Skill2 starsChanged 8 months agoMITView on GitHub

Twilio development skill: verify

175 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use build-fix, lazy and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • diego-tobalinaSkill

    build-fix

    Fix build and compilation errors systematically. Run when build fails.

    Also in 8 projects that use this

  • vasuag09Skill

    lazy

    Build the minimum that actually works — question whether the task needs to exist (YAGNI), reach for stdlib before custom code, native platform features before dependencies, one line before fifty. A persistent generation-reduction bias for the Implement phase. Use when the user says "be lazy", "lazy mode", "minimal", "simplest solution", "do less", "yagni", or complains about over-engineering, bloat, boilerplate, or needless dependencies. Levels: lite, full (default), ultra. Off: "stop lazy" / "normal mode".

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-export

    Export instincts from project/global scope to a file

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-import

    Import instincts from file or URL into project/global scope

    Also in 3 projects that use this

  • qtzx06Skill

    eval

    Evaluate trained YOLO model accuracy with mAP metrics and per-class error analysis. Identifies failure cases for targeted improvement. Use after training.

    Also in 7 projects that use this

  • vltingSkill

    scope

    Interactive planning + orchestration. Approval-gated workflow covering saga→epic→task hierarchy via progressive scoping.

    Also in 6 projects that use this

  • +2 more from TheKREATORS

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 153 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check by phone/email (to) or by VerificationSid

    line 34
  2. Very specific:

    Checking a non-existent verification returns 60200, not 404: If you check a phone number that has no pending verification, you get 60200 …

    line 215
  3. Very specific:

    lookupEnabled adds carrier data to verification response: When enabled, the lookup field contains carrier type (mobile/landline/voip), …

    line 223
  4. Very specific:

    5 check attempts per verification: After 5 wrong codes, status becomes max_attempts_reached and subsequent checks throw 60202.

    line 231

“Common” is measured: kept by at least 6 in 10 of the 153 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

name: verify description: Twilio Verify OTP verification guide. Use when building phone/email verification, 2FA login, signup confirmation, or debugging failed verifications. allowed-tools: mcp__twilio__*, Read, Grep, Glob

<!-- verified: twilio.com/docs/verify/api, twilio.com/docs/verify/api/verification, twilio.com/docs/verify/api/verification-check, twilio.com/docs/verify/api/service, twilio.com/docs/verify/api/rate-limits-and-timeouts + live testing 2026-03-25 -->

Twilio Verify

OTP verification across SMS, voice, email, and WhatsApp channels. Covers channel selection, service configuration, verification lifecycle, error handling, and fraud prevention.

Evidence date: 2026-03-25. Account prefix: AC... Service: VA9e7e80.

Scope

CAN

  • Send OTP codes via SMS, voice call, email, and WhatsApp
  • Silent Network Auth (SNA) for frictionless carrier-level verification
  • TOTP for authenticator app integration (separate factor flow)
  • Custom code lengths: 4-10 digits <!-- verified: live-tested codeLength=4 and 10 OK, 3 and 11 rejected -->
  • Custom codes for testing (customCodeEnabled on service)
  • Rate limiting via programmable rate limit keys (IP, session ID, etc.)
  • Locale override for message language
  • Lookup integration for carrier/line-type detection during verification
  • PSD2 compliance (amount + payee in verification message)
  • Cancel pending verifications
  • Check by phone/email (to) or by VerificationSid
  • Tags metadata for analytics (max 10 tags, 128 chars each)
  • Risk check per-attempt (enable/disable Fraud Guard)
  • DoNotShareWarning appended to SMS body
  • Verification Attempts API for analytics (VL-prefixed SIDs)

CANNOT

<!-- verified: all CANNOT items live-tested 2026-03-25 unless noted -->
  • No built-in channel fallback — Must implement retry logic manually (e.g., SMS fails → voice). The API does not auto-escalate between channels.
  • No webhook on verification completion — There is no callback URL. You must poll get_verification_status or check status in the VerificationCheck response. Status check polling is rate-limited: 60/min, 180/hr, 250/day. <!-- verified: twilio.com/docs/verify/api/rate-limits-and-timeouts -->
  • Cannot retrieve the actual code sent — By design. The code is never returned in API responses.
  • Cannot change channel mid-verification — Starting on a new channel reuses the same VE SID and token, but the code itself does not change. You get a new sendCodeAttempt entry. <!-- verified: live-tested channel switch sms→call→whatsapp, same VE SID -->
  • Cannot extend TTL on an existing verification — Default 10 minutes. Customizable only at the account level (2min-24hr) via Twilio Support, not per-verification. <!-- verified: twilio.com/docs/verify/api/rate-limits-and-timeouts -->
  • VE SID deleted after approval — Fetching an approved verification returns 404. Canceled and max_attempts_reached verifications remain fetchable. <!-- verified: live-tested, VE SID 404 after approval, persists after cancel -->
  • auto channel not universally available — Returns 60200 on accounts without Fraud Guard or specific configuration. Do not assume it works. <!-- verified: live-tested, 60200 "Invalid parameter: Channel" -->
  • Email requires Mailer configuration — Passing channel: 'email' without a configured Mailer (SendGrid integration) on the service returns error 60217. This is a service-level setup, not a per-request option. <!-- verified: live-tested, error 60217 -->
  • SNA requires carrier integration — Returns 60001 "Downstream Authentication Failed" without carrier-level setup. Region-dependent availability. <!-- verified: live-tested, error 60001 -->
  • No SMS delivery confirmation — Verify API does not report whether the SMS was actually delivered. Use Messaging Insights separately if delivery tracking is needed.

Quick Decision

NeedUseWhy
Signup phone confirmationstart_verification + check_verification via SMSSimplest flow, highest reach
Login 2FASame flow, store verified flag in your DBVerify does not track "verified users"
Voice fallback after SMSStart with channel: 'sms', retry with channel: 'call'Manual fallback; same VE SID reused
Email verificationConfigure Mailer on service first, then channel: 'email'Will not work without Mailer (error 60217)
Frictionless verificationSNA (channel: 'sna')No code, carrier-level — but limited availability
Authenticator appTOTP factor creation (separate API flow)Not via start_verification
Testing without real SMScustomCodeEnabled: true on service + customCode paramAvoids rate limits and costs
Fraud preventionlookupEnabled: true on service + riskCheck: 'enable'Carrier type detection + Fraud Guard

Decision Frameworks

Channel Selection

ChannelSetup RequiredCode DeliveryUser ExperienceBest For
smsNone4-10 digit codeUniversal, familiarDefault for most apps
callNoneSpoken code (DTMF prompt by default)Accessible, works on landlinesFallback for SMS, accessibility
emailMailer integration on serviceCode in email bodySlower, may land in spamEmail-only verification
whatsappWhatsApp sender on serviceCode in WhatsApp messageRich, high open rateMarkets with high WhatsApp usage
snaCarrier integrationNo code (silent)Frictionless, invisibleMobile apps with carrier support
autoFraud Guard (account-level)VariesTwilio chooses best channelNot reliably available

Service Configuration Strategy

SettingDefaultWhen to Change
codeLength6Shorter (4) for better UX; longer (8-10) for higher security
lookupEnabledfalseEnable for fraud detection (adds carrier type to response)
skipSmsToLandlinesfalseEnable to auto-route landlines to voice (requires lookupEnabled)
dtmfInputRequiredtrueDisable for simpler voice UX (code plays immediately)
customCodeEnabledfalseEnable for testing environments only
doNotShareWarningEnabledfalseEnable for consumer-facing apps (adds security text to SMS)
<!-- verified: all defaults confirmed via live service fetch 2026-03-25 -->

Integration Patterns

Basic SMS Verification

// Start verification
const verification = await client.verify.v2
  .services(context.TWILIO_VERIFY_SERVICE_SID)
  .verifications.create({ to: phoneNumber, channel: 'sms' });
// verification.status === 'pending'
// verification.sid === 'VE...' (reused if resending within TTL)

// Check code
const check = await client.verify.v2
  .services(context.TWILIO_VERIFY_SERVICE_SID)
  .verificationChecks.create({ to: phoneNumber, code: userCode });
// check.status === 'approved' means success
// check.status === 'pending' means wrong code (no error thrown!)

Fallback: SMS to Voice

const channel = attemptCount >= 2 ? 'call' : 'sms';
const verification = await client.verify.v2
  .services(context.TWILIO_VERIFY_SERVICE_SID)
  .verifications.create({ to: phoneNumber, channel });
// Same VE SID and token reused — sendCodeAttempts array grows

Check by VerificationSid (Alternative)

// When you stored the VE SID instead of the phone number
const check = await client.verify.v2
  .services(serviceSid)
  .verificationChecks.create({ verificationSid: veSid, code: userCode });

Cancel a Pending Verification

await client.verify.v2
  .services(serviceSid)
  .verifications(veSid)
  .update({ status: 'canceled' });
// SID remains fetchable with status 'canceled'

Error Handling — Start Verification

try {
  const verification = await client.verify.v2
    .services(serviceSid)
    .verifications.create({ to: phoneNumber, channel: 'sms' });
  return { success: true, status: verification.status };
} catch (error) {
  switch (error.code) {
    case 60200: // Invalid parameter (To, Channel, Locale, etc.)
      return { success: false, error: 'Invalid input: ' + error.message };
    case 60203: // Max SEND attempts reached
      return { success: false, error: 'Too many attempts. Wait before retrying.' };
    case 60217: // Email channel not configured
      return { success: false, error: 'Email verification not available.' };
    default:
      throw error;
  }
}

Error Handling — Check Verification

try {
  const check = await client.verify.v2
    .services(serviceSid)
    .verificationChecks.create({ to: phoneNumber, code: userCode });

  if (check.status === 'approved') {
    return { success: true, verified: true };
  }
  // Wrong code: status remains 'pending', valid=false — NOT an error
  return { success: false, verified: false, attemptsRemaining: true };
} catch (error) {
  if (error.code === 60202) {
    // Max CHECK attempts (5 wrong codes)
    return { success: false, verified: false, attemptsRemaining: false };
  }
  if (error.code === 20404) {
    // VE SID deleted (expired or already approved)
    return { success: false, error: 'Verification expired. Request a new code.' };
  }
  throw error;
}

Gotchas

Service Setup

  1. FriendlyName rejects 5+ total digits: Error 60200 if the name contains 5 or more digit characters, even non-consecutive. my-svc-1a2b3c4d5 fails. Use alpha-only suffixes: echo "$TS" | md5 | tr '0-9' 'g-p' | head -c 8. [Evidence: 4-digit name VA684db2da created OK, 5-digit name returned 60200]
  2. Email channel requires Mailer integration: Passing channel: 'email' without first configuring a Mailer (SendGrid or custom SMTP) on the Verify Service returns error 60217 with no hint about what to configure. [Evidence: error 60217 "A Mailer must be associated with the service"]
  3. auto channel is not universally available: Returns 60200 "Invalid parameter: Channel" on accounts without Fraud Guard. Do not use in production without confirming account eligibility. [Evidence: 60200 on test account]

Verification Lifecycle

  1. Wrong code does NOT throw an error: A wrong code returns status: 'pending', valid: false with no exception. Client code must check the status field, not rely on try/catch. Only the 6th wrong attempt throws error 60202. [Evidence: 5 wrong checks returned pending, 6th threw 60202]
  2. VE SID deleted after approval but not after cancel: Approved verifications return 404 on fetch. Canceled verifications remain fetchable. Max-attempts verifications remain fetchable. This asymmetry means you cannot reliably fetch final status after a successful verification. [Evidence: VEe9a0bd66 returned 404 after approval; VEbc83fbec fetchable after cancel]
  3. Same token reused within validity window: Resending to the same number returns the same VE SID and code. The sendCodeAttempts array grows but the code does not change. This is by design — prevents code-rotation attacks. [Evidence: VE5d276ab1 returned on both initial send and resend]
  4. Channel switch reuses VE SID: Switching from SMS to voice to WhatsApp all use the same VE SID and token. Each channel gets a new VL-prefixed sendCodeAttempt entry. [Evidence: VE5d276ab1 across sms→call→whatsapp with 4 VL entries]

Error Codes

  1. Error 60202 is max CHECK attempts, not max SEND: 60202 = too many wrong codes (5 attempts). 60203 = too many sends to same number. [Evidence: 6th wrong code → 60202 "Max check attempts reached"; resend after rate limit → 60203 "Max send attempts reached"]
  2. Checking a non-existent verification returns 60200, not 404: If you check a phone number that has no pending verification, you get 60200 "Invalid parameter To" rather than a 404. The error message is misleading. [Evidence: check to unused number returned 60200]
  3. 60200 is the catch-all error code: Used for invalid FriendlyName, invalid To, invalid Channel, invalid Locale, invalid CodeLength, and non-existent verifications. Read the error message, not the code alone. [Evidence: same 60200 for 6 different parameter failures]

Configuration

  1. dtmfInputRequired defaults to true: Voice verifications prompt the user to press a key before reading the code. If you want the code read immediately, set this to false on the service. [Evidence: service fetch showed dtmfInputRequired=true]
  2. lookupEnabled adds carrier data to verification response: When enabled, the lookup field contains carrier type (mobile/landline/voip), name, and MCC/MNC. Useful for fraud detection but adds latency and cost per verification. [Evidence: lookup returned type=voip, name=Twilio for test number]
  3. Code length 4-10 enforced at service creation: Values below 4 or above 10 return 60200. The default is 6. This is set on the Service, not per-verification. [Evidence: codeLength=4 and 10 created OK; 3 and 11 returned 60200]
  4. Custom codes require service-level opt-in: The customCode parameter is silently ignored unless customCodeEnabled: true is set on the Verify Service. Use this for testing environments only. [Evidence: VEb40fc044 verified with customCode=987654 on enabled service]

Rate Limits

  1. 5 check attempts per verification: After 5 wrong codes, status becomes max_attempts_reached and subsequent checks throw 60202. The user must request a new verification. [Evidence: 5 pending responses, 6th threw 60202]
  2. Send rate limit is per-number, per-time-window: Sending too many verifications to the same number within 10 minutes triggers 60203. The exact threshold depends on account configuration (documented as 5 per 10 minutes). [Evidence: 60203 after repeated sends to same number]

Error Code Reference

CodeMeaningTrigger
60200Invalid parameterFriendlyName, To, Channel, Locale, CodeLength, or non-existent verification
60202Max check attempts reached5 wrong codes submitted for one verification
60203Max send attempts reachedToo many sends to same number in time window
60212Verification expiredCode TTL elapsed (default 10 minutes)
60217Mailer not configuredchannel: 'email' without Mailer on service
60223Invalid phone numberNon-E.164 format or unroutable number
60001Downstream auth failedSNA without carrier integration
20404Resource not foundFetching deleted VE SID (approved/expired)
<!-- verified: all error codes live-tested 2026-03-25 except 60212 (would require 10-min wait) -->

Reference Files

TopicFileWhen to read
Assertion auditreferences/assertion-audit.mdVerifying claim provenance, reviewing evidence chain

Related Resources

  • Domain docs: CLAUDE.md (function inventory, env vars), REFERENCE.md (code samples, test patterns)
  • Codebase functions: start-verification.protected.js, check-verification.protected.js
  • MCP tools: mcp__twilio__start_verification, mcp__twilio__check_verification, mcp__twilio__get_verification_status
  • Related skills: /skills/lookup/SKILL.md (phone number intelligence — line type, carrier, fraud detection, identity match), /skills/compliance-regulatory.md (data retention, regulatory requirements), /skills/voice/SKILL.md (voice verification use case)
  • Twilio docs: Verify API, Rate Limits, Best Practices

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.