# Find secret keys that reach the browser

> An API key sits in frontend code where anyone can open the browser tools and copy it.

Web page: https://buildladder.com/resources/prompts/secrets-in-browser

What you get: The built site searched for secrets, each one moved to the server, and a list of keys to replace.

Paste it into: Your AI tool, in your project

## Prompt to copy

```text
Check whether any secret in this project reaches the browser.

Build the project for production and search the files that get sent to visitors for keys, tokens and passwords, including anything read through a public prefix such as NEXT_PUBLIC_ or VITE_. Also search the source and the git history for secrets written directly in code. Don't print full values. Show the first four characters and where you found each one.

Sort what you find into two lists: meant to be public (say why that's safe), and secret. For every secret, move the call that uses it to the server and tell me to replace that key, because once it has been public it has to be treated as stolen. If you find none, say so.
```
