# Check every page and API route is protected

> Pages are hidden in the menu, but anyone with the URL can still call them.

Web page: https://buildladder.com/resources/prompts/protect-routes

What you get: A table of every route that touches user data, who may use it, and where that is enforced.

Paste it into: Your AI tool, in your project

## Prompt to copy

```text
Audit who can reach what in this project.

List everything that reads or writes user data or secrets: pages, API routes, server actions, scheduled jobs, and any database call made straight from the browser. Skip plain content pages. For each, say who should be allowed (anyone, any signed-in user, the owner of the data, an admin, or a job with a secret) and point to what enforces it on the server or in the database rules. Hiding a button or redirecting in the browser doesn't count.

Give me a table: route, who's allowed, the file and line of the check, and OK or problem. Flag checks that are missing, happen only in the browser, or trust an ID or role sent by the client. If everything holds, say so. Don't invent findings.

Show me the table and wait for my OK before changing any sign-in or permission code. After a fix, prove it with requests made as a signed-out visitor and as the wrong user, on a local or test setup with throwaway accounts. Never test against production, and never send a request that emails or deletes.
```
