Leaked an API key in your Base44 app? What to do
Short answer: revoke the leaked key at the service that issued it (OpenAI, Stripe, Resend and so on). Base44 can't turn it off for you. Then create a new key, save it on your app's Secrets page, call the service from a backend function instead of page code, and publish again so your live app uses the new key.
Home › Guides › Leaked an API key in your Base44 app? What to do · Last updated · By Ember, SniffPup
This page is about one leaked key. For the full Base44 checklist (data permissions, backend functions, app visibility), see Is my Base44 app secure?
Why changing the secret in Base44 isn't enough
The Secrets page decides which key your app uses. It doesn't control the key itself. Anyone who copied the old key can keep using it for as long as the service that issued it accepts it. Base44's own docs say it can't fetch or create keys for other services: you get them from the service (Base44 integrations docs). So the fix starts there.
What to do, step by step
1. Find out which key leaked and where
Note the service (OpenAI, Stripe, Resend and so on) and where the key showed up: page code, a public GitHub repo, a screenshot or a chat. The service decides how you revoke it.
2. Revoke the leaked key at the service
Sign in to the service that issued the key, open its API or developer section, and delete or roll the leaked key. Base44 can't do this for you: only the service can turn a key off.
3. Create a new key and save it in Base44 Secrets
Create a new key at the service. In your app editor, click Dashboard, then Secrets, click the edit icon next to the secret, paste the new value and click Save. If the key isn't a secret yet, click Add Secret instead.
4. Move the call into a backend function
Take the key out of your page code. Call the service from a backend function that reads the key with secrets.get() inside the handler and uses it there. Don't return the key in the function's response.
5. Publish your app again
Your published app can keep the secret values it had when you last published. Publish again so the live app uses the new key.
6. Re-scan and check usage
Run Base44's security scan from Dashboard, then Security. Scan your live URL with SniffPup. Check the service's usage or billing page for activity you don't recognize.
Service-specific steps: OpenAI, Stripe, Resend, Anthropic, OpenRouter. For any other service, start with what to do after leaking an API key.
Base44 Secrets: what the docs say
- Base44 says secrets are encrypted and stored server-side, and the Secrets page hides full saved values. Keep secret values out of frontend code, and don't return a secret from a backend function. Backend functions read them with
secrets.get(), called inside the handler (backend functions docs). - The Secrets page appears in your dashboard once your app uses backend functions.
- You can change a secret's value but not its name. To use a different name, add a new secret and delete the old one.
- Deleting a secret happens straight away, with no confirmation, and can't be undone. In preview, a function that still reads it gets no value, so update that code too. Your published app can keep the old value until you publish again.
- For values of 30 characters or more, the Secrets page shows the first 10 characters. Anyone who can edit your app can see these hints and change or delete secrets, so keep the editor list short.
- Your published app can keep the values it had when you last published. Publish again after any change (Base44 secrets docs).
Base44 personal access tokens, which let your own scripts and tools into your apps, are managed under Personal access tokens on your workspace settings' Secrets page, not your app's. If one leaked, delete it there, then create a replacement.
Run Base44's security scan
Click Dashboard, then Security, then Run Security Scan. Base44 says the scan is on every plan, including free. Its Exposed secrets issues show API keys, passwords or tokens somewhere visitors could reach them. Base44 suggests pasting the issue into the AI chat in Discuss mode for step-by-step help (Base44 security scan docs).
Fix prompt (paste into the Base44 AI chat)
An API key in this app has leaked and I've already revoked it at the provider. Find every place the old key or any other secret key appears in page code or frontend files and remove it. Move each call that needs a secret key into a backend function that reads the key with secrets.get() from base44:runtime inside the handler, using the secret name already on my Secrets page. Don't print any key values. Tell me which pages and functions you changed so I can publish again.Check what your live app sends to visitors
SniffPup scans your published Base44 app the way a stranger would. It's passive and read-only: it sends ordinary requests for public pages and files, the same ones any visitor could load, and you should only scan a URL you own or are allowed to test. It looks for known secret key formats (for example OpenAI, Anthropic, Stripe live, GitHub, Resend and OpenRouter keys, AWS access key IDs and Supabase service_role keys) in your page HTML, inline scripts and the JavaScript files the scan fetches, and shows them masked. It also checks for public /.env and /.git files and source maps. It doesn't read your Base44 Secrets page, test your data permissions or call your backend functions.
A clean report is not a guarantee. It means none of these checks found a key on the pages it read, not that the key is gone everywhere. See what the scanner does and never does. Full fixes free for every critical issue (no critical? one other fix is free).
FAQ
I leaked an API key in my Base44 app. What do I do first?
Revoke the key at the service that issued it, such as OpenAI, Stripe or Resend. Base44 can't turn off a key for another service. Then create a new key, save it on your app's Secrets page (Dashboard, then Secrets), keep it out of page code, and publish your app again so the live version uses it.
Where should API keys live in a Base44 app?
On your app's Secrets page, read by backend functions with secrets.get(). Base44 says secrets are encrypted and stored server-side, and the Secrets page hides full saved values. Keep secret values out of frontend code and out of what a backend function returns. The Secrets page appears once your app uses backend functions. Anyone who receives HTML or frontend JavaScript that contains a key can read it.
Is it enough to change the secret in Base44?
No. Changing the value on the Secrets page only swaps which key your app uses. The leaked key can still be used for as long as the service accepts it. Revoke it there first, then save the new key in Base44 and publish again.
Do I have to publish again after changing a secret?
Yes. Per Base44's docs, backend functions pick up a change right away while you build and preview, but your published app can keep the values it had when you last published. Publish again so the live app uses the new key.
I pasted a key into the Base44 AI chat. Did it leak?
Per Base44's docs, when you paste a key or token it recognizes into the chat, such as one from OpenAI, Anthropic, Stripe, AWS, GitHub, Google or Slack, a Telegram or Discord bot token, or a JSON Web Token, Base44 saves it as a secret and takes it out of the message before the AI reads it. For other credentials, Base44 says to add them on the Secrets page yourself. If you're not sure, rotate the key.
Can SniffPup tell if my Base44 app is leaking a key?
It can check what your published app sends to any visitor. The free scan looks for known secret key formats, such as OpenAI, Anthropic, Stripe live, GitHub, Resend and OpenRouter keys, AWS access key IDs and Supabase service_role keys, in your page HTML, inline scripts and the JavaScript files the scan fetches, and shows them masked. It also checks for public .env and .git files and source maps. It doesn't read your Base44 Secrets page, test your data permissions or call your backend functions, and a clean scan can't prove a key is gone everywhere.