Inferensys

Prompt

Password Reset Flow Documentation Prompt

A practical prompt playbook for using the Password Reset Flow Documentation Prompt in production AI workflows to generate secure, unambiguous self-service recovery documentation.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the precise job, required inputs, and operational boundaries for generating a complete password reset flow document.

This prompt is designed for product security engineers and technical writers who need to produce a complete, unambiguous, and secure documentation artifact for a self-service password reset flow. The job-to-be-done is converting a set of architectural decisions and security parameters—such as token generation method, delivery channel, and expiration window—into a single, structured document that can be handed directly to a frontend team, a backend implementer, and a security reviewer. The ideal user already knows the flow's technical details but needs the prompt to enforce the correct structure, surface missing edge cases, and produce language that leaves no room for implementation guesswork.

Use this prompt when you have finalized the technical design of your reset flow and need to generate the official specification. The prompt requires concrete inputs: the token format (e.g., JWT, opaque), the delivery mechanism (e.g., email, SMS), the exact expiration period, the account lockout policy, and the post-reset session behavior. It is not a design tool. Do not use it to brainstorm flow options or to make security decisions. It is also unsuitable for documenting flows that include novel, non-standard cryptographic handshakes without providing those details explicitly in the [INPUT] context. The prompt's value is in its exhaustive checklist of required sections, its strict output schema, and its built-in checks for common documentation failures like missing rate-limiting descriptions or ambiguous error messages.

Before executing this prompt, ensure you have the complete [INPUT] data package ready. The prompt will fail to produce a safe document if it must hallucinate security parameters. After generation, the output must be treated as a draft that requires human review, specifically for the accuracy of the token generation mechanism and the correctness of the lockout integration logic. The next step is to run the generated document through the provided evaluation criteria to check for enumeration vulnerabilities and missing rate-limiting sections before publishing it to your developer portal.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Password Reset Flow Documentation Prompt delivers value and where it introduces unacceptable risk. Use these cards to decide whether this prompt fits your current documentation task.

01

Good Fit: Self-Service Reset Documentation

Use when: You need to document a standard email-based password reset flow with token generation, expiry windows, and account lockout integration. Guardrail: The prompt excels at producing structured, step-by-step developer-facing references that cover the happy path and common error states.

02

Bad Fit: Proprietary or Undocumented Internal Flows

Avoid when: The reset flow relies on undocumented internal services, custom cryptographic protocols, or unreleased infrastructure. Guardrail: The model will hallucinate plausible but incorrect implementation details. Use only when the source-of-truth specification is available as input context.

03

Required Inputs

Risk: Incomplete or vague inputs produce generic documentation that misses critical security details. Guardrail: Always provide the exact token lifetime, email template structure, rate limit thresholds, and account lockout policy. Missing any of these leads to documentation that cannot be safely implemented.

04

Operational Risk: Enumeration Vulnerability Exposure

Risk: The generated documentation may inadvertently describe behavior that reveals whether an account exists, creating an enumeration vector. Guardrail: Always include an explicit instruction to document uniform response messaging. Review the output for any language that differentiates between 'account not found' and 'email sent' in the API response.

05

Operational Risk: Missing Rate Limiting Documentation

Risk: The prompt may focus on the functional flow and omit critical abuse-prevention details like rate limiting on the reset endpoint. Guardrail: Add a specific constraint requiring a dedicated section on rate limits, including per-IP and per-account thresholds, and the HTTP 429 error response schema.

06

Bad Fit: Multi-Channel or Biometric Recovery

Avoid when: The reset flow involves SMS OTP, push notifications, security keys, or biometric verification as primary or fallback mechanisms. Guardrail: This prompt is optimized for email-based token flows. Multi-channel recovery requires a different prompt structure to handle channel-specific error states, fallback ordering, and delivery failure documentation.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for generating complete, security-reviewed password reset flow documentation from product specifications.

This prompt template is designed to produce a comprehensive password reset flow document suitable for internal security review, API documentation, and integration guides. It takes structured inputs about your system's token generation, delivery mechanism, expiration policies, and account lockout behavior, then generates a complete reference with sequence descriptions, error handling, and vulnerability mitigation checks. The output is intended to be a first draft that a security engineer or technical writer can refine, not a final publishable document without human review.

text
You are a technical documentation specialist with expertise in authentication security and API design. Your task is to generate a complete password reset flow documentation page from the provided specifications.

## INPUT SPECIFICATIONS
[INPUT]

