Skip to contentLockpick
How it worksPricingDocs

Read

  • BlogPlain answers to common security questions
  • GuidesStep by step fixes for common setups
  • Security checksEvery check we run, explained

Learn

  • Learn with PickTwo-minute lessons on how sites get attacked
  • Lockpick for ClaudeCheck sites from Claude and other assistants
  • GlossaryThe words we use, in plain words

Company

  • ChangelogWhat changed, newest first
  • StatusWhether scans are running right now
  • Security and trustHow we check and what we never do
Sign inCheck it
Checks

Is a private API key sitting in your site code?

By Mark KashefPublished October 8, 2026

The secret key check reads the pages, scripts and source maps anyone can download for text shaped like a private key for a known service, such as an AI, payments or email provider. The key is never tried.

What does this check look at?

It looks at whether pages, scripts or source maps anyone can download hold text shaped like a private key for a known service. Your website's code runs in the visitor's browser, so the visitor's browser has to download it. Anyone can open it and read it.

Not every key in browser code is a secret. Some keys are meant to be public, like a payments form key that can only start a checkout, and a Supabase anon key only reaches what Row Level Security allows.

Pulse and Deep scans both run it.

Curious what your site shows from outside? The quick check is free and needs no account.

Check it

What does a result mean?

What the report showsWhat it meansWhat to do
High findingA private key pattern for a known service was found in public content.Rotate the key with its provider today, then move it to the server.
No findingNo private key pattern matched in what was read.Keep keys in server settings.

The key is never tried, so the scan cannot tell whether it is live or what it reaches. A key built to be public, like a Supabase anon key, is not a secret. The matched value is never stored, so the evidence names the file and the kind of key, not the key itself. A clean result means nothing was found in what the scan read. It does not prove the problem is absent from parts the scan never sees.

How serious is a finding?

Fix this first when it is confirmed. Anyone could use a finding of this kind on their own, with no victim and no second step. Confidence starts at medium, because it rests on a pattern in your content. The report lists what to fix by how directly someone could use it, not by the severity label. Replacing the key matters more than deleting it from your code. Deleting only stops new copies.

What does a confirmed finding have to show?

PartFor this check
Where it startsA credential-shaped string in a public page, script or source map
The protection that should stop itNothing should be readable without signing in; the value was never used or tested
What is reachedAnyone who loads the file can copy it
What followsWhatever the credential unlocks at its provider

Which standards does it relate to?

StandardReference
OWASP Top TenA02:2025 Security Misconfiguration
CWECWE-798
CWECWE-540

Each one is a related control, not a verification. A scan sees what anyone online can see, so it never proves a whole requirement is met.

Fix it with your AI

Rotate first, then fix the code, so the old key stops working even if someone already copied it.

Fix prompt for any coding agent
My site exposes a private key in browser code: [paste the key type and file from the report]. First tell me how to revoke this key and create a new one with its provider. Then move every call that uses it into a server-side route or function, so the browser calls my server and only my server holds the key in an environment variable without a public prefix (no NEXT_PUBLIC_ or VITE_). Show me the changes and check no other private key is left in client code.

After you deploy, check the provider activity log for use you do not recognise.

How to check

Say Atlas, our example app at atlas.example, calls an AI provider straight from the browser with a secret key in its bundle. The check names the script and the provider, and the fix moves the call behind an Atlas server route.

The free quick check covers this on your homepage with no account, and a Pulse scan from your account adds your scripts and public records. Pulse or Deep explains the difference.

Questions people ask

Did Lockpick use my key to check it?

No. Keys are never tried. The check matches the shape of keys a provider issues, so it cannot say whether yours is live.

Is my Supabase anon key a leaked secret?

No. It is built to be public and only reaches what row-level security allows. A service role or secret key in browser code is a real leak.

See what your site shows from outside

A quick check reads your homepage the way a visitor would and gives you a score. No account needed.

Check your site

Related pages

  • API keys in your JavaScript bundle, how they get there and what to do
  • Your OpenAI or Anthropic key is in the browser. Now what?
  • Can anyone download readable source code for your site?
  • Can anyone read your Supabase tables with the public anon key?

Sources

  1. A secret key in your website's code Lockpick docs, read on October 7, 2026
  2. API keys Supabase docs, read on October 6, 2026
  3. How we rate findings Lockpick docs, read on October 7, 2026

About the author

Mark Kashef, Founder of Lockpick

I'm Mark, and I build Lockpick. I write these pages, and each one is checked against its sources before it goes live. The Updated date changes only when the page itself does.

Lockpick
PricingMethodologyDocsBlogGuidesSecurity checksLearn with PickSecurity and trustLockpick for ClaudeChangelogStatusFacts for AI assistants

Lockpick is a security scanner for vibe-coded apps. It checks what your live site exposes and what a GitHub repo or AI skill would do before you install it, then gives you a fix prompt for Lovable, Bolt, Replit, Cursor or Claude Code.

Lockpick assesses public pages you are authorized to test, and public GitHub code it never runs.

© 2026 LockpickTermsPrivacyContactSign in