Group
  • Security

    Lock down my admin routes and features

    Verifies admin pages, endpoints, and seeded admin accounts are protected by role checks and not default credentials.

    • Improve quality
    • Debug & fix
    • Intermediate
    • General

Free Prompt

Audit everything admin-related in my app: admin pages, admin API endpoints, impersonation features, seeded or default admin accounts, and any backdoor-style access (special query params, hardcoded emails that skip checks). Verify: every admin endpoint enforces a server-side role check (not just a hidden link in the UI); the role itself can't be modified through any user-facing endpoint; no default or seeded admin credentials exist in production code or fixtures (check for classics like [email protected] with a known password); no debug endpoints are reachable in production (routes like /debug, /test, /api/dev that bypass auth); and admin actions that matter (refunds, user deletion, role changes) are logged with who did them. Do not remove the admin functionality; just gate it properly. If seed data needs an admin for local development, make it explicit that it only applies to development environments. Deliver a list of every admin surface, its protection before and after, any backdoors found and removed, and a verification pass: a non-admin account that gets refused at each admin endpoint, and confirmation no default credentials work.

What This Does / How This Helps

Inventories every admin surface in your app and makes sure each one is gated by a real server-side role check, with seeded credentials and debug backdoors hunted down. AI-generated apps love convenience backdoors: a hardcoded email that skips the login check, a seeded admin with password "admin123", a /debug route that dumps the database. These get written to make development easy and ship to production because nobody went looking for them. You also get audit logging on the actions that matter, so if an admin account ever is compromised, you can see exactly what it did.

Want to skip doing this by hand?

Fortivibe audits your app for all of the areas these prompts cover (and more).

See What We Check

Related Prompts