Terms & acceptable use
馃 Free Claude key check

Added a Claude chatbot or AI feature? Make sure your sk-ant- key 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 路 Anthropic keys 路 Updated

Is My Anthropic API Key Safe in My Frontend? Keep sk-ant- Claude Keys Out of Your Lovable, Bolt, v0 and Cursor App

Every Claude API call costs money. If your Anthropic key is in browser code, anyone can copy it and use Claude on your bill. Here is what Anthropic says, how vibe-coded apps leak these keys, the warning signs to look for, where the key should live, what to do if it leaked, and how to check your live app.

1. The rule: Claude keys never go in the browser

Anthropic has no public key that is safe to show. Every key that starts with sk-ant- is secret.

  • Anthropic says: your API key is like a credit card number. If someone gets it and uses it, the charges land on your account.
  • Store it as a secret: when you use a hosting tool or platform, add the key as an encrypted secret. Never put it right in your code or config files.
  • Use one key per app and per stage (testing and live). If one leaks, you only switch off that one.
  • The SDK agrees: Anthropic's TypeScript SDK will not run in a browser unless you force it, because that "risks exposing your secret API credentials to attackers".

Sources: Anthropic: API key best practices 路 Anthropic TypeScript SDK

2. How vibe-coded apps leak sk-ant- keys

  1. You paste the key into the chat and the AI writes it straight into a file.
  2. The AI calls Claude from a React component to get a chatbot working fast. That puts the key in the JavaScript every visitor downloads.
  3. The key goes in a public env var like VITE_ANTHROPIC_API_KEY or NEXT_PUBLIC_ANTHROPIC_API_KEY. Those prefixes copy the value into browser code. See which env vars end up in the browser.
  4. The AI hits a CORS error and "fixes" it by turning on browser access in the SDK. The error goes away, and your key is now public.

The chatbot works, so nothing looks wrong. The bill shows up later.

3. Warning signs (including the "dangerous" header)

Calling Claude from the browser is blocked by default. To make it work, code has to opt in. Anthropic's SDK has an option called dangerouslyAllowBrowser. When it is set to true, the SDK sends a header called anthropic-dangerous-direct-browser-access. The word "dangerous" is there on purpose.

If you find this in your live JavaScriptWhat it meansWhat to do
sk-ant-An Anthropic API key itselfLeak. Delete the key now
VITE_ANTHROPIC_API_KEY or NEXT_PUBLIC_ANTHROPIC_API_KEYA public env var. The value is copied into browser codeLeak. Rename to ANTHROPIC_API_KEY and move the call to the server
dangerouslyAllowBrowser: trueThe Anthropic SDK was told to run in the browserWarning sign. Usually means your key is in the page
anthropic-dangerous-direct-browser-accessThe header that lets the browser call Claude directlyWarning sign. Same as above
A request from the browser to api.anthropic.comYour page talks to Claude without your server in the middleWarning sign. It should go to your own server route

There is one fair use for browser access: a "bring your own key" tool, where each user types in their own key and it never leaves their browser. If the key in the page is yours, it is a leak.

Source: Anthropic TypeScript SDK (browser support and dangerouslyAllowBrowser)

4. Where the key should live (Lovable, Bolt, v0, Cursor)

  • Lovable: you may not need your own key at all. Lovable's built-in AI connector offers Claude models in newer apps and runs AI calls through a backend function it creates, so the key never reaches the browser. To use your own Anthropic key, Lovable says to call Claude from a backend edge function with the key saved in Secrets. Do not put it in .env: Lovable says VITE_ values there are built into the browser bundle, and that file is committed to your repo.
  • Bolt and other Supabase apps: make the Claude call in a Supabase Edge Function. Save the key in the Dashboard under Edge Function Secrets, or run supabase secrets set ANTHROPIC_API_KEY=.... Read it in the function with Deno.env.get('ANTHROPIC_API_KEY').
  • v0, Cursor and other Next.js apps: call Claude only from a Route Handler (like app/api/chat/route.ts) or a Server Action. Use an env var without NEXT_PUBLIC_, like ANTHROPIC_API_KEY.
  • Any host: keep keys out of git and use your host's secrets. Your browser code should only ever talk to your own server route, never to api.anthropic.com.

Hidden key, open door. Moving the key to the server is step one. If your server route takes any prompt from anyone, a stranger can skip your app and call that route directly. Require sign-in on the server, limit each user to a fair number of requests, and set the model and max_tokens on the server so the browser cannot pick an expensive setup.

VibeCheck does not call or test your API routes or edge functions. Check this part by hand, or use the third prompt below.

Sources: Lovable: AI features for your app 路 Lovable: Secrets vs. VITE_ variables 路 Supabase: Edge Function secrets 路 Anthropic: Handle keys with secrets

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 HTML and the JavaScript files it loads and flags any sk-ant- key as critical. It masks the key it finds. It looks for the key itself, not the header, so do step 2 as well.
  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 sk-ant-, anthropic-dangerous-direct-browser-access, dangerouslyAllowBrowser and api.anthropic.com.
  3. Use your chatbot once. In the Network tab, look at the request. If it goes straight to api.anthropic.com from the browser with an x-api-key header, your key is in the browser too. It should go to your own server route or edge function instead.

