openai-twilio-security-api-auth
Screenshots
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "openai-twilio-security-api-auth" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-cc88d4057e140022f41b7e1d9f87f744f5d75c1867f71f0f257fb14aa8c26095. Verify the upstream source and version against https://github.com/openai/plugins before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Select and correctly implement Twilio authentication methods. Covers Auth Token (testing only), API Keys (production standard), OAuth2 client_credentials (time-limited Bearer Token), Access Tokens (client SDK), and test credentials. This skill must be used before making any Twilio API calls in production.
Introduction source: third_party · openai · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Twilio supports four authentication methods. Choosing the wrong one is a security risk — Auth Tokens in production code are the most common credential leak.
- Testing
- Not tested
Browse files
Frontmatter
name: twilio-security-api-auth
description: >
Choose the right Twilio authentication method and implement it correctly.
Covers Auth Token (testing only), API Keys (production standard), OAuth2
client_credentials (time-limited bearer tokens), Access Tokens (client-side
SDKs), and test credentials. Use this skill before making any Twilio API
calls in production.Overview
Twilio supports four authentication methods. Choosing the wrong one is a security risk — Auth Tokens in production code are the most common credential leak.
| Method | Use for | Token lifetime | Revocable individually |
|---|---|---|---|
| Auth Token | Local testing only | Permanent (until rotated) | No — rotation breaks ALL API keys |
| API Key + Secret | Production server-side | Permanent (until deleted) | Yes |
| OAuth2 Bearer Token | Production server-side (enhanced) | 1 hour | Expires automatically |
| Access Token (JWT) | Client-side SDKs (Voice, Video, Chat) | Up to 24 hours | No — delete issuing API key |
Decision framework:
- Building a quick prototype? → Auth Token (but switch to API Key before deploying)
- Production server-side code? → API Key + Secret (simplest production auth) or OAuth2 (time-limited tokens)
- Browser/mobile client needs to connect? → Access Token (JWT) generated server-side
- Running tests without charges? → Test credentials with magic numbers
API Key Authentication (Production Standard)
Create: Console → Account → API keys & tokens → Create API key
| Key type | Access | Create via |
|---|---|---|
| Main | Full account access | Console only |
| Standard | All resources except /Accounts and /Keys endpoints | Console or API |
| Restricted | Specific resources only (up to 100 permissions) | Console or v1 IAM API only |
Python
import os
from twilio.rest import Client
client = Client(
os.environ["TWILIO_API_KEY"], # SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
os.environ["TWILIO_API_SECRET"],
os.environ["TWILIO_ACCOUNT_SID"] # required as third argument
)
Node.js
const client = require("twilio")(
process.env.TWILIO_API_KEY,
process.env.TWILIO_API_SECRET,
{ accountSid: process.env.TWILIO_ACCOUNT_SID }
);
OAuth2 Authentication (Client Credentials)
Time-limited bearer tokens that expire after 1 hour. More secure than permanent API keys for server-to-server communication.
Step 1 — Create an OAuth App
Create an OAuth App in the Twilio Console to get a Client ID and Client Secret.
Step 2 — Request a Bearer Token
cURL
curl -X POST 'https://oauth.twilio.com/v2/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id={ClientID}' \
-d 'client_secret={ClientSecret}' \
-d 'grant_type=client_credentials'
Response:
{
"access_token": "{BearerToken}",
"token_type": "Bearer",
"expires_in": 3600
}
Step 3 — Use the Bearer Token
curl 'https://api.twilio.com/2010-04-01/Accounts/{AccountSID}/Messages.json' \
-H 'Authorization: Bearer {BearerToken}'
SDK Support
OAuth2 is supported in all Twilio SDKs:
| Language | Minimum version |
|---|---|
| Java | 10.6.0 |
| C#/.NET | 7.6.0 |
| Node.js | 5.4.0 |
| Python | 9.4.1 |
| Ruby | 7.4.0 |
| PHP | 8.5.0 |
| Go | 1.25.1 |
Docs: OAuth access tokens | Segment OAuth connections
Access Tokens (Client-Side SDKs)
Short-lived JWTs for authenticating browser/mobile clients. Generate server-side, pass to the client.
Python
from twilio.jwt.access_token import AccessToken
from twilio.jwt.access_token.grants import VoiceGrant
token = AccessToken(
os.environ["TWILIO_ACCOUNT_SID"],
os.environ["TWILIO_API_KEY"],
os.environ["TWILIO_API_SECRET"],
identity="user-123",
ttl=3600
)
token.add_grant(VoiceGrant(outgoing_application_sid="APxxxx"))
print(token.to_jwt())
Grant types: VoiceGrant, VideoGrant, ChatGrant (Conversations), SyncGrant
Test Credentials
Make API calls without charges. Find at Console → Account → API keys & tokens → Test credentials.
Magic numbers: +15005550006 (valid), +15005550001 (invalid, error 21211), +15005550007 (no SMS, error 21612)
CANNOT
- Standard keys cannot access /Accounts or /Keys endpoints — Returns 20003 (401). Use Auth Token or Main key.
- Cannot create restricted keys via v2010 API — Silently creates a standard key instead. Use v1 IAM API.
- Restricted keys cannot generate Access Tokens — Only Standard and Main keys can.
- Cannot revoke individual Access Tokens — Valid until expiration (max 24h). Delete the issuing API key to revoke all.
- OAuth2 only supports
client_credentialsgrant — No refresh tokens, no authorization code flow. - OAuth2 tokens expire after 1 hour — Your application must handle token refresh.
- API Key Secret shown only at creation — Cannot be retrieved afterward.
- Auth Token rotation breaks ALL API keys — One-way door. This is why you should use API keys from day one.
- Test credentials work with only 4 endpoints — Messages, Calls, IncomingPhoneNumbers, Lookups. All others return 403.
Next Steps
- Account setup and sub-accounts:
twilio-account-setup - HIPAA account configuration:
twilio-security-compliance-hipaa - Webhook signature validation:
twilio-webhook-architecture - Credential security patterns:
twilio-security-hardening
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供Twilio生产环境认证的核心解决方案,涵盖API Key、OAuth2、Access Token等多种认证方式
- 详细的安全最佳实践指导,帮助用户避免常见的安全风险
- 包含完整的代码示例和决策框架,实用性强
Highlights
- 触发描述精准完整,明确说明技能用途和适用场景
- 覆盖多种Twilio认证方式的变体,边界清晰
- description位置正确,内容完整无截断
Highlights
- 文档结构清晰,有明确的章节划分和步骤说明
- 包含完整的代码示例和表格对比,便于理解执行
- frontmatter完整,文档组织规范
Highlights
- 所有代码示例基于Twilio官方SDK和API,来源可靠
- 详细说明了各种认证方式的限制和异常情况
- 提供了完整的错误处理和边界条件说明
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 7, 13, 18, 20, 23
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- api.twilio.com
- oauth.twilio.com
- www.twilio.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.