Getting started

Security review of your user management

One prompt for the AI coding tool you already use. It finds the security gaps in how your app handles accounts, sign-in, and permissions, shows which of those gaps secureFlows closes and how, and writes the full migration plan. Nothing in your code changes, and you need no secureFlows account to run it.

How it works

Open your project in an AI coding tool that can read the code (Claude Code, Cursor, Codex, or similar) and paste the prompt. The review runs in three steps and saves its results as Markdown files in your project root, so you can read and share them.

Step What you get Saved as
1 — Find the gaps How accounts work in your app today, and a table of security gaps with severity and the file each one was found in USER_MANAGEMENT_SECURITY_REVIEW.md
2 — Can secureFlows solve them? The same table with two more columns: whether secureFlows solves each gap, and how Added to the same file
3 — Migration plan Target architecture, gap-by-gap remediation, open questions, and ordered migration steps SECUREFLOWS_MIGRATION_PLAN.md

Run the full review

One prompt that runs all three steps in order and saves both files.

Full review
Paste as-is. There is nothing to fill in.
Run a security review of how this project manages user accounts, then check which of the gaps secureFlows (https://www.secure-flows.com) would close and write a migration plan. secureFlows is a hosted login with encrypted per-user storage. Work through the three parts below in order, without stopping between them. This is a review and a plan only: do not change any code.

PART 1: FIND THE GAPS

Finish this part before you read anything about secureFlows, so the gap list is not shaped by it.

Inspect the code, configuration, and database schema and work out:
- every account type (for example end user, admin, partner, service account) and where its records live
- how each type signs up, signs in, stays signed in, and signs out: identity provider, passwords, social login, tokens, cookies, refresh, password reset
- how the backend decides who the caller is and what they may do: middleware, role checks, ownership checks, row-level rules
- where secrets, tokens, and credentials are kept, on the server and in every client

Save the result as USER_MANAGEMENT_SECURITY_REVIEW.md in the project root, with these sections:

1. Architecture: the identity and data layers, and how a signed-in identity is linked to its stored records.
2. Account types: a table with the columns Account type | Identity provider | Stored records | Role and permissions.
3. Sign-in flows: numbered steps for each account type.
4. Controls already in place: what is done correctly today.
5. Security gaps: a table with exactly these columns, ordered by severity:
   # | Gap | Severity (High / Medium / Low) | Category | Evidence (file and line) | What an attacker could do
   Use these categories: Authentication, Authorization, Token lifecycle, Client storage, Identity trust, Data isolation, Configuration and secrets, Abuse prevention, Audit and monitoring.
6. Needs verification: anything you suspect but could not confirm in the code.
7. Source files: the files the review is based on.

Rules for Part 1:
- Report only what you can point to in the code. Every row in the Security gaps table needs a file reference; a suspicion without one goes under "Needs verification".
- Check at least the following: routes with no authentication or no role check; one user reaching another user's records by changing an id; identity taken from the request body instead of a verified token; tokens that never expire; unfinished refresh or password-reset flows; tokens kept in localStorage; default or hard-coded secrets; development shortcuts that are reachable in production (fixed codes, bypass flags, default admin accounts); suspended or deleted accounts that can still sign in; missing rate limits on sign-in and other sensitive endpoints; admin actions with no audit trail.
- Never print a secret value. Name the file and the variable only.

PART 2: CAN SECUREFLOWS SOLVE THEM?

Take what secureFlows can and cannot do from its public documentation, not from memory:
- overview: https://www.secure-flows.com/llms.txt
- authentication and authorization model: https://www.secure-flows.com/docs/technical/authentication-authorization/
- built-in roles, invites, admin console, audit logs: https://www.secure-flows.com/docs/differentiation/
- moving an app that already has its own backend: https://www.secure-flows.com/docs/introduction/from-existing-backend/
- search for anything else: https://www.secure-flows.com/api/v1/docs/search?q=<your question>&limit=8
If you cannot open these pages, say so, stop after Part 1, and reply in chat with the Security gaps table.

Reproduce the Security gaps table with every existing row and column unchanged, and add two columns:

- Can secureFlows solve this? Use exactly one of:
  Yes: a documented secureFlows feature replaces the vulnerable code or behavior, so the gap can no longer exist.
  Partly: secureFlows closes part of the gap. Either it supplies the verified identity or the mechanism and a check still has to be written in my code, or it protects the endpoints that move to it and leaves the ones that stay in my backend.
  No: unrelated to what secureFlows does. It has to be fixed in my app either way.
  Unconfirmed: the documentation does not say. Ask secureFlows before relying on it.
- How: one to three short sentences. For Yes, say what replaces the vulnerable code. For Partly and No, say what still has to be done and where.

Rules for Part 2:
- Be strict. Answer Yes only when a documentation page describes what replaces the vulnerable code or behavior, and name that page in the How column. If the documentation does not describe the replacement, answer Unconfirmed.
- Deleting code is not a solution. If secureFlows does not offer what the vulnerable code did (a sign-in method, a kind of role, a kind of data), the answer is No or Unconfirmed, because the app would lose that function. A gap counts as closed only when the function survives.
- If two documentation pages contradict each other about something a row depends on, say so in How, answer Unconfirmed, and add it to Questions for secureFlows.
- Permission rules that belong to my product (which of my roles may call which of my routes, who owns which record in my database, whether an account is suspended) are Partly at best: secureFlows proves who the caller is, and my backend still has to enforce the rule.
- Before answering No, check which endpoints the gap is about. Sign-in, session renewal, sign-out, and reads and writes of per-user data move to secureFlows, so a platform protection it documents for its own API (rate limiting, audit and access logs, encryption at rest) covers those endpoints. If the gap also covers routes that stay in my backend, answer Partly and name the routes that are still mine.
- Anything that needs shared, relational, or cross-user data stays in my own database. Do not propose moving it to secureFlows.
- If the documentation is silent, answer Unconfirmed. Do not guess.

Under the table, add:
- Score: one line counting the Yes, Partly, No, and Unconfirmed rows, in total and for the High severity rows.
- What stays in my backend: the checks and data that remain my responsibility after adopting secureFlows.
- Questions for secureFlows: each Unconfirmed row as a question I can send to them.

Append all of this to USER_MANAGEMENT_SECURITY_REVIEW.md as a new section titled "secureFlows fit".

PART 3: THE MIGRATION PLAN

Write a full plan for moving this project's identity and session layer to secureFlows, based on Parts 1 and 2 and the same documentation. Save it as SECUREFLOWS_MIGRATION_PLAN.md in the project root, with these sections:

1. Summary and recommendation: what to adopt secureFlows for, what to leave where it is, which gaps close as soon as the migration is done, and which do not.
2. Current state: today's architecture in a short table, and the gap list with severity and category.
3. What secureFlows provides, and what it is not: only what the documentation supports.
4. Fit assessment: a table with one row for every account type and every kind of data in this project, with the columns Item | Good fit / Partial fit / Poor fit | Reason. Private data owned by one user fits. Shared, relational, or cross-user data does not, and stays in my database.
5. Target architecture: a before and after table covering who the user is, which token my API trusts, where clients keep the token, how a session is renewed, how an identity is linked to my database rows, where business data lives, and where role checks run. Propose the workspace and applications to register, with a redirect URL for each. If the hosts are not in the project, use placeholders such as https://<your-host>/callback and mark them as assumptions in section 7.
6. Gap-by-gap remediation: every gap from the review, marked Yes / Partly / No / Unconfirmed exactly as in the "secureFlows fit" section, with what changes in the code.
7. Open questions: every assumption and every Unconfirmed item, each with a fallback if the answer is no.
8. Migration steps, in order, each small enough to ship and verify by itself:
   a. Provision the workspace and applications.
   b. Classify the data: keep forever (moves to secureFlows), only needed while using the app (stays local), not owned by one user (stays in my database).
   c. List every backend action that requires sign-in today and how each one will check a verified secureFlows session instead. None may be dropped: each one either stays a backend route that checks a verified secureFlows session, or is listed as moved, with where its check now lives.
   d. Implementation order, starting with the account type that carries the least risk.
   e. Linking existing accounts once, on first sign-in, with the old system kept read-only as a fallback until every active user has moved.
   f. A verification checklist that has to pass before the old sign-in code is removed: one user cannot read another user's data, each role is rejected on the other roles' routes, suspended accounts stay blocked, and sign-out really ends the session.
   g. How to roll back if a step fails.
9. Fixes that do not depend on secureFlows, and interim fixes: every No row with the fix, plus any High severity gap that is exploitable today and should be fixed before or alongside the migration instead of waiting for it, even if secureFlows would close it later.
10. Effort: a rough size (S / M / L) for each step. Do not invent dates.

Rules for Part 3:
- Mark each statement about secureFlows that the documentation does not support as an assumption, and list it in section 7.
- An authorization check is moved to the new identity, never deleted.
- Write for an engineer on my team who has not read this conversation.

WHEN YOU ARE DONE

Name the two files you saved, then reply in chat with the Security gaps table including the two secureFlows columns, the score line, and the open questions from the plan.

Or run it as a command in Claude Code

Install the secureFlows plugin once, and the same review is a command with nothing to copy. In Claude Code, run these two lines:

/plugin marketplace add michal-lefler/secureflows-mcp
/plugin install secureflows@secureflows-marketplace

Then, in any project:

/secureflows:security-review

Using another tool that is connected to the secureFlows MCP server? The same review is available there as the security-review prompt.

Step by step

Prefer to read each result before going on? Paste these three prompts in order, in the same conversation. Prompt 1 is a plain security review and does not mention secureFlows. It is useful on its own, whatever you decide afterwards.

Prompt 1 — find the gaps

Read-only. The tool inspects your code, configuration, and database schema, and reports only what it can point to in a file.

Prompt 1
Paste as-is. There is nothing to fill in.
Review how this project manages user accounts and report the security gaps. This is a read-only review: do not change any code.

Inspect the code, configuration, and database schema and work out:
- every account type (for example end user, admin, partner, service account) and where its records live
- how each type signs up, signs in, stays signed in, and signs out: identity provider, passwords, social login, tokens, cookies, refresh, password reset
- how the backend decides who the caller is and what they may do: middleware, role checks, ownership checks, row-level rules
- where secrets, tokens, and credentials are kept, on the server and in every client

Save the result as USER_MANAGEMENT_SECURITY_REVIEW.md in the project root, with these sections:

1. Architecture: the identity and data layers, and how a signed-in identity is linked to its stored records.
2. Account types: a table with the columns Account type | Identity provider | Stored records | Role and permissions.
3. Sign-in flows: numbered steps for each account type.
4. Controls already in place: what is done correctly today.
5. Security gaps: a table with exactly these columns, ordered by severity:
   # | Gap | Severity (High / Medium / Low) | Category | Evidence (file and line) | What an attacker could do
   Use these categories: Authentication, Authorization, Token lifecycle, Client storage, Identity trust, Data isolation, Configuration and secrets, Abuse prevention, Audit and monitoring.
6. Needs verification: anything you suspect but could not confirm in the code.
7. Source files: the files the review is based on.

Rules:
- Report only what you can point to in the code. Every row in the Security gaps table needs a file reference; a suspicion without one goes under "Needs verification".
- Check at least the following: routes with no authentication or no role check; one user reaching another user's records by changing an id; identity taken from the request body instead of a verified token; tokens that never expire; unfinished refresh or password-reset flows; tokens kept in localStorage; default or hard-coded secrets; development shortcuts that are reachable in production (fixed codes, bypass flags, default admin accounts); suspended or deleted accounts that can still sign in; missing rate limits on sign-in and other sensitive endpoints; admin actions with no audit trail.
- Never print a secret value. Name the file and the variable only.

When the file is saved, reply in chat with the Security gaps table and nothing else.

No code access? Paste a description of your sign-in and permissions design instead and ask the tool to work from that. The result is only as good as the description, and it cannot cite files.

Prompt 2 — can secureFlows solve them?

The tool reads the public secureFlows documentation and grades every gap. It is told to be strict: secureFlows replaces the identity and session layer and gives each user private storage, and it does not write your product's own permission rules for you.

Prompt 2
Paste as-is, after Prompt 1 has saved its file.
Read USER_MANAGEMENT_SECURITY_REVIEW.md in this project. I am evaluating secureFlows (https://www.secure-flows.com), a hosted login with encrypted per-user storage, as a way to close these gaps. This is an evaluation only: do not change any code.

Take what secureFlows can and cannot do from its public documentation, not from memory:
- overview: https://www.secure-flows.com/llms.txt
- authentication and authorization model: https://www.secure-flows.com/docs/technical/authentication-authorization/
- built-in roles, invites, admin console, audit logs: https://www.secure-flows.com/docs/differentiation/
- moving an app that already has its own backend: https://www.secure-flows.com/docs/introduction/from-existing-backend/
- search for anything else: https://www.secure-flows.com/api/v1/docs/search?q=<your question>&limit=8
If you cannot open these pages, say so and stop.

Reproduce the Security gaps table with every existing row and column unchanged, and add two columns:

- Can secureFlows solve this? Use exactly one of:
  Yes: a documented secureFlows feature replaces the vulnerable code or behavior, so the gap can no longer exist.
  Partly: secureFlows closes part of the gap. Either it supplies the verified identity or the mechanism and a check still has to be written in my code, or it protects the endpoints that move to it and leaves the ones that stay in my backend.
  No: unrelated to what secureFlows does. It has to be fixed in my app either way.
  Unconfirmed: the documentation does not say. Ask secureFlows before relying on it.
- How: one to three short sentences. For Yes, say what replaces the vulnerable code. For Partly and No, say what still has to be done and where.

Rules:
- Be strict. Answer Yes only when a documentation page describes what replaces the vulnerable code or behavior, and name that page in the How column. If the documentation does not describe the replacement, answer Unconfirmed.
- Deleting code is not a solution. If secureFlows does not offer what the vulnerable code did (a sign-in method, a kind of role, a kind of data), the answer is No or Unconfirmed, because the app would lose that function. A gap counts as closed only when the function survives.
- If two documentation pages contradict each other about something a row depends on, say so in How, answer Unconfirmed, and add it to Questions for secureFlows.
- Permission rules that belong to my product (which of my roles may call which of my routes, who owns which record in my database, whether an account is suspended) are Partly at best: secureFlows proves who the caller is, and my backend still has to enforce the rule.
- Before answering No, check which endpoints the gap is about. Sign-in, session renewal, sign-out, and reads and writes of per-user data move to secureFlows, so a platform protection it documents for its own API (rate limiting, audit and access logs, encryption at rest) covers those endpoints. If the gap also covers routes that stay in my backend, answer Partly and name the routes that are still mine.
- Anything that needs shared, relational, or cross-user data stays in my own database. Do not propose moving it to secureFlows.
- If the documentation is silent, answer Unconfirmed. Do not guess.

Under the table, add:
- Score: one line counting the Yes, Partly, No, and Unconfirmed rows, in total and for the High severity rows.
- What stays in my backend: the checks and data that remain my responsibility after adopting secureFlows.
- Questions for secureFlows: each Unconfirmed row as a question I can send to them.

Append all of this to USER_MANAGEMENT_SECURITY_REVIEW.md as a new section titled "secureFlows fit". Then reply in chat with the extended table and the score line.

Prompt 3 — the migration plan

A plan only. It names what moves to secureFlows, what stays in your database, every sign-in check that has to keep working, and the order to do it in.

Prompt 3
Paste as-is, after Prompt 2.
Using USER_MANAGEMENT_SECURITY_REVIEW.md, including its "secureFlows fit" section, write a full plan for moving this project's identity and session layer to secureFlows (https://www.secure-flows.com). This is a plan only: do not change any code.

Base everything you say about secureFlows on its public documentation, not on memory:
- overview: https://www.secure-flows.com/llms.txt
- moving an app that already has its own backend: https://www.secure-flows.com/docs/introduction/from-existing-backend/
- authentication and authorization model: https://www.secure-flows.com/docs/technical/authentication-authorization/
- search for anything else: https://www.secure-flows.com/api/v1/docs/search?q=<your question>&limit=8
If you cannot open these pages, say so and stop.

Save the plan as SECUREFLOWS_MIGRATION_PLAN.md in the project root, with these sections:

1. Summary and recommendation: what to adopt secureFlows for, what to leave where it is, which gaps close as soon as the migration is done, and which do not.
2. Current state: today's architecture in a short table, and the gap list with severity and category.
3. What secureFlows provides, and what it is not: only what the documentation supports.
4. Fit assessment: a table with one row for every account type and every kind of data in this project, with the columns Item | Good fit / Partial fit / Poor fit | Reason. Private data owned by one user fits. Shared, relational, or cross-user data does not, and stays in my database.
5. Target architecture: a before and after table covering who the user is, which token my API trusts, where clients keep the token, how a session is renewed, how an identity is linked to my database rows, where business data lives, and where role checks run. Propose the workspace and applications to register, with a redirect URL for each. If the hosts are not in the project, use placeholders such as https://<your-host>/callback and mark them as assumptions in section 7.
6. Gap-by-gap remediation: every gap from the review, marked Yes / Partly / No / Unconfirmed exactly as in the "secureFlows fit" section, with what changes in the code.
7. Open questions: every assumption and every Unconfirmed item, each with a fallback if the answer is no.
8. Migration steps, in order, each small enough to ship and verify by itself:
   a. Provision the workspace and applications.
   b. Classify the data: keep forever (moves to secureFlows), only needed while using the app (stays local), not owned by one user (stays in my database).
   c. List every backend action that requires sign-in today and how each one will check a verified secureFlows session instead. None may be dropped: each one either stays a backend route that checks a verified secureFlows session, or is listed as moved, with where its check now lives.
   d. Implementation order, starting with the account type that carries the least risk.
   e. Linking existing accounts once, on first sign-in, with the old system kept read-only as a fallback until every active user has moved.
   f. A verification checklist that has to pass before the old sign-in code is removed: one user cannot read another user's data, each role is rejected on the other roles' routes, suspended accounts stay blocked, and sign-out really ends the session.
   g. How to roll back if a step fails.
9. Fixes that do not depend on secureFlows, and interim fixes: every No row with the fix, plus any High severity gap that is exploitable today and should be fixed before or alongside the migration instead of waiting for it, even if secureFlows would close it later.
10. Effort: a rough size (S / M / L) for each step. Do not invent dates.

Rules:
- Mark each statement about secureFlows that the documentation does not support as an assumption, and list it in section 7.
- An authorization check is moved to the new identity, never deleted.
- Write for an engineer on my team who has not read this conversation.

When the file is saved, reply in chat with section 1 and the open questions.

Read the plan before you build

These prompts review and plan; they do not prove your app is secure, and an AI review can miss things or get things wrong. Check the evidence column against your code, and send us the open questions from the plan through Contact Us before you commit to the migration.

Example result

A shortened result from Prompt 2 for an app with three account types (end users, partners, admins) that signs people in with an identity provider and then issues its own API tokens.

Gap Severity Can secureFlows solve this? How
Dashboard keeps its API token in localStorage High Yes The session token is kept in sessionStorage, scoped to the tab, by the integration pattern itself.
Partner tokens never expire High Yes The app stops issuing its own tokens. secureFlows session tokens are short-lived and renewed through hosted login.
Refresh endpoint returns a token without validating anything High Yes There is no refresh endpoint left to write. An expired token sends the user back through hosted login, and their data is untouched.
Token signing secret falls back to a default value High Yes With no self-issued tokens there is no signing secret in the app to configure or leak.
Suspended accounts can still sign in Medium Partly An admin can revoke the user's session from the console, which ends their access on the next API call and is audited. Revoke also deletes that session's stored data and does not stop the person signing in again, so a lasting suspension is still checked in the app's backend, by the stable secureFlows user id.
Rate limiters are defined but never mounted Medium Partly Sign-in and per-user data move to the secureFlows API, which is rate limited per client IP. The app's remaining routes, such as withdrawals, still need their own limiters mounted.
The API accepts browser requests from any origin Medium No secureFlows protects its own endpoints, not the app's API. Restrict the allowed origins in the app's server configuration.
Phone sign-in uses a fixed development code Medium No Hosted login currently supports email and password and Google accounts only. SMS sign-in is on the roadmap, so phone sign-in stays in the app for now.

Score for this excerpt: 4 Yes, 2 Partly, 2 No, 0 Unconfirmed.

Where to go next

  1. Ready to implement the plan? Create a workspace and follow Integration from an app with its own backend, which has the prompts that make the change.
  2. Want to understand the model first? Read Authentication & Authorization and Security Infrastructure.
  3. Questions the plan left open? Contact Us or ask the Support Bot.