Exposure Medium
Revoke the exposed Replicate API token
A Replicate API token (r8_...) lets whoever holds it run models billed to the account, including long, expensive ones, and read the predictions the account made. In a browser bundle it is available to anyone who loads the page.
Find out whether your site has this problem, and every other check, in one free scan.
Check your site freeWhy it matters
A Replicate API token lets whoever copies it run models billed to the business's account, including long and costly ones, and read the predictions it made.
How to fix
- 1 Revoke the token in Replicate (Account > API tokens) and create a new one. Revoking is the only step that stops the copied token from working.
- 2 Move every call to Replicate behind an endpoint on your own server that holds the new token, checks who is asking and limits how often.
- 3 Purge the old token from git history so it is not recoverable from a prior commit.
- 4 Redeploy and confirm the shipped bundle has no r8_ token in it.
Common mistakes
- Putting the key in a build-time environment variable and assuming that keeps it private: a bundler that inlines it (NEXT_PUBLIC_, VITE_, PUBLIC_) ships it to every visitor.
- Removing the key from the current build without revoking it: copies in git history, old deploys and CDN caches keep working until it is revoked.
- Creating the replacement token and calling Replicate from the same browser code, so the new token ships too.
How to verify
- 1 Re-run the scan and confirm the Replicate token finding is gone.
- 2 Search the deployed JavaScript for r8_ to confirm no token remains.
- 3 Check recent predictions and billing in Replicate for runs you did not start.
Related checks
Ready to see where you stand?
Scan your site and get your Engineering Score with a prioritized roadmap in under a minute, no signup required.
