Drop your app folder (or paste the file that creates the AI client) to find AI API keys that reach the browser.
Run the check
Drop a project folder or files here
node_modules, .git, virtualenvs and build folders are skipped. Limit 25 MB / 5,000 files.
The Python engine (Pyodide, a few MB, cached by your browser) loads when you start.
The mistake
Creating an AI SDK client in browser code (new OpenAI({ dangerouslyAllowBrowser: true }), new GoogleGenAI(...) in a client component) or calling api.openai.com / api.anthropic.com with an Authorization header from client code. These all need the API key in the browser, usually through VITE_OPENAI_API_KEY or NEXT_PUBLIC_OPENAI_API_KEY.
Why it is dangerous
Anyone can read the key from the network tab and use your account. You also cannot rate-limit or authenticate who spends your tokens. Values read through process.env.NEXT_PUBLIC_* or import.meta.env.VITE_* are replaced with the literal value at build time, so the key itself ships in the bundle.
How to fix it
Remove the API key and the SDK client from browser code (drop dangerouslyAllowBrowser). If the key was ever deployed, rotate it.
Keep the key in a server-only variable (no public prefix) and proxy the request through your own endpoint that checks the user and rate-limits.
What this checker looks for
This page runs key-leak-check, which reads
.env files, frontend source and build output (dist/, build/, .next/static). The rules most relevant to this page:
Rule
What it finds
KLC003
AI API called directly from the browser
KLC002
Client code reads a secret through a public env var
KLC001
Secret in a browser-exposed env var
KLC005
API key inside built JavaScript bundle
Every finding has a rule id, a severity, file:line, the offending line (secrets masked),
why it matters and how to fix it. Run key-leak-check rules for the full list.
FAQ
Is dangerouslyAllowBrowser ever OK?
Only when the key is the user's own (they paste it in, it is not yours). With your key, the checker reports it (KLC003) because anyone can copy the key from the network tab.
Which AI providers are covered?
OpenAI, Anthropic and Google Gemini SDKs created in browser code, and direct fetch calls to their APIs with an Authorization header, plus secret keys in public env vars for many other providers.
Are my files uploaded anywhere?
No. The checker is Python running inside your browser tab (Pyodide, WebAssembly). Your files are read with the browser's File API and written into an in-memory file system that exists only in this tab. Your files are never sent anywhere. The only network requests load the Python runtime and the checker code, plus Google Analytics page-view counting, which never sees your files. You can disconnect from the internet after the engine has loaded and the scan still works.
Is a clean report a guarantee?
No. It is a static check for known patterns, not a penetration test. A clean report means none of these patterns were found, nothing more.
Can I run the same check on my machine or in CI?
Yes. Every checker on this site is an open-source command-line tool (MIT licence, Python 3.10+ standard library only). The results here are the same as `scan --json` on the command line, except for checks that need git (whether a file is committed or ignored), which cannot run in a browser.