SK… / Auth Token

Exposed Twilio API Key / Auth Token? Here's how to detect and rotate it

Twilio key or Auth Token in your code? Rotate it in the Console, then set geo limits and usage alerts. Clear steps and a free Trust scan to check your repo.

Twilio requests are authorized with either your Account SID plus Auth Token, or an API Key (SID starting with SK) and its secret. Both can send SMS, make calls, and read your logs, all billed to your account. If either leaks, an attacker can rack up charges and pull your data until you rotate it in the Console.

What an attacker can do with a leaked Twilio API Key / Auth Token

How Twilio API Key / Auth Tokens get exposed

Scan your repo for exposed Twilio API Key / Auth Tokens - free

Trust checks the files in your repo and the JavaScript your site ships. No signup, results in about a minute.

Run a free scan →

How to rotate a leaked Twilio API Key / Auth Token

  1. Sign in at console.twilio.com and open Account → Keys & Credentials → API keys & tokens.
  2. If the Auth Token leaked, create a Secondary Auth Token, update your app to use it, then click ‘Promote to Primary’ - this deletes the old token and rejects it immediately.
  3. If an API Key (SK…) leaked, open it under API keys, click ‘Delete this API Key,’ and confirm - requests using it stop working at once.
  4. Create a fresh API Key if you deleted one, copy its secret once, and store it in your secrets manager.
  5. Update your server environment with the new credential and redeploy, then remove the Account SID + Auth Token from anywhere it was hardcoded.
  6. Check Monitor → Logs → Messaging and Voice, plus Usage, for SMS, calls, or number purchases you didn't make, and open a Twilio support ticket if you see fraud.

Open the Twilio API Key / Auth Token dashboard →

Account SID, API Key, Auth Token: which is secret?

  • Account SID (starts with AC): an ID. On its own it does not give access.
  • Auth Token: the master password for the account. Keep it server-side only.
  • API Key (SID starts with SK) and its secret: safer for apps. You can make one per app and delete one without touching the rest.

Set two guard rails today

  • Geographic permissions: in the Console, switch off countries you never call or text, so calls and texts to those places are refused.
  • Usage triggers or alerts: get an email when daily spend passes a number you choose.
  • Both take a few minutes and also help if a key ever leaks.

How Trust helps

Trust's repo scan looks for Twilio API Key IDs (the SK format) in your files. Run it before you push, and again after you rotate.

Other secret types to check

Keep your app safe