## DOCUMENTATION CONTEXT
[CONTEXT]

## REQUIRED OUTPUT STRUCTURE
[OUTPUT_SCHEMA]

## CONSTRAINTS
[CONSTRAINTS]

## REFERENCE EXAMPLES
[EXAMPLES]

## AVAILABLE TOOLS
[TOOLS]

## RISK LEVEL
[RISK_LEVEL]

## INSTRUCTIONS
1. Parse the [INPUT] specifications to extract all password reset flow parameters including token generation method, delivery channel, expiration window, and lockout thresholds.
2. Generate documentation following the [OUTPUT_SCHEMA] structure exactly. Do not omit any required sections.
3. For each step in the flow, describe the sequence of events, the actors involved (user, client application, auth server, email service), and the data exchanged.
4. Include explicit error handling for every failure point: invalid token, expired token, reused token, rate-limited request, account not found, and delivery failure.
5. Add a dedicated security considerations section that addresses enumeration vulnerabilities, rate limiting, token entropy, and secure delivery practices.
6. If [RISK_LEVEL] is "high" or "critical", include a human review checklist at the top of the document with specific items that must be verified before publication.
7. Use the [EXAMPLES] to match the organization's documentation style, tone, and level of technical detail.
8. Apply all [CONSTRAINTS] strictly. If a constraint conflicts with the input specifications, flag the conflict in a "Documentation Notes" section rather than silently resolving it.
9. If [TOOLS] includes a validation function, run it against the generated document and report any failures.
10. Do not invent token formats, expiration values, or lockout policies not present in [INPUT]. If a required detail is missing, mark it with "[TO BE SPECIFIED]" and add it to a "Gaps Requiring Product Input" section.

To adapt this template for your own use, replace each square-bracket placeholder with concrete values. The [INPUT] placeholder should contain your system's specific password reset parameters as structured data (JSON works well). The [OUTPUT_SCHEMA] should define the exact sections you need—at minimum, include flow overview, step-by-step sequence, error reference, security considerations, and integration requirements. The [CONSTRAINTS] field is where you enforce organizational rules such as "never document internal token structure" or "always include rate limit headers in error responses." For high-risk authentication flows, set [RISK_LEVEL] to "high" and ensure the human review checklist is populated with specific verification items like "confirm no user enumeration is possible via timing analysis" and "verify token entropy meets organizational minimum of 128 bits." After generating the document, run it through your security review process and validate all code samples against your actual API before publication.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Password Reset Flow Documentation Prompt. Each placeholder must be supplied before generation. Validation notes describe how to check input quality before the prompt runs.

PlaceholderPurposeExampleValidation Notes

[FLOW_NAME]

Identifies the specific reset flow variant being documented

Forgot Password via Email Link

Must be a non-empty string under 100 characters. Reject if generic label like 'reset' is used without context.

[AUTH_PROVIDER]

Specifies the identity provider or auth service handling the flow

Auth0, Firebase Auth, Custom Cognito

Must match a known provider from the approved list. Null allowed only if documenting a fully custom implementation.

[TOKEN_TYPE]

Defines the token format used for reset links

JWT, opaque token, signed URL

Must be one of: JWT, opaque, signed_url. Reject if empty. Drives token structure documentation.

[TOKEN_LIFETIME_MINUTES]

Sets the expiration window for reset tokens

15

Must be a positive integer between 1 and 1440. Reject if 0 or negative. Used to generate expiration warnings.

[RATE_LIMIT_CONFIG]

Describes the rate limiting applied to reset endpoints

5 requests per hour per email

Must be a non-empty string specifying count, window, and scope. Reject if 'none' or empty. Required for security documentation.

[ACCOUNT_LOCKOUT_POLICY]

Defines lockout behavior after failed attempts

Lock after 10 failed attempts for 30 minutes

Must be a non-empty string. Reject if 'none'. Required to prevent enumeration vulnerability documentation gaps.

[EMAIL_TEMPLATE_REF]

Points to the email template used for reset messages

password-reset-v2.html

Must be a non-empty string matching a known template name. Used to generate email content documentation. Null allowed if email content is out of scope.

[ENUMERATION_RESPONSE]

Specifies the user-facing response to avoid email enumeration

If email exists, send reset link. Always return 200 OK.

Must be a non-empty string describing the anti-enumeration strategy. Reject if response reveals existence. Critical security check.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Password Reset Flow Documentation Prompt into a documentation pipeline or security review workflow.

