Terms & acceptable use
馃摫 Free Twilio key check

Added text messages or phone sign-up codes? Make sure your Twilio Auth Token is not sitting in your public JavaScript. Paste your link and check your live app in about 10 seconds. Free.

FreeJust your email to see results10 seconds

The free scan shows your problems. The $9 fix report gives you a copy鈥憄aste fix prompt for each one.

Guide 路 Twilio keys 路 Updated

Is My Twilio Auth Token Safe in My Frontend? Stop SMS Pumping in Lovable, Bolt and v0 Apps

Texts and phone calls cost money every time they go out. If your Twilio Auth Token is in browser code, anyone can copy it and send messages on your bill. And even with the token hidden, a public "send me a code" form can be abused. Here is what Twilio says, how vibe-coded apps leak these keys, where they should live, how to stop SMS pumping, and how to check your live app.

1. The rule: Twilio secrets never go in the browser

Twilio has no secret that is safe to show. The only thing meant for the browser is a short-lived Access Token that your own server makes for the Voice, Video or Chat SDKs.

WhatLooks likeUsual server nameSafe in the browser?
Account SIDAC + 32 charactersTWILIO_ACCOUNT_SIDNot a secret alone, but keep it with the server code
Auth Token32 letters and numbersTWILIO_AUTH_TOKENNo. Full access to your account
API key SID + secretSK + 32 characters, plus a secretTWILIO_API_KEY / TWILIO_API_SECRETNo. Use a Restricted key on the server
Access Token (Voice, Video, Chat SDKs)short-lived JWT made by your servernoneYes. That is what it is for
  • Twilio says: never hardcode credentials in source code or client-side JavaScript, and keep authentication on the server, out of browser code.
  • Why it matters: anyone with your Account SID and Auth Token can make API requests for your account. Twilio lists the risks as unauthorized texts and calls, toll fraud, using up your balance and reading your account data.
  • Smaller keys are better: Twilio calls the Auth Token a legacy, last-resort option and suggests Restricted API keys that can only do what your app needs.

Sources: Twilio: Secrets management 路 Twilio: Secure authentication 路 Twilio: Anti-Fraud Developer's Guide 路 Twilio: API keys overview

2. How vibe-coded apps leak Twilio keys

  1. You paste the SID and token into the chat and the AI writes them straight into a file.
  2. The AI calls Twilio from a React component to get "text me a code" working fast. That puts the token in the JavaScript every visitor downloads.
  3. The token goes in a public env var like VITE_TWILIO_AUTH_TOKEN or NEXT_PUBLIC_TWILIO_AUTH_TOKEN. Those prefixes copy the value into browser code. See which env vars end up in the browser.

The texts arrive, so nothing looks wrong. The bill shows up later.

3. Where the token should live (Lovable, Bolt, v0, Cursor)

  • Lovable, Bolt and other Supabase apps: send texts from a Supabase Edge Function and store TWILIO_AUTH_TOKEN (or an API key secret) as a function secret. Using Supabase phone login? Put the Twilio details in the Supabase dashboard phone provider settings. Your app only calls Supabase Auth.
  • v0, Cursor and other Next.js apps: call Twilio only from a Route Handler or Server Action. Use an env var without NEXT_PUBLIC_.
  • Using the Voice, Video or Chat SDK in the browser? Your server makes a short-lived Access Token with an API key and hands that to the browser. The API key secret stays on the server.
  • Any host: keep keys out of git, use separate keys for testing and for the live app, and use one key per app so one leak means one key to replace.

Leaks often come from an early test build or a quick fix added later. That is why you check the live app, not just your settings.

Sources: Twilio: Separate production and test credentials 路 Twilio: Access Tokens for client-side SDKs

4. The SMS pumping trap

Moving the token to the server is step one. But any public form that sends a text (a sign-up code, "text me a link", a phone login) can be abused. Twilio calls this SMS pumping: bots type in lots of phone numbers they profit from, and you pay for every text. Your key never leaks, yet you still get the bill.

  • Only allow the countries you need. Turn off the rest in Twilio's geographic permissions (for Messaging, Voice and Verify).
  • Turn on Twilio's fraud protection. If you use Twilio Verify, enable SMS Fraud Guard, which Twilio says blocks likely fraudulent texts.
  • Rate limit on the server by phone number and by IP address, with growing wait times between retries.
  • Set the message text on the server. If the browser can pick the number and the words, strangers can use your app to send spam.
  • Turn off what you do not use. No outbound calls? Disable them. Twilio suggests the same for outbound SMS.
  • Set a usage alert. Twilio usage triggers can warn you (or call a webhook) when spending passes a number you pick.

VibeCheck does not fill in or test your forms. Check this one by hand, or use the prompts below.

Sources: Twilio: Preventing fraud in Verify 路 Twilio: Anti-Fraud Developer's Guide

5. Check your live app in 60 seconds

Only check apps you own or have permission to test.

  1. Fastest: paste your live link at the top of this page. VibeCheck reads your homepage and the JavaScript files it loads and flags Twilio API key IDs (SK plus 32 characters). It masks anything it finds. A bare Auth Token is just 32 letters and numbers, so VibeCheck cannot reliably tell it apart from other strings. Do step 2 too.
  2. By hand in Chrome: open your live site, right-click and choose Inspect, then press Ctrl+Shift+F (Cmd+Option+F on Mac). Search for authToken, TWILIO, api.twilio.com and AC followed by a long string.
  3. Send yourself a code once. In the Network tab, look at the request. If it goes straight to api.twilio.com or verify.twilio.com from the browser, your token is in the browser too. It should go to your own server or Supabase instead.

