IntentiAI

Secret setting sent to the browser

A secret-looking setting given a browser prefix (NEXT_PUBLIC_, VITE_...), or a secret read in client code.

Check secret-exposedShip Check

Why it matters

Frameworks copy every setting whose name starts with NEXT_PUBLIC_, VITE_, EXPO_PUBLIC_, REACT_APP_ or PUBLIC_ into the JavaScript bundle. When a call fails in the browser because the key is missing, the quickest fix an agent finds is to add the prefix, and the call starts working.

From then on the key is in every page. Anyone can open the browser's developer tools, copy it, and use your AI, email or payment account as you.

Example

 # .env.example
-OPENAI_API_KEY=
+NEXT_PUBLIC_OPENAI_API_KEY=

What it detects

  • A setting name added with a browser prefix whose rest looks secret: SECRET, PRIVATE, PASSWORD, SERVICE_ROLE, a database URL, an access or auth token, or an AI, email or payment provider's API key.
  • process.env or import.meta.env reading such a setting in a file marked "use client" or under a client folder (Fix soon: it leaks or is empty, depending on the build).
  • Publishable keys, anon keys, public keys and site addresses are meant for browsers and are not reported.

What to do when it fires

Drop the browser prefix, read the key only in server code (a route handler or server action), and have the page call that. Then replace the key at the provider: any build that shipped already published it.

Secret setting sent to the browser: AI code review check | IntentiAI