6. Found a key? Delete it and set a spend limit

  1. Delete the key now. Log in to the Claude Console, open the API keys page (platform.claude.com/settings/keys), click the three dots next to the key and choose Delete API key.
  2. Make a new key and save it only as a server secret (section 4). Never paste it into chat, code or a VITE_ or NEXT_PUBLIC_ variable.
  3. Check for abuse. Look at the Logs page (platform.claude.com/logs) and the Usage page (platform.claude.com/usage) for calls you did not make.
  4. Set a spend limit. On the Billing page (platform.claude.com/settings/billing), set your own monthly spend limit below your tier's cap. When you hit it, API calls stop until you raise it or the month resets. You can also give your app's key its own workspace with its own spend limit (not possible on the default workspace). If you use auto-reload, keep the reload amount small.
  5. Move the Claude call to the server, redeploy, and scan your live site again to confirm the key is gone.

Good to know: Anthropic works with GitHub secret scanning. If a Claude key shows up in a public GitHub repo, Anthropic switches it off and emails you. That only covers public GitHub repos. A key in your live website's JavaScript is your job to find.

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

Sources: Anthropic: If your key is compromised, monitoring, GitHub partnership 路 Claude docs: Spend limits and workspace limits

7. Copy-paste fix prompts

Paste the matching prompt into Lovable, Bolt, v0, Replit or Cursor. After you deploy, delete any Anthropic key that was ever in client code and make a new one.

Lovable or Bolt: move Claude into a Supabase Edge Function
Search this whole project for sk-ant-, ANTHROPIC, anthropic, api.anthropic.com, dangerouslyAllowBrowser and anthropic-dangerous-direct-browser-access. Remove every Anthropic API key from frontend code and from any VITE_ variable or .env file. Create a Supabase Edge Function called claude-chat that reads the key with Deno.env.get('ANTHROPIC_API_KEY'), calls the Claude Messages API, and returns only the reply text. Make the frontend call that edge function instead of Anthropic. Ask me to add ANTHROPIC_API_KEY as a secret, never write it in code. List every place you removed a key from so I can delete that key in the Claude Console.
v0 or Cursor (Next.js): move Claude into a server route
Find every place this app calls Anthropic or Claude from a client component or uses NEXT_PUBLIC_ANTHROPIC_API_KEY, dangerouslyAllowBrowser or the anthropic-dangerous-direct-browser-access header. Move all Claude calls into a Route Handler at app/api/chat/route.ts (or a Server Action) that reads process.env.ANTHROPIC_API_KEY, with no NEXT_PUBLIC_ prefix. Add import 'server-only' to the file that creates the Anthropic client. The browser should only call /api/chat. List every key you removed so I can delete it in the Claude Console.
Lock down my Claude endpoint
Update the server route or edge function that calls Claude so strangers cannot use it on my bill: require a signed-in user and check their session on the server, allow at most 20 requests per user per hour and return 429 after that, set the model, system prompt and max_tokens on the server (never take them from the browser), cap the length of the user message, and log the user ID for each request. Show me the changed code.

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 (Anthropic sk-ant-, OpenAI, Stripe sk_live_, Supabase service_role 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 Anthropic account, and it never uses any key it finds.

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 Anthropic API key in my frontend?

No. Anthropic says to treat your API key like a credit card number: whoever has it can make Claude API calls that you pay for. Anything in your frontend is sent to every visitor, so a key there is public. Call Claude from a server route or a Supabase Edge Function and store the key as a server-side secret.

What does the anthropic-dangerous-direct-browser-access header mean?

It is the header that lets a web page call the Claude API straight from the browser. Anthropic's TypeScript SDK blocks browser use by default because it risks exposing your secret API credentials, and adds this header only when you set dangerouslyAllowBrowser: true. If you see either one in your live app's JavaScript next to your own key, your key is in the browser.

Is VITE_ANTHROPIC_API_KEY or NEXT_PUBLIC_ANTHROPIC_API_KEY safe?

No. Anything that starts with VITE_ or NEXT_PUBLIC_ is copied into the JavaScript the browser downloads. Lovable says VITE_ values are embedded into the client bundle and keeps them in a .env file that is committed to your repo. Use a plain server-only name like ANTHROPIC_API_KEY and read it only in server code.

Do I need my own Claude API key in Lovable?

Often not. Lovable's built-in AI connector offers Claude models in newer apps and runs AI calls through a backend function it creates, so no key reaches the browser. If you want to use your own Anthropic key, Lovable says to call the provider from a backend edge function with your key stored as a secret.

My sk-ant- key leaked. What do I do?

Delete it now. In the Claude Console, open the API keys page, click the three dots next to the key and choose Delete API key. Make a new key, save it only as a server secret, and redeploy. Then check the Logs and Usage pages for calls you did not make, and set a spend limit on the Billing page.

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

Paste your live link into VibeCheck for a free scan. It reads your homepage and the JavaScript files it loads and flags sk-ant- keys as critical. You can also open DevTools, press Ctrl+Shift+F (Cmd+Option+F on Mac) and search your loaded files for sk-ant-, api.anthropic.com and anthropic-dangerous-direct-browser-access.

More questions? See the VibeCheck FAQ. Related guides: Is my OpenAI key safe in my frontend? 路 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? 路 Supabase anon vs service_role key 路 Is my Lovable app safe? 路 Is my Bolt app secure? 路 Is my v0 app secure? 路 Is my Cursor app secure? 路 Vibe coding security checklist.