6. Found a token? Do this now

  1. Auth Token: in the Twilio Console, create a new Auth Token first, put it on your server, then disable the old one.
  2. API key: deactivate the leaked key and create a replacement (a Restricted key if you can).
  3. Check for abuse: look at usage, messaging logs and billing for texts or calls you did not make. Email fraud@twilio.com if you see abuse.
  4. Move the Twilio call to the server (section 3), redeploy, and scan your live site again to confirm the token is gone.

More detail for every key type: I leaked my API key. What do I do now?

Sources: Twilio: Incident response for credential exposure 路 Twilio: What to do if you suspect fraud

7. Copy-paste fix prompts

Paste the matching prompt into Lovable, Bolt, v0, Replit or Cursor. After you deploy, rotate any Twilio credential that was ever in client code.

Any builder: move Twilio out of the frontend
Search this whole project for TWILIO, twilio, authToken, accountSid, api.twilio.com, AC followed by 32 characters and SK followed by 32 characters. Remove every Twilio Auth Token, API key secret and Account SID from client-side code and from any NEXT_PUBLIC_, VITE_ or EXPO_PUBLIC_ variable. Move every Twilio call (send SMS, Verify, make a call) into a server function (Supabase Edge Function, Next.js Route Handler or Server Action) that reads the credentials from server-side secrets. The browser should only call my own server function. List every credential you removed so I can rotate it.
Lock down my SMS or verify-code form
Update the server function that sends texts so strangers cannot use it to pump SMS: set the message text on the server (never take it from the browser), only send to countries my users are in (reject other country codes), allow at most 3 codes per phone number per hour and 10 per IP address per hour with growing wait times between retries, return 429 when a limit is hit, and add a bot check before the code is sent. If I use Twilio Verify, use Verify instead of sending raw SMS. Show me the changed code.
Supabase phone login: keep Twilio in the dashboard
My app uses Supabase phone login with Twilio. Make sure no Twilio credentials are in my frontend code or env vars, and that the app only calls supabase.auth.signInWithOtp and verifyOtp. Remove any direct calls to api.twilio.com from the browser. List anything you removed so I can rotate it.

8. Check it for me

Paste your link into VibeCheck. In about 10 seconds it checks the JavaScript your live site sends to visitors for leaked keys (Twilio API keys, OpenAI, Anthropic, Stripe sk_live_, Supabase service_role, SendGrid and more), checks if your public Supabase key can read open tables, and checks security headers, SEO basics and broken links.

It is a public, read-only check of your live app. It never asks for your code, your login or your Twilio account.

Pricing: the problems list is free (just add your email). The $9 fix report gives you a copy-paste fix prompt for every problem found, or get the $29 10-pack (10 fix reports to use any time). No subscription.

No tool can promise your app is 100% secure. VibeCheck catches common, costly mistakes before a stranger does.

9. FAQ

Is it safe to put my Twilio Auth Token in my frontend?

No. Twilio says never to hardcode credentials in client-side JavaScript, and anyone who has your Account SID and Auth Token can make API requests for your account. That means a stranger can send texts or make calls that you pay for. Keep Twilio calls in a server function and store the token as a server-side secret.

Is my Twilio Account SID a secret?

The Account SID (starts with AC) is an ID, not a password. On its own it cannot send messages. But it is half of the login, so if your Auth Token or an API key secret sits next to it in your JavaScript, treat both as leaked.

What is SMS pumping?

Twilio describes SMS pumping as fraudsters using a phone number field (like a sign-up code or "text me a link" form) to send lots of texts to numbers they profit from. Your key can be perfectly hidden and you can still pay for it, so add rate limits, country limits and Twilio's fraud protection to any form that sends a text.

I use Supabase phone login with Twilio. Where does the token go?

In the Supabase dashboard phone provider settings, not in your app code. Supabase sends the texts from its servers. Your frontend only calls Supabase Auth. Still turn on Twilio country limits and keep sign-up rate limits on, because a public phone login form is exactly what SMS pumping targets.

My Twilio key leaked. What do I do?

Twilio says to revoke or rotate it right away in the Twilio Console. For an Auth Token, create a new one before you disable the old one. For an API key, deactivate it and make a replacement. Then check your usage, messaging logs and billing for texts or calls you did not make, and email fraud@twilio.com if you see abuse.

How do I check if my live app leaks a Twilio key?

Paste your live link into VibeCheck for a free scan. It reads the JavaScript your homepage loads and flags Twilio API key IDs (SK plus 32 characters). It cannot reliably spot a bare Auth Token, which is just 32 letters and numbers, so also open DevTools, press Ctrl+Shift+F (Cmd+Option+F on Mac) and search your loaded files for AC, authToken, TWILIO and api.twilio.com.

More questions? See the VibeCheck FAQ. Related guides: How to check if your API key is exposed 路 I leaked my API key. What do I do now? 路 Is NEXT_PUBLIC_ safe for API keys? 路 Is my Resend key safe? 路 Is my OpenAI key safe? 路 Is my Clerk secret key safe? 路 Is my Lovable app safe? 路 Is my Bolt app secure? 路 Is my v0 app secure? 路 Vibe coding security checklist.