This prompt is designed to be called programmatically as part of a documentation generation or audit pipeline, not as a one-off chat interaction. The primary integration point is a CI/CD step that triggers after an API specification change, a security review ticket, or a scheduled documentation freshness check. The harness should supply the prompt with a structured [INPUT] containing the current flow specification—endpoints, request/response schemas, token generation logic, and rate limit configurations—sourced from an OpenAPI spec, an internal feature flag manifest, or a product requirements document. Because the output is a complete documentation page, the harness must validate that every required section (token generation, email delivery, expiration windows, account lockout integration) is present before publishing.

Wire the prompt into an application using a validate-then-review pattern. First, call the model with the prompt template and capture the full markdown output. Immediately run a structural validator that checks for the presence of required H2 sections (## Token Generation, ## Email Delivery, ## Expiration Windows, ## Account Lockout Integration) and required subsections like ### Rate Limiting and ### Enumeration Prevention. If the validator fails, retry the prompt once with an explicit error message appended to the [CONSTRAINTS] field, e.g., 'The previous output was missing the Account Lockout Integration section. Regenerate the full document.' If the second attempt fails, escalate to a human reviewer queue. For model choice, use a model with strong instruction-following and long-context handling (e.g., claude-sonnet-4-20250514 or gpt-4o); avoid smaller models that may drop sections or flatten nested markdown structure. Log every generation attempt, the validator result, and the final published version to an audit table for traceability.

After structural validation passes, route the output to a security review stage. This stage should use a separate evaluation prompt (from the LLM Judge and Evaluation Rubrics pillar) to score the documentation against the specific security checks listed in the playbook: enumeration vulnerability coverage, rate limiting explicitness, and token expiration clarity. If the eval score falls below a defined threshold (e.g., 4 out of 5 on a security completeness rubric), flag the document for human security review before publication. Do not auto-publish password reset documentation without this security gate. For teams using a docs-as-code workflow, the final output should be committed as a markdown file to the documentation repository with a commit message that includes the prompt version, model used, and eval score. Avoid wiring this prompt directly to a public-facing CMS without the validation and review stages; the risk of publishing incomplete or insecure recovery documentation is too high.

IMPLEMENTATION TABLE

Expected Output Contract

Validate the structure and content of the generated password reset flow documentation against this contract before publishing.

Field or ElementType or FormatRequiredValidation Rule

flow_title

string

Must match pattern 'Password Reset Flow' or include the product name. Not empty.

overview_description

string

Must contain the phrase 'self-service' and mention token delivery. Length > 100 chars.

prerequisites_list

array of strings

Must include at least one item referencing a verified email address or account identifier.

step_by_step_instructions

array of objects

Each object must contain 'step_number' (int), 'actor' (string: 'User' or 'System'), and 'action' (string). Minimum 3 steps.

token_generation_details

object

Must include 'algorithm' (string), 'entropy_source' (string), and 'length' (int). 'length' must be >= 128 bits.

token_expiration_policy

string

Must specify a concrete duration (e.g., '15 minutes') and reference server-side enforcement.

rate_limiting_section

object

Must include 'max_attempts_per_window' (int) and 'window_duration' (string). 'max_attempts_per_window' must be > 0.

account_lockout_policy

string

Must describe the lockout trigger condition and recovery path. Cannot be 'N/A' or empty.

PRACTICAL GUARDRAILS

Common Failure Modes

Password reset documentation prompts fail in predictable ways. These cards cover the most common failure modes when generating self-service recovery docs and how to prevent them before they reach production.

01

Enumeration Vulnerability Disclosure

What to watch: The model generates documentation that reveals whether an account exists, such as 'If the email is registered, a reset link will be sent.' This creates an oracle for attackers to enumerate valid accounts. Guardrail: Add a hard constraint in the prompt requiring uniform messaging regardless of account existence. Validate output with a regex check for phrases like 'if the account exists' or 'if the email is found.'

02

Missing Rate Limiting Documentation

What to watch: The generated docs describe the reset flow but omit rate limiting on the reset request endpoint, token validation endpoint, or both. This leaves the system vulnerable to brute-force token guessing and denial-of-service. Guardrail: Include a required section in the output schema for rate limit specifications per endpoint. Add an eval that fails if rate limit headers, thresholds, or backoff guidance are absent.

03

Hardcoded Token Examples in Documentation

What to watch: The model includes realistic-looking JWT or reset token values in code samples or curl examples. Developers copy-paste these into configuration or tests, creating security incidents. Guardrail: Add a constraint requiring placeholder tokens like 'YOUR_RESET_TOKEN' or 'eyJ...<redacted>'. Run a post-generation scan for base64-encoded strings and JWT-like patterns and flag any matches for human review.

04

Incomplete Expiration Window Specification

What to watch: The docs mention that reset links expire but fail to specify the exact duration, clock skew tolerance, or what happens after expiry. Consumers build integrations with incorrect timeout assumptions. Guardrail: Require explicit expiration values in seconds or minutes in the output schema. Add an eval check that verifies both the duration and the post-expiry error response are documented.

05

Token Storage and Transmission Guidance Omission

What to watch: The generated documentation describes token generation and validation but skips how tokens should be transmitted (HTTPS only, query parameter vs. body) and stored (memory-only, no localStorage). This leads to token leakage in logs, referrer headers, or browser storage. Guardrail: Include a mandatory 'Security Considerations' section in the prompt template. Validate that the output addresses transport security, storage warnings, and log redaction.

06

Account Lockout Integration Gap

What to watch: The docs describe the reset flow in isolation without explaining how it interacts with account lockout policies after repeated failed attempts. Consumers may implement reset as a lockout bypass. Guardrail: Add a prompt instruction to document the interaction between reset attempts and lockout counters. Use an eval that checks for cross-references to lockout policy documentation or explicit statements about reset's effect on lockout state.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the quality of generated password reset flow documentation before shipping it to users or integrating it into a developer portal. Each criterion targets a known failure mode in security-sensitive documentation.

CriterionPass StandardFailure SignalTest Method

Token Generation Specification

Output includes exact token format (e.g., JWT or opaque), length, entropy source, and generation library recommendation.

Token format is described vaguely as 'secure token' without byte length or encoding details.

Parse output for token format field; assert presence of bit length or character count.

Expiration Window Documentation

Output states the exact expiration duration in seconds or minutes and describes server-side enforcement.

Expiration is described as 'short-lived' without a numeric value or mentions only client-side expiry.

Regex search for time unit pattern (e.g., '15 minutes', '900 seconds'); fail if absent.

Rate Limiting and Brute-Force Protection

Output specifies rate limit thresholds per IP and per account, with lockout duration and HTTP 429 response example.

Rate limiting is mentioned as a general concept without concrete thresholds or response codes.

Search for '429' status code and a numeric threshold (e.g., '5 attempts'); fail if both are missing.

Enumeration Resistance

Output explicitly states that the response message is identical for existing and non-existing accounts, with example responses.

Success and failure response examples reveal account existence through different wording or timing hints.

Compare success and failure response examples in output; fail if wording differs beyond the token placeholder.

Email Delivery and Security

Output documents the email template structure, sender verification (SPF/DKIM), and warns against logging the reset link.

Email content is described generically without transport security notes or link exposure warnings.

Search for 'SPF', 'DKIM', or 'transport security'; fail if none found and email section exists.

Token Storage and Comparison

Output specifies that tokens are stored as salted hashes (e.g., bcrypt) and compared using constant-time functions.

Output suggests storing tokens in plaintext or using non-constant-time string comparison.

Search for 'hash', 'bcrypt', or 'constant-time'; fail if plaintext storage is implied or hashing is absent.

Account Lockout Integration

Output describes how password reset interacts with existing account lockout policies, including reset-after-lockout behavior.

Lockout state is not mentioned, or reset flow is documented in isolation without reference to the broader auth system.

Search for 'lockout' or 'account state'; fail if absent and the prompt context includes lockout requirements.

Error Response Completeness

Output includes error responses for expired token, invalid token, reused token, and missing user, each with HTTP status and body.

Only a generic 'error occurred' response is shown, or error cases are listed without corresponding HTTP status codes.

Count distinct error scenarios with HTTP status codes; fail if fewer than 4 distinct error cases are documented.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and minimal validation. Focus on generating the flow narrative and token lifecycle sections first. Skip strict schema enforcement on the first pass—validate the output manually against your internal auth spec.

Add to the prompt:

code
[CONSTRAINTS]
- Generate the password reset flow as a numbered sequence.
- Include token generation, email delivery, expiration window, and account lockout integration.
- Flag any sections where you are uncertain with [NEEDS REVIEW].

Watch for

  • Missing enumeration vulnerability checks (the model may describe the happy path without noting timing side-channels)
  • Overly generic rate-limiting language that doesn't match your actual gateway config
  • Token expiration values that sound plausible but don't match your security policy
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.