<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:media="http://search.yahoo.com/mrss/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vulnerability Scanning &#8211; Flowpast.com &#8211; Your Workflow Automation Library</title>
	<atom:link href="https://flowpast.com/function/vulnerability-scanning/feed/" rel="self" type="application/rss+xml" />
	<link>https://flowpast.com</link>
	<description>Flowpast.com - Pre-Built n8n, Make &#38; Zapier Workflow Templates</description>
	<lastBuildDate>Fri, 23 Jan 2026 02:51:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://flowpast.com/wp-content/uploads/2025/12/cropped-icon-32x32.png</url>
	<title>Vulnerability Scanning &#8211; Flowpast.com &#8211; Your Workflow Automation Library</title>
	<link>https://flowpast.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Build an Enterprise RBAC Plan with this AI Prompt</title>
		<link>https://flowpast.com/prompts/build-an-enterprise-rbac-plan-with-this-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:51:37 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5001442</guid>

					<description><![CDATA[Access gaps expose data - the ultimate AI Prompt that designs enterprise RBAC with schema, middleware, UI gating, tests, and audits. Discover more AI prompts for marketing, sales, and ops.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: enterprise RBAC plan -->

<div class="hook-introduction">

<p>Your app “kind of” has permissions. A few admin checks, a couple of feature flags, and some UI hiding that makes stakeholders feel safe. Then you find a direct API call that bypasses the frontend, an internal role that can quietly escalate, or a contractor account that still works months later.</p>



<p>This <strong>enterprise RBAC plan</strong> is built for <strong>security-minded software architects</strong> who need enforcement patterns that developers won’t accidentally bypass, <strong>engineering managers</strong> cleaning up messy, inconsistent authorization rules across services, and <strong>product teams in regulated environments</strong> that need audit-ready access controls without making the UX miserable. The output is a complete, implementation-ready RBAC blueprint: roles and permissions, a data schema with indexes and constraints, middleware/guard patterns, UI gating guidance, test plans, auditing workflows, and a clear “What This Is NOT” scope section.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It restates your authorization situation and lists the specific risks it is designed to close (unauthorized access, privilege escalation, and permission sprawl).</li>
          <li>It designs an RBAC model that defines roles, resources, actions, and role structure (flat vs. hierarchical) with escalation-resistant admin patterns.</li>
          <li>It proposes a data-layer schema (tables/collections) with indexes, constraints, and migration notes, including performance implications as roles and tenants grow.</li>
          <li>It outputs backend enforcement patterns (middleware/guards) plus frontend experience guidance so the UI never becomes the only gate.</li>
          <li>It adds concrete operational guardrails: tests, auditing, and a “What This Is NOT” section that prevents scope creep and false security assumptions.</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>You found an endpoint that should be restricted, but it is callable with a basic user token.</li>
          <li>Your current “admin” role is a catch-all and you need separation of duties before you add more internal teams.</li>
          <li>You are refactoring services and want consistent authorization rules before APIs multiply across microservices.</li>
          <li>Compliance or enterprise customers are asking for least privilege, audit logs, and clear access review processes.</li>
          <li>Multi-tenant complexity is arriving (or already here), and you need patterns that scale without exploding permission counts.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A complete RBAC model with defined roles, resources, actions, and at least one safe admin escalation pattern.</li>
           <li>A proposed schema with tables/collections, key columns/fields, and index recommendations to keep permission checks fast.</li>
           <li>Ready-to-implement enforcement guidance, including middleware/guard logic and where checks must live in the request lifecycle.</li>
           <li>A practical test plan (unit, integration, and abuse-case tests) plus examples of what to assert for deny-by-default behavior.</li>
           <li>An auditing and access-review checklist, including events to log and periodic review steps that stay maintainable.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: Enterprise RBAC Blueprint Generator</h2>



<div class="prompt-viewer-wrapper" id="prompt-section">
    <div class="prompt-comparison-row prompt-premium">
        <!-- Header with buttons -->
        <div class="prompt-row-header">
            <!-- <span class="prompt-row-icon">✨</span> -->
            <span class="prompt-row-title">
                                    Step 1: Customize the prompt with your input
                            </span>
            <div class="prompt-header-buttons">
                                    <button class="prompt-header-btn prompt-header-reset" onclick="resetPrompt()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                                <button class="prompt-header-btn prompt-header-copy-green flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span>Customize and Copy Full Prompt</span>
                </button>
            </div>
        </div>

        <!-- Customize the Prompt Section -->
                    <div class="prompt-customize-section">
                <span class="customize-title">Customize the Prompt</span>
                <p class="customize-subtitle">Fill in the fields below to personalize this prompt for your needs.</p>
                <table class="customize-table">
                    <thead>
                        <tr>
                            <th>Variable</th>
                            <th>What to Enter</th>
                            <th>Customise the prompt</th>
                        </tr>
                    </thead>
                    <tbody>
                                                    <tr>
                                <td class="var-name"><code>[UPPERCASE_WITH_UNDERSCORES]</code></td>
                                <td class="var-desc">
                                    Specify the naming convention to be used for user-provided values, adhering to the format of uppercase letters separated by underscores.                                    <div class="var-example">For example: "USER_ROLE_PERMISSIONS or RESOURCE_ACCESS_LEVEL"</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[UPPERCASE_WITH_UNDERSCORES]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[FORMAT]</code></td>
                                <td class="var-desc">
                                    Define the format or structure required for the RBAC blueprint, such as JSON, YAML, or database schema.                                    <div class="var-example">For example: "JSON structure with nested roles and permissions, or SQL schema for relational databases."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[FORMAT]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[CONTEXT]</code></td>
                                <td class="var-desc">
                                    Provide details about the application, including its purpose, architecture, and any specific constraints or requirements.                                    <div class="var-example">For example: "A multi-tenant SaaS application for project management, supporting both web and mobile platforms with high user concurrency."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[CONTEXT]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[INDUSTRY]</code></td>
                                <td class="var-desc">
                                    Specify the industry or domain the application serves, as this can influence compliance requirements and access control patterns.                                    <div class="var-example">For example: "Healthcare industry requiring HIPAA compliance and strict data privacy controls."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[INDUSTRY]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[PRODUCT_DESCRIPTION]</code></td>
                                <td class="var-desc">
                                    Briefly describe the product, including its main features, functionality, and target user base.                                    <div class="var-example">For example: "A cloud-based CRM platform enabling sales teams to manage customer relationships, track leads, and automate workflows."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[PRODUCT_DESCRIPTION]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[TARGET_AUDIENCE]</code></td>
                                <td class="var-desc">
                                    Describe the primary users of the application, including their roles, needs, and any defining characteristics.                                    <div class="var-example">For example: "Enterprise security teams managing access control for 500+ employees across multiple departments and locations."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[TARGET_AUDIENCE]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                            </tbody>
                </table>

                <button class="copy-customized-btn flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span class="copy-customized-text">Customise the prompt now</span>
                </button>
            </div>
        
        <!-- Full Prompt Code Header -->
                    <div class="prompt-code-header">
                <span class="prompt-code-title">
                    Step 2: Copy the Prompt
                </span>
                <div class="prompt-code-buttons">
                    <!-- Reset: Only visible when unlocked -->
                    <button class="prompt-header-btn prompt-header-reset btn-when-unlocked" onclick="resetPrompt()" style="display: none;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                    <!-- Copy Full Prompt -->
                    <button class="prompt-header-btn prompt-header-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                            <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                        </svg>
                        <span>Copy Full Prompt</span>
                    </button>
                </div>
            </div>
        

        <!-- Prompt Content -->
        <div class="prompt-box prompt-gated-wrapper">
            <!-- Gated: Blurred content -->
            <div class="prompt-gated-content">
                <div class="prompt-header-visible">OBJECTIVE</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PERSONA</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">CONSTRAINTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PROCESS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">What This Is NOT</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">INPUTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">OUTPUT SPECIFICATION</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Role Architecture</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Database Schema</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Middleware Implementation</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">UI Access Control</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">API Route Protection</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Error Handling</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Testing Strategy</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Monitoring &amp; Audit</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Deployment Checklist</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">QUALITY CHECKS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div>            </div>
            <!-- Unlocked: Full content (hidden by default) -->
            <div class="prompt-content-full" id="premium-prompt-content" style="display: none;">
                ## OBJECTIVE
Create a complete, implementation-ready Role-Based Access Control (RBAC) blueprint tailored to the given application. The deliverable must close active unauthorized access issues, prevent privilege escalation (external and internal), and remain maintainable as the product and team scale—without degrading user experience.

## PERSONA
Act as a security-focused software architect and ex–enterprise security advisor who has led multiple zero-trust and least-privilege rollouts in high-compliance environments. Communicate like a pragmatic builder: precise, code-forward, and opinionated about guardrails that developers will actually keep in place.

## CONSTRAINTS
- Prioritize least privilege, explicit deny-by-default, and separation of duties.
- Avoid vague security platitudes; every recommendation must map to a concrete implementation step.
- Optimize for long-term scalability (more roles, more resources, more endpoints, more tenants if applicable).
- Include both backend enforcement and frontend experience patterns (UI should never be the only gate).
- Prefer patterns that reduce “permission sprawl” and minimize performance overhead.
- Add a “What This Is NOT” subsection to clarify excluded scope.
- Handle unclear or missing inputs by stating assumptions and offering 2–3 safe options.
- Follow variable format compliance: user-provided values use [UPPERCASE_WITH_UNDERSCORES]; AI-filled placeholders use {Title Case}.

## PROCESS
1. **Pre-Analysis (required):** Restate the situation in your own words, list the key security risks you’re addressing, and confirm the main technical constraints inferred from the inputs.
2. **RBAC model design:** Define roles, permissions, resources, and actions; decide on role hierarchy vs. flat roles; include escalation-resistant admin patterns.
3. **Data layer plan:** Propose a schema (tables/collections), indexes, and constraints; include migration guidance and performance notes.
4. **Enforcement layer:** Provide middleware/guards/hooks for backend authorization and token/session strategy integration.
5. **Frontend access patterns:** Show safe UI gating patterns (feature flags vs. authorization), including loading states and optimistic UI cautions.
6. **Failure handling:** Design user-friendly denial flows, error payload conventions, and fallback components.
7. **Validation:** Provide tests (unit/integration/e2e) that prove boundaries hold and cannot be bypassed.
8. **Telemetry:** Specify audit events, log fields, alerting signals, and review workflows.
9. **Deployment hardening:** Produce a rollout checklist that reduces lockouts and prevents “too permissive” regressions.

### What This Is NOT
- Not a full identity provider (IdP) selection guide or SSO procurement document.
- Not a generic OWASP checklist dump.
- Not permissioning based purely on frontend conditions.
- Not a replacement for threat modeling beyond access control (you may note adjacent risks, but stay centered on RBAC).

## INPUTS
- **Application type:** [FORMAT]
- **Technology stack:** [CONTEXT]
- **Database system:** [INDUSTRY]
- **Current authentication setup:** [PRODUCT_DESCRIPTION]
- **User base size + growth expectation:** [TARGET_AUDIENCE]

## OUTPUT SPECIFICATION
Use the following sections and populate each with concrete, buildable detail. Include code snippets in the dominant stack implied by [CONTEXT], and tailor data structures to [INDUSTRY]. Use these placeholders where needed: {Role}, {Permission}, {Resource}, {Action}, {Endpoint}, {Table}, {Column}, {Index}, {Error Code}, {Log Event}.

### Role Architecture
- {Role} catalog with purpose, allowed {Action}s, and guarded {Resource}s  
- Role hierarchy or composition strategy (and why)  
- Admin design that avoids “god mode” by default (break-glass, time-bound elevation, approvals if applicable)  
- Least-privilege defaults and onboarding/offboarding implications  

### Database Schema
- Tables/collections for users, roles, permissions, and mappings (e.g., user↔role, role↔permission)  
- Constraints, indexes, and query patterns for fast checks  
- Guidance for multi-tenant support if relevant (safe scoping rules)  
- Example migrations or schema definitions matching [INDUSTRY]  

### Middleware Implementation
- Backend authorization middleware/guards with:
  - token/session parsing tied to [PRODUCT_DESCRIPTION]
  - permission resolution (cached where appropriate)
  - deny-by-default logic and explicit checks
- Frontend hooks/utilities for permission queries (never authoritative alone)
- Examples:
  - checking {Permission} for {Endpoint}
  - securing sensitive admin actions
  - preventing IDOR-style access to {Resource} by ownership/tenant scope  

### UI Access Control
- Component patterns for conditional rendering with safe defaults  
- Strategies for route-level gating, feature visibility vs. capability enforcement  
- Loading/unknown-permission states and “request access” UX  
- Guidance to avoid leaking sensitive data via prefetching or cached responses  

### API Route Protection
- Endpoint policy mapping: {Endpoint} → required {Permission}s  
- Object-level authorization (resource ownership/tenant boundaries)  
- Rate limiting and abuse controls where RBAC intersects with brute-force/admin endpoints  
- Examples in the primary backend framework implied by [CONTEXT]  

### Error Handling
- Standard error contract (e.g., {Error Code}, message, correlation id)  
- User-facing copy that’s helpful without revealing sensitive authorization logic  
- Fallback UI components for forbidden/unauthenticated states  
- Safe redirects and post-login continuation patterns  

### Testing Strategy
- Unit tests for permission evaluation  
- Integration tests for middleware and endpoint coverage  
- E2E tests for common role journeys and regression traps  
- Negative tests proving privilege escalation is blocked (role tampering, token replay, forced browsing)  

### Monitoring &amp; Audit
- Audit log schema and storage guidance:
  - {Log Event} types (role change, permission change, denied access, admin actions)
  - required fields (actor, target, resource, scope, timestamp, request id)
- Alerting signals (spikes in denied access, repeated admin probing, anomalous role changes)
- Review/retention policy recommendations aligned to enterprise expectations  

### Deployment Checklist
- Rollout plan to avoid lockouts (staged enforcement, shadow mode, allowlists with expiry)  
- Data backfill/migration steps for existing users  
- Performance checks (cache hit rates, authz query latency)  
- Security verification gates before release  

## QUALITY CHECKS
At the end, include a short verification list confirming:
- Least-privilege defaults are enforced and “implicit allow” is eliminated.
- Authorization is enforced server-side for every protected {Endpoint} and object-level access is handled.
- Schema supports growth (more roles/permissions/users) without slow permission checks.
- Tests include negative cases for privilege escalation and forced browsing.
- Audit trails capture role/permission changes and sensitive access attempts with enough context to investigate.            </div>
        </div>


    </div>

    <!-- CTA Row - Full width buttons -->
    <div class="prompt-cta-row">
        <button class="prompt-cta-btn prompt-cta-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
            </svg>
            <span class="cta-copy-text">Copy Full Prompt</span>
        </button>
    </div>
</div>

<style>
    /* Gated prompt states */
    .prompt-gated-wrapper {
        position: relative;
    }

    /* When unlocked - show full content, hide gated */
    body.flowpast-unlocked .prompt-gated-wrapper .prompt-gated-content {
        display: none;
    }

    body.flowpast-unlocked .prompt-gated-wrapper .prompt-content-full {
        display: block !important;
    }

    /* Show/hide elements based on unlock state */
    body.flowpast-unlocked .btn-when-unlocked {
        display: inline-flex !important;
    }

    .prompt-viewer-wrapper {
        scroll-margin-top: 250px;
    }

    /* ========================================
   PROMPT VIEWER - MAIN WRAPPER
   ======================================== */
    .prompt-viewer-wrapper {
        margin: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ========================================
   PROMPT BOX CONTAINER
   ======================================== */
    .prompt-comparison-row {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    /* ========================================
   HEADER WITH BUTTONS
   ======================================== */
    .prompt-row-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .prompt-row-icon {
        font-size: 20px;
    }

    .prompt-row-title {
        font-weight: 600;
        font-size: 22px;
        color: #fff !important;
        text-decoration: underline
    }

    .prompt-header-buttons {
        margin-left: auto;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Header buttons */
    .prompt-header-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-header-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-header-copy:hover {
        background: #2a2a2a;
    }

    .prompt-header-copy.copied {
        background: #2e7d32;
    }

    .prompt-header-copy-green {
        background: #04AA6D !important;
        color: #fff !important;
    }

    .prompt-header-copy-green:hover {
        background: #039860 !important;
    }

    .prompt-header-copy-green.copied {
        background: #2e7d32 !important;
    }

    .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-header-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-1px);
    }

    /* ========================================
   PROMPT CONTENT - FULL (NO SCROLL)
   ======================================== */
    .prompt-box {
        background: #ffffff;
    }

    .prompt-content-full {
        padding: 24px;
        margin: 0;
        color: #202124;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.7;
        white-space: pre-wrap;
        word-wrap: break-word;
        /* No scroll - show full content */
        max-height: none;
        overflow: visible;
    }

    /* Highlighted variable in prompt */
    .prompt-variable {
        background: #fff3cd;
        color: #1967d2;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ffc107;
    }

    .prompt-variable-filled {
        background: #d4edda;
        color: #155724;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #28a745;
    }

    /* ========================================
   GATED CONTENT (NO ACCESS)
   ======================================== */
    .prompt-gated-content {
        padding: 24px;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.8;
        max-height: none;
        overflow: visible;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        cursor: default;
    }

    /* ## headers - larger, black */
    .prompt-header-visible {
        color: #202124;
        font-weight: 600;
        margin: 5px 0 0px 0;
        font-size: 20px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* ### headers - smaller, black */
    .prompt-header-visible.subheader {
        color: #202124;
        font-weight: 600;
        margin: 5px 0;
        font-size: 18px;
    }

    .prompt-header-visible:first-child {
        margin-top: 0;
    }

    /* ========================================
   LOCKED SECTION BLOCK
   ======================================== */
    .locked-section {
        position: relative;
        margin: 4px 0 8px 0;
        border-radius: 6px;
        overflow: hidden;
        background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .locked-section-bg {
        position: relative;
    }

    .locked-section-lines {
        padding: 8px 12px;
        position: relative;
    }

    .locked-line {
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 3px;
        margin-bottom: 4px;
        margin-left: 12px;
    }

    .locked-line:last-child {
        margin-bottom: 0;
    }

    .locked-section-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        font-size: 24px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }

    /* Subheader locked sections - slightly indented */
    /*  .prompt-header-visible.subheader+.locked-section {
        margin-left: 16px;
    } */

    /* ========================================
   COMPATIBILITY BADGES
   ======================================== */
    .prompt-compatibility {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
    }

    .compat-label {
        font-size: 13px;
        color: #5f6368;
        font-weight: 500;
    }

    .compat-badge {
        padding: 4px 10px;
        background: #e8f0fe;
        color: #1967d2;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }

    /* ========================================
   CTA ROW - FULL WIDTH BUTTONS
   ======================================== */
    .prompt-cta-row {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .prompt-cta-btn {
        flex: 1;
        min-width: 200px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 24px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-cta-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-copy:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-copy.copied {
        background: #2e7d32;
    }

    .prompt-cta-reset {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-reset:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-cta-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    /* ========================================
    CUSTOMIZE YOUR PROMPT SECTION
    ======================================== */
    .prompt-customize-section {
        padding: 24px;
        border-bottom: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .customize-title {
        margin: 0 0 8px 0;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
    }

    .customize-subtitle {
        margin: 0 0 20px 0;
        font-size: 14px;
        color: #5f6368;
    }

    .customize-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .customize-table th {
        text-align: left;
        padding: 12px;
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        font-size: 13px;
        font-weight: 600;
        color: #202124;
    }

    .customize-table td {
        padding: 12px;
        border: 1px solid #e0e0e0;
        vertical-align: top;
    }

    .customize-table .var-name {
        width: 25%;
        background: #f8f9fa;
    }

    .customize-table .var-name code {
        background: #fff3cd;
        color: #1967d2;
        border: 1px solid #ffc107;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        word-break: break-all;
        font-weight: 600;
    }

    .customize-table .var-desc {
        width: 35%;
        font-size: 13px;
        color: #5f6368;
        line-height: 1.5;
    }

    .customize-table .var-example {
        margin-top: 8px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #dadce0;
        font-size: 12px;
        color: #5f6368;
        font-style: italic;
        border-radius: 0 4px 4px 0;
    }

    .customize-table .var-input {
        width: 40%;
    }

    .customize-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #dadce0;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .customize-input:focus {
        outline: none;
        border-color: rgb(5, 152, 98);
        box-shadow: 0 0 0 3px rgba(5, 152, 98, 0.1);
    }

    .customize-input::placeholder {
        color: #9aa0a6;
        font-style: italic;
    }

    .copy-customized-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: rgb(5, 152, 98);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .copy-customized-btn:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    .copy-customized-btn.copied {
        background: #2e7d32;
    }

    /* ========================================
    FULL PROMPT CODE HEADER
    ======================================== */
    .prompt-code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
    }

    .prompt-code-title {
        font-size: 22px;
        font-weight: 600;
        text-decoration: underline;

    }

    .prompt-code-buttons {
        display: flex;
        gap: 8px;
    }

    .prompt-code-buttons .prompt-header-btn {
        padding: 8px 14px;
        font-size: 13px;
        background: #ffffff;
        color: #202124;
        border: 1px solid #dadce0;
    }

    .prompt-code-buttons .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
        border-color: rgb(5, 152, 98);
    }

    .prompt-code-buttons .prompt-header-btn.prompt-header-access:hover {
        background: rgb(4, 130, 83) !important;
        border-color: rgb(4, 130, 83);
        color: #fff !important;
    }

    .prompt-code-buttons .prompt-header-btn:hover {
        background: #f1f3f4;
    }

    .prompt-code-buttons .prompt-header-copy.copied {
        background: #d4edda;
        color: #155724;
        border-color: #28a745;
    }

    .prompt-header-reset {
        background: #ffffff;
        color: #202124;
    }

    /* ========================================
   RESPONSIVE
   ======================================== */
    @media (max-width: 768px) {
        .prompt-row-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .prompt-header-buttons {
            margin-left: 0;
            width: 100%;
        }

        .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }

        .prompt-cta-row {
            flex-direction: column;
        }

        .prompt-cta-btn {
            width: 100%;
        }

        /* Customize table responsive */
        .customize-table,
        .customize-table thead,
        .customize-table tbody,
        .customize-table tr,
        .customize-table th,
        .customize-table td {
            display: block;
        }

        .customize-table thead {
            display: none;
        }

        .customize-table tr {
            margin-bottom: 16px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
        }

        .customize-table td {
            width: 100% !important;
            border: none;
            border-bottom: 1px solid #e0e0e0;
        }

        .customize-table td:last-child {
            border-bottom: none;
        }

        .customize-table .var-name {
            background: #f1f3f4;
            font-weight: 600;
        }

        .prompt-code-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }

        .prompt-code-buttons {
            width: 100%;
        }

        .prompt-code-buttons .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }
    }
</style>

<script>
    function handlePromptCopy() {
        // Check if unlocked via cookie
        if (typeof window.flowpastIsUnlocked === 'function' && !window.flowpastIsUnlocked()) {
            // Show email popup
            if (typeof window.flowpastShowEmailPopup === 'function') {
                window.flowpastShowEmailPopup('prompt');
            }
            return;
        }

        // Copy the customized prompt (with filled variables)
        const customizedPrompt = getCustomizedPrompt();
        const copyButtons = document.querySelectorAll('.prompt-header-copy, .prompt-header-copy-green, .prompt-cta-copy, .copy-customized-btn');

        navigator.clipboard.writeText(customizedPrompt).then(() => {
            copyButtons.forEach(btn => {
                btn.classList.add('copied');
                const textSpan = btn.querySelector('span');
                if (textSpan) textSpan.textContent = 'Copied!';
            });

            setTimeout(() => {
                copyButtons.forEach(btn => {
                    btn.classList.remove('copied');
                    const textSpan = btn.querySelector('span');
                    if (textSpan) textSpan.textContent = 'Copy Full Prompt';
                });
            }, 2000);
        }).catch(err => {
            console.error('Failed to copy:', err);
        });
    }

    // Store original prompt for customization
    const originalPrompt = "## OBJECTIVE\r\nCreate a complete, implementation-ready Role-Based Access Control (RBAC) blueprint tailored to the given application. The deliverable must close active unauthorized access issues, prevent privilege escalation (external and internal), and remain maintainable as the product and team scale\u2014without degrading user experience.\r\n\r\n## PERSONA\r\nAct as a security-focused software architect and ex\u2013enterprise security advisor who has led multiple zero-trust and least-privilege rollouts in high-compliance environments. Communicate like a pragmatic builder: precise, code-forward, and opinionated about guardrails that developers will actually keep in place.\r\n\r\n## CONSTRAINTS\r\n- Prioritize least privilege, explicit deny-by-default, and separation of duties.\r\n- Avoid vague security platitudes; every recommendation must map to a concrete implementation step.\r\n- Optimize for long-term scalability (more roles, more resources, more endpoints, more tenants if applicable).\r\n- Include both backend enforcement and frontend experience patterns (UI should never be the only gate).\r\n- Prefer patterns that reduce \u201cpermission sprawl\u201d and minimize performance overhead.\r\n- Add a \u201cWhat This Is NOT\u201d subsection to clarify excluded scope.\r\n- Handle unclear or missing inputs by stating assumptions and offering 2\u20133 safe options.\r\n- Follow variable format compliance: user-provided values use [UPPERCASE_WITH_UNDERSCORES]; AI-filled placeholders use {Title Case}.\r\n\r\n## PROCESS\r\n1. **Pre-Analysis (required):** Restate the situation in your own words, list the key security risks you\u2019re addressing, and confirm the main technical constraints inferred from the inputs.\r\n2. **RBAC model design:** Define roles, permissions, resources, and actions; decide on role hierarchy vs. flat roles; include escalation-resistant admin patterns.\r\n3. **Data layer plan:** Propose a schema (tables\/collections), indexes, and constraints; include migration guidance and performance notes.\r\n4. **Enforcement layer:** Provide middleware\/guards\/hooks for backend authorization and token\/session strategy integration.\r\n5. **Frontend access patterns:** Show safe UI gating patterns (feature flags vs. authorization), including loading states and optimistic UI cautions.\r\n6. **Failure handling:** Design user-friendly denial flows, error payload conventions, and fallback components.\r\n7. **Validation:** Provide tests (unit\/integration\/e2e) that prove boundaries hold and cannot be bypassed.\r\n8. **Telemetry:** Specify audit events, log fields, alerting signals, and review workflows.\r\n9. **Deployment hardening:** Produce a rollout checklist that reduces lockouts and prevents \u201ctoo permissive\u201d regressions.\r\n\r\n### What This Is NOT\r\n- Not a full identity provider (IdP) selection guide or SSO procurement document.\r\n- Not a generic OWASP checklist dump.\r\n- Not permissioning based purely on frontend conditions.\r\n- Not a replacement for threat modeling beyond access control (you may note adjacent risks, but stay centered on RBAC).\r\n\r\n## INPUTS\r\n- **Application type:** [FORMAT]\r\n- **Technology stack:** [CONTEXT]\r\n- **Database system:** [INDUSTRY]\r\n- **Current authentication setup:** [PRODUCT_DESCRIPTION]\r\n- **User base size + growth expectation:** [TARGET_AUDIENCE]\r\n\r\n## OUTPUT SPECIFICATION\r\nUse the following sections and populate each with concrete, buildable detail. Include code snippets in the dominant stack implied by [CONTEXT], and tailor data structures to [INDUSTRY]. Use these placeholders where needed: {Role}, {Permission}, {Resource}, {Action}, {Endpoint}, {Table}, {Column}, {Index}, {Error Code}, {Log Event}.\r\n\r\n### Role Architecture\r\n- {Role} catalog with purpose, allowed {Action}s, and guarded {Resource}s  \r\n- Role hierarchy or composition strategy (and why)  \r\n- Admin design that avoids \u201cgod mode\u201d by default (break-glass, time-bound elevation, approvals if applicable)  \r\n- Least-privilege defaults and onboarding\/offboarding implications  \r\n\r\n### Database Schema\r\n- Tables\/collections for users, roles, permissions, and mappings (e.g., user\u2194role, role\u2194permission)  \r\n- Constraints, indexes, and query patterns for fast checks  \r\n- Guidance for multi-tenant support if relevant (safe scoping rules)  \r\n- Example migrations or schema definitions matching [INDUSTRY]  \r\n\r\n### Middleware Implementation\r\n- Backend authorization middleware\/guards with:\r\n  - token\/session parsing tied to [PRODUCT_DESCRIPTION]\r\n  - permission resolution (cached where appropriate)\r\n  - deny-by-default logic and explicit checks\r\n- Frontend hooks\/utilities for permission queries (never authoritative alone)\r\n- Examples:\r\n  - checking {Permission} for {Endpoint}\r\n  - securing sensitive admin actions\r\n  - preventing IDOR-style access to {Resource} by ownership\/tenant scope  \r\n\r\n### UI Access Control\r\n- Component patterns for conditional rendering with safe defaults  \r\n- Strategies for route-level gating, feature visibility vs. capability enforcement  \r\n- Loading\/unknown-permission states and \u201crequest access\u201d UX  \r\n- Guidance to avoid leaking sensitive data via prefetching or cached responses  \r\n\r\n### API Route Protection\r\n- Endpoint policy mapping: {Endpoint} \u2192 required {Permission}s  \r\n- Object-level authorization (resource ownership\/tenant boundaries)  \r\n- Rate limiting and abuse controls where RBAC intersects with brute-force\/admin endpoints  \r\n- Examples in the primary backend framework implied by [CONTEXT]  \r\n\r\n### Error Handling\r\n- Standard error contract (e.g., {Error Code}, message, correlation id)  \r\n- User-facing copy that\u2019s helpful without revealing sensitive authorization logic  \r\n- Fallback UI components for forbidden\/unauthenticated states  \r\n- Safe redirects and post-login continuation patterns  \r\n\r\n### Testing Strategy\r\n- Unit tests for permission evaluation  \r\n- Integration tests for middleware and endpoint coverage  \r\n- E2E tests for common role journeys and regression traps  \r\n- Negative tests proving privilege escalation is blocked (role tampering, token replay, forced browsing)  \r\n\r\n### Monitoring & Audit\r\n- Audit log schema and storage guidance:\r\n  - {Log Event} types (role change, permission change, denied access, admin actions)\r\n  - required fields (actor, target, resource, scope, timestamp, request id)\r\n- Alerting signals (spikes in denied access, repeated admin probing, anomalous role changes)\r\n- Review\/retention policy recommendations aligned to enterprise expectations  \r\n\r\n### Deployment Checklist\r\n- Rollout plan to avoid lockouts (staged enforcement, shadow mode, allowlists with expiry)  \r\n- Data backfill\/migration steps for existing users  \r\n- Performance checks (cache hit rates, authz query latency)  \r\n- Security verification gates before release  \r\n\r\n## QUALITY CHECKS\r\nAt the end, include a short verification list confirming:\r\n- Least-privilege defaults are enforced and \u201cimplicit allow\u201d is eliminated.\r\n- Authorization is enforced server-side for every protected {Endpoint} and object-level access is handled.\r\n- Schema supports growth (more roles\/permissions\/users) without slow permission checks.\r\n- Tests include negative cases for privilege escalation and forced browsing.\r\n- Audit trails capture role\/permission changes and sensitive access attempts with enough context to investigate.";
    const variables = ["[UPPERCASE_WITH_UNDERSCORES]","[FORMAT]","[CONTEXT]","[INDUSTRY]","[PRODUCT_DESCRIPTION]","[TARGET_AUDIENCE]"];
    // Initial render with highlighted variables
    document.addEventListener('DOMContentLoaded', function() {
        renderPromptWithHighlights();
    });

    // Live update prompt as user types
    document.querySelectorAll('.customize-input').forEach(input => {
        input.addEventListener('input', renderPromptWithHighlights);
    });

    function renderPromptWithHighlights() {
        const promptContent = document.getElementById('premium-prompt-content');
        if (!promptContent) return;

        let updatedPrompt = originalPrompt;
        let filledVariables = {};

        // Collect filled values
        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                filledVariables[placeholder] = value;
            }
        });

        // Replace filled variables and highlight remaining
        let htmlContent = escapeHtml(updatedPrompt);

        variables.forEach(placeholder => {
            const escapedPlaceholder = escapeHtml(placeholder);
            const regex = new RegExp(escapeRegex(escapedPlaceholder), 'g');

            if (filledVariables[placeholder]) {
                // Show filled value with green highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable-filled">' + escapeHtml(filledVariables[placeholder]) + '</span>'
                );
            } else {
                // Show original placeholder with yellow highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable">' + escapedPlaceholder + '</span>'
                );
            }
        });

        promptContent.innerHTML = htmlContent;
    }

    function escapeRegex(string) {
        return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    }

    function escapeHtml(text) {
        const div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function resetPrompt() {
        // Clear all input fields
        document.querySelectorAll('.customize-input').forEach(input => {
            input.value = '';
        });

        // Re-render with original placeholders highlighted
        renderPromptWithHighlights();

        // Visual feedback
        const resetBtns = document.querySelectorAll('.prompt-header-reset, .prompt-cta-reset');
        resetBtns.forEach(btn => {
            const originalText = btn.querySelector('span').textContent;
            btn.querySelector('span').textContent = 'Reset!';
            setTimeout(() => {
                btn.querySelector('span').textContent = originalText;
            }, 1000);
        });
    }


    function getCustomizedPrompt() {
        let updatedPrompt = originalPrompt;

        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                const regex = new RegExp(escapeRegex(placeholder), 'g');
                updatedPrompt = updatedPrompt.replace(regex, value);
            }
        });

        return updatedPrompt;
    }
</script>

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>Bring a real resource map, not just “users and admins”.</strong> Before you run the prompt, list 10–30 concrete resources and verbs (for example: “Invoices: create, view, refund, export” and “Users: invite, deactivate, reset MFA”). If you only say “secure my app,” you will get abstract roles that fall apart the moment a new endpoint ships.</li>


<li><strong>Force explicit deny-by-default in the output.</strong> After you get the first draft, follow up with: “Show me the deny-by-default rule and the exact middleware/guard behavior when a permission is missing.” This keeps the design from drifting into “allow unless blocked,” which honestly is how privilege escalation sneaks in.</li>


<li><strong>Ask it to model your riskiest flows first.</strong> Pick 2–3 scenarios like “refunds,” “PII export,” or “role assignment,” and prompt: “Design roles and permissions around these flows, then generalize.” You will get cleaner separation of duties and less permission sprawl than starting from org charts.</li>


<li><strong>Iterate on role granularity with targeted contrasts.</strong> After the first output, try asking: “Now make option 2 more aggressive (fewer roles, broader permissions) and option 4 more conservative (more separation of duties), then score each for auditability and developer friction.” Seeing tradeoffs side-by-side makes stakeholder approval much faster.</li>


<li><strong>Combine RBAC with auditing requirements as a second pass.</strong> Once roles and middleware are drafted, ask: “Add an audit event taxonomy with event names, required fields, retention guidance, and 3 example log lines for the most sensitive actions.” It turns a theoretical RBAC model into something you can defend during an incident review.</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>If you’re building serious systems documentation, these prompts can help you produce clean, reviewable artifacts quickly (just in very different formats).</p>



<p>If you also need a tight, memorable way to communicate a complex initiative internally, <a href="https://flowpast.com/prompts/write-a-singable-song-chorus-with-this-ai-prompt/">Write a Singable Song Chorus with this AI Prompt</a> can be a surprisingly useful creative constraint. Use it when you’re crafting security training hooks or internal campaign lines that teams actually remember.</p>



<p>For teams doing polished enablement content, <a href="https://flowpast.com/prompts/compose-a-catchy-song-melody-blueprint-with-this-ai-prompt/">Compose a Catchy Song Melody Blueprint with this AI Prompt</a> pairs well when your rollout needs a structured “blueprint” mindset. Different domain, same advantage: you get a repeatable plan instead of improvising every time.</p>



<p>When your org needs a step-by-step sequence for deliverables and checkpoints, <a href="https://flowpast.com/prompts/build-a-song-arrangement-blueprint-with-this-ai-prompt/">Build a Song Arrangement Blueprint with this AI Prompt</a> is a handy reference for turning raw ideas into a staged outline. That can complement an RBAC rollout plan where sequencing matters: schema first, then enforcement, then tests, then audits.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/write-a-singable-song-chorus-with-this-ai-prompt/">Write a Singable Song Chorus with this AI Prompt</a>: Memorable internal messaging and training hooks.</li>


<li><a href="https://flowpast.com/prompts/compose-a-catchy-song-melody-blueprint-with-this-ai-prompt/">Compose a Catchy Song Melody Blueprint with this AI Prompt</a>: Structured blueprint for creative deliverables.</li>


<li><a href="https://flowpast.com/prompts/build-a-song-arrangement-blueprint-with-this-ai-prompt/">Build a Song Arrangement Blueprint with this AI Prompt</a>: Step-by-step outline with sequencing.</li>

<li><a href="https://flowpast.com/prompts/write-a-shakespearean-solo-monologue-with-this-ai-prompt/">Write a Shakespearean Solo Monologue with this AI Prompt</a>: Dramatic narrative for presentations and scripts.</li>

<li><a href="https://flowpast.com/prompts/create-a-five-poem-anthology-with-this-ai-prompt/">Create a Five-Poem Anthology with this AI Prompt</a>: Themed set of pieces for campaigns.</li>
<!-- /wp:post-content -->
</ul>
<!-- /wp:list -->
</div>

<div class="faq-section">
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading">Common Questions</h2>
<!-- /wp:heading -->

<div class="faq-item">
<span class="question">Which roles benefit most from this enterprise RBAC plan AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>Software Architects</strong> use this to turn “we need RBAC” into a concrete model with roles, resources, actions, and enforcement layers that match real request flows. <strong>Security Engineers</strong> rely on it to bake in deny-by-default, least privilege, and separation of duties, plus audit events that stand up during reviews. <strong>Engineering Managers</strong> apply it when multiple teams ship services and authorization logic starts diverging, creating gaps and inconsistent behavior. <strong>Technical Product Managers</strong> use it to define role requirements, UX gating expectations, and acceptance criteria without hand-waving.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this enterprise RBAC plan AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>SaaS platforms selling to mid-market and enterprise</strong> get value because customers expect clear roles, tenant-aware access, and predictable permission checks across APIs and UI. <strong>Fintech and payments</strong> teams use it to reduce fraud and internal misuse by separating duties for high-risk actions like refunds, exports, and payout changes, then backing it with audit trails. <strong>Healthcare and health tech</strong> apply it when PHI access must be tightly scoped by role and context, and audit logging needs to be consistent across services. <strong>B2B marketplaces</strong> use it to manage access for multiple parties (buyers, sellers, operators) while preventing cross-tenant data leakage as the platform scales.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for designing an RBAC blueprint produce weak results?</span>
<!-- wp:paragraph -->
<p class="answer">A typical prompt like “Write me an RBAC system for my app” fails because it: lacks a deny-by-default stance with explicit guard behavior, provides no concrete schema or indexing plan for performant permission checks, ignores separation of duties and admin escalation paths (where most real abuse happens), produces generic roles like “Admin/User” instead of mapping permissions to resources and actions, and misses operational pieces like tests, audits, and a clear “What This Is NOT” scope that prevents false security confidence.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Can I customize this enterprise RBAC plan prompt for my specific situation?</span>
<!-- wp:paragraph -->
<p class="answer">Yes. Even though the prompt has zero form variables, you customize it by adding your own placeholders in the required format, like [APPLICATION_TYPE], [TENANCY_MODEL], [SENSITIVE_ACTIONS], and [COMPLIANCE_REQUIREMENTS], then letting the model fill {Title Case} sections. If details are unclear, explicitly ask it to state assumptions and offer 2–3 safe options, then pick one and rerun the prompt with that decision locked. A good follow-up is: “Revise the RBAC blueprint assuming [TENANCY_MODEL]=‘single database, tenant_id on every row’ and [SENSITIVE_ACTIONS]=‘export PII, change billing, manage roles’.”</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this enterprise RBAC plan prompt?</span>
<!-- wp:paragraph -->
<p class="answer">The biggest mistake is leaving [SENSITIVE_ACTIONS] too vague — instead of “admin stuff,” try “role assignment, data export, refunds, API key creation, and impersonation.” Another common error is forgetting the tenant shape in [TENANCY_MODEL]; “multi-tenant” is not enough, but “shared DB with tenant_id and occasional cross-tenant operator access” is workable. Teams also under-specify [RESOURCES_AND_ACTIONS], which leads to fluffy roles; provide a list like “Invoices:view/refund/export” rather than “billing.” Finally, people skip [CURRENT_AUTH_GAPS]; “some endpoints are open” is weak, but “GET /reports/export has no server-side check” gives the prompt something concrete to close.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Who should NOT use this enterprise RBAC plan prompt?</span>
<!-- wp:paragraph -->
<p class="answer">This prompt isn’t ideal for one-off prototypes where you will not implement server-side enforcement or tests, because the blueprint is intentionally thorough. It’s also a poor fit if you have not validated what your roles even represent (for example, no clear resources, no defined sensitive actions), since the model will be forced to make broad assumptions. If you only need a quick UI-only gating concept, use a lightweight feature-flag approach instead, then come back once you’re ready to enforce authorization in the backend.</p>
<!-- /wp:paragraph -->
</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this enterprise RBAC plan AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Software Architects use this to turn “we need RBAC” into a concrete model with roles, resources, actions, and enforcement layers that match real request flows. Security Engineers rely on it to bake in deny-by-default, least privilege, and separation of duties, plus audit events that stand up during reviews. Engineering Managers apply it when multiple teams ship services and authorization logic starts diverging, creating gaps and inconsistent behavior. Technical Product Managers use it to define role requirements, UX gating expectations, and acceptance criteria without hand-waving."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this enterprise RBAC plan AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SaaS platforms selling to mid-market and enterprise get value because customers expect clear roles, tenant-aware access, and predictable permission checks across APIs and UI. Fintech and payments teams use it to reduce fraud and internal misuse by separating duties for high-risk actions like refunds, exports, and payout changes, then backing it with audit trails. Healthcare and health tech apply it when PHI access must be tightly scoped by role and context, and audit logging needs to be consistent across services. B2B marketplaces use it to manage access for multiple parties (buyers, sellers, operators) while preventing cross-tenant data leakage as the platform scales."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for designing an RBAC blueprint produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like “Write me an RBAC system for my app” fails because it: lacks a deny-by-default stance with explicit guard behavior, provides no concrete schema or indexing plan for performant permission checks, ignores separation of duties and admin escalation paths (where most real abuse happens), produces generic roles like “Admin/User” instead of mapping permissions to resources and actions, and misses operational pieces like tests, audits, and a clear “What This Is NOT” scope that prevents false security confidence."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this enterprise RBAC plan prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. Even though the prompt has zero form variables, you customize it by adding your own placeholders in the required format, like [APPLICATION_TYPE], [TENANCY_MODEL], [SENSITIVE_ACTIONS], and [COMPLIANCE_REQUIREMENTS], then letting the model fill {Title Case} sections. If details are unclear, explicitly ask it to state assumptions and offer 2–3 safe options, then pick one and rerun the prompt with that decision locked. A good follow-up is: “Revise the RBAC blueprint assuming [TENANCY_MODEL]=‘single database, tenant_id on every row’ and [SENSITIVE_ACTIONS]=‘export PII, change billing, manage roles’.”"
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this enterprise RBAC plan prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving [SENSITIVE_ACTIONS] too vague — instead of “admin stuff,” try “role assignment, data export, refunds, API key creation, and impersonation.” Another common error is forgetting the tenant shape in [TENANCY_MODEL]; “multi-tenant” is not enough, but “shared DB with tenant_id and occasional cross-tenant operator access” is workable. Teams also under-specify [RESOURCES_AND_ACTIONS], which leads to fluffy roles; provide a list like “Invoices:view/refund/export” rather than “billing.” Finally, people skip [CURRENT_AUTH_GAPS]; “some endpoints are open” is weak, but “GET /reports/export has no server-side check” gives the prompt something concrete to close."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this enterprise RBAC plan prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for one-off prototypes where you will not implement server-side enforcement or tests, because the blueprint is intentionally thorough. It’s also a poor fit if you have not validated what your roles even represent (for example, no clear resources, no defined sensitive actions), since the model will be forced to make broad assumptions. If you only need a quick UI-only gating concept, use a lightweight feature-flag approach instead, then come back once you’re ready to enforce authorization in the backend."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">
<!-- wp:paragraph -->
<p>RBAC is easy to describe and hard to keep correct at scale. Use this prompt to get a defendable, implementation-ready access control plan you can ship, test, and audit.</p>
<!-- /wp:paragraph -->
</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5001442.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Build Layered API Rate Limits with this AI Prompt</title>
		<link>https://flowpast.com/prompts/build-layered-api-rate-limits-with-this-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:50:32 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5001441</guid>

					<description><![CDATA[Scrapers overrun your API - the ultimate AI Prompt that designs layered rate limits with code, 429 handling, telemetry, tests, and rollout. Discover more AI prompts for marketing, sales, and ops.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: API rate limits -->
<div class="hook-introduction">

<p>Your API works fine. Until it doesn’t. One scraper hits a single endpoint, retries aggressively, rotates IPs, and suddenly legit users are seeing timeouts, higher latency, and a flood of “why is this broken?” messages.</p>



<p>This <strong>API rate limits</strong> prompt is built for <strong>backend engineers</strong> who need a production-ready throttling plan without weeks of trial-and-error, <strong>platform leads</strong> trying to stop abusive traffic without punishing power users, and <strong>DevOps/SRE teams</strong> who must add visibility, alerts, and safe rollouts before the next surge. The output is a deployable blueprint: layered IP + identity controls, storage backend options, middleware-style code examples, 429 + Retry-After guidance, telemetry, tests, and a low-risk rollout checklist.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It models likely abuse paths (bursts, retry storms, credential stuffing, IP rotation) and converts them into concrete rate-limit rules.</li>
          <li>It designs layered throttling with at least two independent enforcement layers (IP-based plus identity-based), including guidance for unauthenticated traffic.</li>
          <li>It specifies scalable state storage patterns for counters and windows, from local memory to shared cache and distributed backends.</li>
          <li>It generates code-oriented, middleware-style examples that you can adapt to your stack, while keeping the core approach framework-agnostic.</li>
          <li>It defines operational visibility: logs, metrics, dashboards, alerts, and what signals to watch as attackers change tactics.</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>You are seeing sudden 429s, timeouts, or elevated p95 latency during traffic spikes and you need protection without downtime.</li>
          <li>Scrapers are draining quota or inflating infra bills, especially on “list,” “search,” “export,” or “pricing” endpoints.</li>
          <li>You have authentication for some routes but also support public endpoints, and you need sane rules for both.</li>
          <li>Attackers are bypassing naive IP limits by rotating addresses, distributing requests, or abusing retry behavior.</li>
          <li>You are about to launch, get featured, or open an integration program, and you want guardrails before growth stress-tests you.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A layered rate-limit blueprint with at least 2 enforcement layers plus one fallback behavior for edge cases.</li>
           <li>Endpoint-by-endpoint policy suggestions (examples: burst vs sustained limits) with a short rationale for each.</li>
           <li>Ready-to-adapt middleware/pseudocode showing request keying, counter updates, and consistent limit evaluation.</li>
           <li>A 429 response contract including Retry-After guidance and client-safe error messaging that avoids leaking internals.</li>
           <li>A validation + rollout plan: test matrix, load simulation outline, and step-by-step staged deployment checklist.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: Layered API Rate-Limiting Blueprint Generator</h2>



<div class="prompt-viewer-wrapper" id="prompt-section">
    <div class="prompt-comparison-row prompt-premium">
        <!-- Header with buttons -->
        <div class="prompt-row-header">
            <!-- <span class="prompt-row-icon">✨</span> -->
            <span class="prompt-row-title">
                                    Step 1: Customize the prompt with your input
                            </span>
            <div class="prompt-header-buttons">
                                    <button class="prompt-header-btn prompt-header-reset" onclick="resetPrompt()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                                <button class="prompt-header-btn prompt-header-copy-green flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span>Customize and Copy Full Prompt</span>
                </button>
            </div>
        </div>

        <!-- Customize the Prompt Section -->
                    <div class="prompt-customize-section">
                <span class="customize-title">Customize the Prompt</span>
                <p class="customize-subtitle">Fill in the fields below to personalize this prompt for your needs.</p>
                <table class="customize-table">
                    <thead>
                        <tr>
                            <th>Variable</th>
                            <th>What to Enter</th>
                            <th>Customise the prompt</th>
                        </tr>
                    </thead>
                    <tbody>
                                                    <tr>
                                <td class="var-name"><code>[FORMAT]</code></td>
                                <td class="var-desc">
                                    Specify the format in which the deliverable should be presented, such as text, diagrams, or code snippets.                                    <div class="var-example">For example: "A markdown document with embedded code examples and architecture diagrams."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[FORMAT]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[CONTEXT]</code></td>
                                <td class="var-desc">
                                    Provide background information about the API, including its purpose, typical usage patterns, and traffic characteristics.                                    <div class="var-example">For example: "A public API for a social media platform handling 10M daily active users with frequent data retrieval and posting operations."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[CONTEXT]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[INDUSTRY]</code></td>
                                <td class="var-desc">
                                    Describe the industry or domain the API serves, as this can influence abuse patterns and rate-limiting strategies.                                    <div class="var-example">For example: "E-commerce platform with APIs for product search, inventory updates, and checkout processing."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[INDUSTRY]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[CHALLENGE]</code></td>
                                <td class="var-desc">
                                    Explain the main problem or threat the rate-limiting solution needs to address, such as traffic surges or targeted abuse.                                    <div class="var-example">For example: "Mitigating credential stuffing attacks and preventing unauthenticated scraping during flash sales events."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[CHALLENGE]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[TIMEFRAME]</code></td>
                                <td class="var-desc">
                                    Indicate the expected timeline for delivering the solution, including any milestones or deadlines.                                    <div class="var-example">For example: "Two months for full implementation, including testing and phased rollout."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[TIMEFRAME]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                            </tbody>
                </table>

                <button class="copy-customized-btn flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span class="copy-customized-text">Customise the prompt now</span>
                </button>
            </div>
        
        <!-- Full Prompt Code Header -->
                    <div class="prompt-code-header">
                <span class="prompt-code-title">
                    Step 2: Copy the Prompt
                </span>
                <div class="prompt-code-buttons">
                    <!-- Reset: Only visible when unlocked -->
                    <button class="prompt-header-btn prompt-header-reset btn-when-unlocked" onclick="resetPrompt()" style="display: none;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                    <!-- Copy Full Prompt -->
                    <button class="prompt-header-btn prompt-header-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                            <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                        </svg>
                        <span>Copy Full Prompt</span>
                    </button>
                </div>
            </div>
        

        <!-- Prompt Content -->
        <div class="prompt-box prompt-gated-wrapper">
            <!-- Gated: Blurred content -->
            <div class="prompt-gated-content">
                <div class="prompt-header-visible">OBJECTIVE</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PERSONA</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">CONSTRAINTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">What This Is NOT (Scope Boundaries)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PROCESS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Edge Case Handling</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">INPUTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">OUTPUT SPECIFICATION</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">QUALITY CHECKS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div>            </div>
            <!-- Unlocked: Full content (hidden by default) -->
            <div class="prompt-content-full" id="premium-prompt-content" style="display: none;">
                ## OBJECTIVE
Create a production-grade API rate-limiting blueprint and implementation guide that withstands traffic surges and active abuse. The deliverable must cover layered throttling (IP + identity), scalable state storage, safe client messaging, and operational visibility—without degrading legitimate user experience.

## PERSONA
Act as a seasoned API defense engineer who has designed anti-abuse controls for high-volume enterprise platforms. You prioritize attacker behavior modeling, adaptive controls, and practical implementations that survive real-world load and evasion tactics. Write with crisp, engineering-focused clarity.

## CONSTRAINTS
- Provide concrete, deployable patterns; avoid generic “secure your API” advice.
- Use multi-layer protection (at least two independent enforcement layers plus a fallback behavior).
- Include both IP-based and user/identity-based throttling, with guidance for unauthenticated traffic.
- Offer framework-agnostic concepts plus code-oriented middleware examples tailored to the stated stack.
- Recommend state backends appropriate to scale (local memory, shared cache, distributed options).
- 429 handling must include **Retry-After** and client-safe messaging that does not leak internals.
- Include logging, monitoring, and alerting plans aimed at discovering evolving abuse patterns.
- Address performance overhead and tuning.
- Include a validation plan (tests + load simulation) and a low-risk rollout plan.

### What This Is NOT (Scope Boundaries)
- Not a full WAF/CDN vendor selection report.
- Not a complete IAM/auth redesign (only cover identity signals needed for rate limiting).
- Not malware forensics or incident response playbooks beyond logging/alerting needed for throttling.
- Not compliance legal guidance; only technical measures mapped to stated requirements.

## PROCESS
1. **Pre-analysis (required):** Restate your understanding of the API scenario, likely abuse modes, and success criteria based on the provided inputs. List any assumptions.
2. **Threat-to-control mapping:** Translate the stated threats into specific throttles (burst, sustained, endpoint-sensitive, credential stuffing-style patterns, scraping heuristics).
3. **Layered design:** Specify at minimum:
   - Edge or gateway control (coarse limiting)
   - Application middleware control (fine-grained limiting)
   - A fallback/containment mode when dependencies fail (e.g., storage outage)
4. **Middleware build plan:** Provide implementation patterns for:
   - IP keying (including proxy/CDN header handling guidance)
   - User/identity keying (user ID, API key, session, device fingerprint where appropriate)
   - Combined keys (e.g., per-user-per-endpoint) and endpoint weighting
5. **State storage decisioning:** Recommend the backend(s) with clear thresholds for when to move from in-process to shared/distributed stores. Include setup notes.
6. **Client response behavior:** Define 429 structure, headers, and message templates that help clients recover without revealing architecture.
7. **Observability:** Define log schema, metrics, dashboards, and alert rules; include examples of queries/patterns to detect abuse evolution.
8. **Performance &amp; tuning:** List optimizations (hot paths, sampling, async logging, local caches, Lua/scripts if Redis, etc.).
9. **Validation:** Provide unit/integration tests, adversarial test cases, and load tests. Include acceptance criteria.
10. **Rollout:** Provide a staged deployment plan over **4–6 phases** with monitoring gates and rollback triggers.

### Edge Case Handling
- If any input is missing or ambiguous, ask targeted clarifying questions first. If the user requests immediate output anyway, proceed with reasonable defaults and clearly label them as assumptions.
- If the stack cannot support a recommended tactic, provide an alternative that preserves the same security intent.
- If strict limiting conflicts with performance constraints, propose adaptive limits and “grace” mechanisms for trusted clients.

## INPUTS
- **Application type:** [FORMAT]
- **Traffic profile (baseline + peak + spike shape):** [CONTEXT]
- **Technology stack (framework, runtime, infra, DB):** [INDUSTRY]
- **Security requirements (threats + compliance):** [CHALLENGE]
- **Performance constraints (latency/throughput SLOs):** [TIMEFRAME]

## OUTPUT SPECIFICATION
Use markdown headings and provide sections in this exact order:

1. **Rate Limiting Architecture**
   - {Threat Model Summary}
   - {Layered Controls Overview}
   - {Keying Strategy} (IP, user, combined, endpoint sensitivity)
   - {Adaptive Rules} (burst vs sustained, anomaly triggers)

2. **Middleware Implementation**
   - {Middleware Approach} (where it runs, how it’s composed)
   - {IP Throttle Example} (code-oriented pseudocode or stack-specific sample)
   - {User/Identity Throttle Example}
   - {Composite &amp; Endpoint-Weighted Limits}
   - {Failure Modes &amp; Fallback Behavior}

3. **State Storage &amp; Configuration**
   - {When In-Memory Is Acceptable}
   - {When Shared/Distributed Storage Is Required}
   - {Redis/Upstash-Style Setup Notes}
   - {Key Design, TTLs, Atomicity Notes}

4. **429 Responses &amp; Client Guidance**
   - {Response Schema}
   - {Retry-After Strategy}
   - {Safe Message Examples} (rewritten, non-revealing)
   - {Handling for Auth vs Unauth Clients}

5. **Logging, Monitoring, and Alerting**
   - {Log Fields &amp; Structure}
   - {Metrics to Emit}
   - {Dashboards}
   - {Alert Rules}
   - {Abuse Pattern Detection Examples}

6. **Performance Optimization**
   - {Hot Path Optimizations}
   - {Caching &amp; Sampling Guidance}
   - {Distributed Store Latency Mitigations}

7. **Testing &amp; Validation**
   - {Unit Tests}
   - {Integration Tests}
   - {Adversarial Scenarios}
   - {Load/Spike Tests}
   - {Pass/Fail Criteria}

8. **Deployment &amp; Gradual Rollout**
   - {Phase Plan}
   - {Monitoring Gates}
   - {Rollback Triggers}
   - {Post-Launch Tuning Loop}

## QUALITY CHECKS
Before finalizing, verify:
- The plan includes at least two enforcement layers plus a defined fallback mode.
- Both IP-based and identity-based throttles are implemented with clear key definitions.
- 429 handling includes Retry-After and client-safe wording that avoids leaking internals.
- Storage recommendations are tied to the provided traffic scale and performance constraints.
- Testing and rollout steps are actionable and include measurable acceptance criteria.            </div>
        </div>


    </div>

    <!-- CTA Row - Full width buttons -->
    <div class="prompt-cta-row">
        <button class="prompt-cta-btn prompt-cta-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
            </svg>
            <span class="cta-copy-text">Copy Full Prompt</span>
        </button>
    </div>
</div>

<style>
    /* Gated prompt states */
    .prompt-gated-wrapper {
        position: relative;
    }

    /* When unlocked - show full content, hide gated */
    body.flowpast-unlocked .prompt-gated-wrapper .prompt-gated-content {
        display: none;
    }

    body.flowpast-unlocked .prompt-gated-wrapper .prompt-content-full {
        display: block !important;
    }

    /* Show/hide elements based on unlock state */
    body.flowpast-unlocked .btn-when-unlocked {
        display: inline-flex !important;
    }

    .prompt-viewer-wrapper {
        scroll-margin-top: 250px;
    }

    /* ========================================
   PROMPT VIEWER - MAIN WRAPPER
   ======================================== */
    .prompt-viewer-wrapper {
        margin: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ========================================
   PROMPT BOX CONTAINER
   ======================================== */
    .prompt-comparison-row {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    /* ========================================
   HEADER WITH BUTTONS
   ======================================== */
    .prompt-row-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .prompt-row-icon {
        font-size: 20px;
    }

    .prompt-row-title {
        font-weight: 600;
        font-size: 22px;
        color: #fff !important;
        text-decoration: underline
    }

    .prompt-header-buttons {
        margin-left: auto;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Header buttons */
    .prompt-header-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-header-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-header-copy:hover {
        background: #2a2a2a;
    }

    .prompt-header-copy.copied {
        background: #2e7d32;
    }

    .prompt-header-copy-green {
        background: #04AA6D !important;
        color: #fff !important;
    }

    .prompt-header-copy-green:hover {
        background: #039860 !important;
    }

    .prompt-header-copy-green.copied {
        background: #2e7d32 !important;
    }

    .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-header-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-1px);
    }

    /* ========================================
   PROMPT CONTENT - FULL (NO SCROLL)
   ======================================== */
    .prompt-box {
        background: #ffffff;
    }

    .prompt-content-full {
        padding: 24px;
        margin: 0;
        color: #202124;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.7;
        white-space: pre-wrap;
        word-wrap: break-word;
        /* No scroll - show full content */
        max-height: none;
        overflow: visible;
    }

    /* Highlighted variable in prompt */
    .prompt-variable {
        background: #fff3cd;
        color: #1967d2;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ffc107;
    }

    .prompt-variable-filled {
        background: #d4edda;
        color: #155724;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #28a745;
    }

    /* ========================================
   GATED CONTENT (NO ACCESS)
   ======================================== */
    .prompt-gated-content {
        padding: 24px;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.8;
        max-height: none;
        overflow: visible;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        cursor: default;
    }

    /* ## headers - larger, black */
    .prompt-header-visible {
        color: #202124;
        font-weight: 600;
        margin: 5px 0 0px 0;
        font-size: 20px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* ### headers - smaller, black */
    .prompt-header-visible.subheader {
        color: #202124;
        font-weight: 600;
        margin: 5px 0;
        font-size: 18px;
    }

    .prompt-header-visible:first-child {
        margin-top: 0;
    }

    /* ========================================
   LOCKED SECTION BLOCK
   ======================================== */
    .locked-section {
        position: relative;
        margin: 4px 0 8px 0;
        border-radius: 6px;
        overflow: hidden;
        background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .locked-section-bg {
        position: relative;
    }

    .locked-section-lines {
        padding: 8px 12px;
        position: relative;
    }

    .locked-line {
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 3px;
        margin-bottom: 4px;
        margin-left: 12px;
    }

    .locked-line:last-child {
        margin-bottom: 0;
    }

    .locked-section-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        font-size: 24px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }

    /* Subheader locked sections - slightly indented */
    /*  .prompt-header-visible.subheader+.locked-section {
        margin-left: 16px;
    } */

    /* ========================================
   COMPATIBILITY BADGES
   ======================================== */
    .prompt-compatibility {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
    }

    .compat-label {
        font-size: 13px;
        color: #5f6368;
        font-weight: 500;
    }

    .compat-badge {
        padding: 4px 10px;
        background: #e8f0fe;
        color: #1967d2;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }

    /* ========================================
   CTA ROW - FULL WIDTH BUTTONS
   ======================================== */
    .prompt-cta-row {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .prompt-cta-btn {
        flex: 1;
        min-width: 200px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 24px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-cta-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-copy:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-copy.copied {
        background: #2e7d32;
    }

    .prompt-cta-reset {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-reset:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-cta-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    /* ========================================
    CUSTOMIZE YOUR PROMPT SECTION
    ======================================== */
    .prompt-customize-section {
        padding: 24px;
        border-bottom: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .customize-title {
        margin: 0 0 8px 0;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
    }

    .customize-subtitle {
        margin: 0 0 20px 0;
        font-size: 14px;
        color: #5f6368;
    }

    .customize-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .customize-table th {
        text-align: left;
        padding: 12px;
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        font-size: 13px;
        font-weight: 600;
        color: #202124;
    }

    .customize-table td {
        padding: 12px;
        border: 1px solid #e0e0e0;
        vertical-align: top;
    }

    .customize-table .var-name {
        width: 25%;
        background: #f8f9fa;
    }

    .customize-table .var-name code {
        background: #fff3cd;
        color: #1967d2;
        border: 1px solid #ffc107;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        word-break: break-all;
        font-weight: 600;
    }

    .customize-table .var-desc {
        width: 35%;
        font-size: 13px;
        color: #5f6368;
        line-height: 1.5;
    }

    .customize-table .var-example {
        margin-top: 8px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #dadce0;
        font-size: 12px;
        color: #5f6368;
        font-style: italic;
        border-radius: 0 4px 4px 0;
    }

    .customize-table .var-input {
        width: 40%;
    }

    .customize-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #dadce0;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .customize-input:focus {
        outline: none;
        border-color: rgb(5, 152, 98);
        box-shadow: 0 0 0 3px rgba(5, 152, 98, 0.1);
    }

    .customize-input::placeholder {
        color: #9aa0a6;
        font-style: italic;
    }

    .copy-customized-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: rgb(5, 152, 98);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .copy-customized-btn:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    .copy-customized-btn.copied {
        background: #2e7d32;
    }

    /* ========================================
    FULL PROMPT CODE HEADER
    ======================================== */
    .prompt-code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
    }

    .prompt-code-title {
        font-size: 22px;
        font-weight: 600;
        text-decoration: underline;

    }

    .prompt-code-buttons {
        display: flex;
        gap: 8px;
    }

    .prompt-code-buttons .prompt-header-btn {
        padding: 8px 14px;
        font-size: 13px;
        background: #ffffff;
        color: #202124;
        border: 1px solid #dadce0;
    }

    .prompt-code-buttons .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
        border-color: rgb(5, 152, 98);
    }

    .prompt-code-buttons .prompt-header-btn.prompt-header-access:hover {
        background: rgb(4, 130, 83) !important;
        border-color: rgb(4, 130, 83);
        color: #fff !important;
    }

    .prompt-code-buttons .prompt-header-btn:hover {
        background: #f1f3f4;
    }

    .prompt-code-buttons .prompt-header-copy.copied {
        background: #d4edda;
        color: #155724;
        border-color: #28a745;
    }

    .prompt-header-reset {
        background: #ffffff;
        color: #202124;
    }

    /* ========================================
   RESPONSIVE
   ======================================== */
    @media (max-width: 768px) {
        .prompt-row-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .prompt-header-buttons {
            margin-left: 0;
            width: 100%;
        }

        .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }

        .prompt-cta-row {
            flex-direction: column;
        }

        .prompt-cta-btn {
            width: 100%;
        }

        /* Customize table responsive */
        .customize-table,
        .customize-table thead,
        .customize-table tbody,
        .customize-table tr,
        .customize-table th,
        .customize-table td {
            display: block;
        }

        .customize-table thead {
            display: none;
        }

        .customize-table tr {
            margin-bottom: 16px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
        }

        .customize-table td {
            width: 100% !important;
            border: none;
            border-bottom: 1px solid #e0e0e0;
        }

        .customize-table td:last-child {
            border-bottom: none;
        }

        .customize-table .var-name {
            background: #f1f3f4;
            font-weight: 600;
        }

        .prompt-code-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }

        .prompt-code-buttons {
            width: 100%;
        }

        .prompt-code-buttons .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }
    }
</style>

<script>
    function handlePromptCopy() {
        // Check if unlocked via cookie
        if (typeof window.flowpastIsUnlocked === 'function' && !window.flowpastIsUnlocked()) {
            // Show email popup
            if (typeof window.flowpastShowEmailPopup === 'function') {
                window.flowpastShowEmailPopup('prompt');
            }
            return;
        }

        // Copy the customized prompt (with filled variables)
        const customizedPrompt = getCustomizedPrompt();
        const copyButtons = document.querySelectorAll('.prompt-header-copy, .prompt-header-copy-green, .prompt-cta-copy, .copy-customized-btn');

        navigator.clipboard.writeText(customizedPrompt).then(() => {
            copyButtons.forEach(btn => {
                btn.classList.add('copied');
                const textSpan = btn.querySelector('span');
                if (textSpan) textSpan.textContent = 'Copied!';
            });

            setTimeout(() => {
                copyButtons.forEach(btn => {
                    btn.classList.remove('copied');
                    const textSpan = btn.querySelector('span');
                    if (textSpan) textSpan.textContent = 'Copy Full Prompt';
                });
            }, 2000);
        }).catch(err => {
            console.error('Failed to copy:', err);
        });
    }

    // Store original prompt for customization
    const originalPrompt = "## OBJECTIVE\r\nCreate a production-grade API rate-limiting blueprint and implementation guide that withstands traffic surges and active abuse. The deliverable must cover layered throttling (IP + identity), scalable state storage, safe client messaging, and operational visibility\u2014without degrading legitimate user experience.\r\n\r\n## PERSONA\r\nAct as a seasoned API defense engineer who has designed anti-abuse controls for high-volume enterprise platforms. You prioritize attacker behavior modeling, adaptive controls, and practical implementations that survive real-world load and evasion tactics. Write with crisp, engineering-focused clarity.\r\n\r\n## CONSTRAINTS\r\n- Provide concrete, deployable patterns; avoid generic \u201csecure your API\u201d advice.\r\n- Use multi-layer protection (at least two independent enforcement layers plus a fallback behavior).\r\n- Include both IP-based and user\/identity-based throttling, with guidance for unauthenticated traffic.\r\n- Offer framework-agnostic concepts plus code-oriented middleware examples tailored to the stated stack.\r\n- Recommend state backends appropriate to scale (local memory, shared cache, distributed options).\r\n- 429 handling must include **Retry-After** and client-safe messaging that does not leak internals.\r\n- Include logging, monitoring, and alerting plans aimed at discovering evolving abuse patterns.\r\n- Address performance overhead and tuning.\r\n- Include a validation plan (tests + load simulation) and a low-risk rollout plan.\r\n\r\n### What This Is NOT (Scope Boundaries)\r\n- Not a full WAF\/CDN vendor selection report.\r\n- Not a complete IAM\/auth redesign (only cover identity signals needed for rate limiting).\r\n- Not malware forensics or incident response playbooks beyond logging\/alerting needed for throttling.\r\n- Not compliance legal guidance; only technical measures mapped to stated requirements.\r\n\r\n## PROCESS\r\n1. **Pre-analysis (required):** Restate your understanding of the API scenario, likely abuse modes, and success criteria based on the provided inputs. List any assumptions.\r\n2. **Threat-to-control mapping:** Translate the stated threats into specific throttles (burst, sustained, endpoint-sensitive, credential stuffing-style patterns, scraping heuristics).\r\n3. **Layered design:** Specify at minimum:\r\n   - Edge or gateway control (coarse limiting)\r\n   - Application middleware control (fine-grained limiting)\r\n   - A fallback\/containment mode when dependencies fail (e.g., storage outage)\r\n4. **Middleware build plan:** Provide implementation patterns for:\r\n   - IP keying (including proxy\/CDN header handling guidance)\r\n   - User\/identity keying (user ID, API key, session, device fingerprint where appropriate)\r\n   - Combined keys (e.g., per-user-per-endpoint) and endpoint weighting\r\n5. **State storage decisioning:** Recommend the backend(s) with clear thresholds for when to move from in-process to shared\/distributed stores. Include setup notes.\r\n6. **Client response behavior:** Define 429 structure, headers, and message templates that help clients recover without revealing architecture.\r\n7. **Observability:** Define log schema, metrics, dashboards, and alert rules; include examples of queries\/patterns to detect abuse evolution.\r\n8. **Performance & tuning:** List optimizations (hot paths, sampling, async logging, local caches, Lua\/scripts if Redis, etc.).\r\n9. **Validation:** Provide unit\/integration tests, adversarial test cases, and load tests. Include acceptance criteria.\r\n10. **Rollout:** Provide a staged deployment plan over **4\u20136 phases** with monitoring gates and rollback triggers.\r\n\r\n### Edge Case Handling\r\n- If any input is missing or ambiguous, ask targeted clarifying questions first. If the user requests immediate output anyway, proceed with reasonable defaults and clearly label them as assumptions.\r\n- If the stack cannot support a recommended tactic, provide an alternative that preserves the same security intent.\r\n- If strict limiting conflicts with performance constraints, propose adaptive limits and \u201cgrace\u201d mechanisms for trusted clients.\r\n\r\n## INPUTS\r\n- **Application type:** [FORMAT]\r\n- **Traffic profile (baseline + peak + spike shape):** [CONTEXT]\r\n- **Technology stack (framework, runtime, infra, DB):** [INDUSTRY]\r\n- **Security requirements (threats + compliance):** [CHALLENGE]\r\n- **Performance constraints (latency\/throughput SLOs):** [TIMEFRAME]\r\n\r\n## OUTPUT SPECIFICATION\r\nUse markdown headings and provide sections in this exact order:\r\n\r\n1. **Rate Limiting Architecture**\r\n   - {Threat Model Summary}\r\n   - {Layered Controls Overview}\r\n   - {Keying Strategy} (IP, user, combined, endpoint sensitivity)\r\n   - {Adaptive Rules} (burst vs sustained, anomaly triggers)\r\n\r\n2. **Middleware Implementation**\r\n   - {Middleware Approach} (where it runs, how it\u2019s composed)\r\n   - {IP Throttle Example} (code-oriented pseudocode or stack-specific sample)\r\n   - {User\/Identity Throttle Example}\r\n   - {Composite & Endpoint-Weighted Limits}\r\n   - {Failure Modes & Fallback Behavior}\r\n\r\n3. **State Storage & Configuration**\r\n   - {When In-Memory Is Acceptable}\r\n   - {When Shared\/Distributed Storage Is Required}\r\n   - {Redis\/Upstash-Style Setup Notes}\r\n   - {Key Design, TTLs, Atomicity Notes}\r\n\r\n4. **429 Responses & Client Guidance**\r\n   - {Response Schema}\r\n   - {Retry-After Strategy}\r\n   - {Safe Message Examples} (rewritten, non-revealing)\r\n   - {Handling for Auth vs Unauth Clients}\r\n\r\n5. **Logging, Monitoring, and Alerting**\r\n   - {Log Fields & Structure}\r\n   - {Metrics to Emit}\r\n   - {Dashboards}\r\n   - {Alert Rules}\r\n   - {Abuse Pattern Detection Examples}\r\n\r\n6. **Performance Optimization**\r\n   - {Hot Path Optimizations}\r\n   - {Caching & Sampling Guidance}\r\n   - {Distributed Store Latency Mitigations}\r\n\r\n7. **Testing & Validation**\r\n   - {Unit Tests}\r\n   - {Integration Tests}\r\n   - {Adversarial Scenarios}\r\n   - {Load\/Spike Tests}\r\n   - {Pass\/Fail Criteria}\r\n\r\n8. **Deployment & Gradual Rollout**\r\n   - {Phase Plan}\r\n   - {Monitoring Gates}\r\n   - {Rollback Triggers}\r\n   - {Post-Launch Tuning Loop}\r\n\r\n## QUALITY CHECKS\r\nBefore finalizing, verify:\r\n- The plan includes at least two enforcement layers plus a defined fallback mode.\r\n- Both IP-based and identity-based throttles are implemented with clear key definitions.\r\n- 429 handling includes Retry-After and client-safe wording that avoids leaking internals.\r\n- Storage recommendations are tied to the provided traffic scale and performance constraints.\r\n- Testing and rollout steps are actionable and include measurable acceptance criteria.";
    const variables = ["[FORMAT]","[CONTEXT]","[INDUSTRY]","[CHALLENGE]","[TIMEFRAME]"];
    // Initial render with highlighted variables
    document.addEventListener('DOMContentLoaded', function() {
        renderPromptWithHighlights();
    });

    // Live update prompt as user types
    document.querySelectorAll('.customize-input').forEach(input => {
        input.addEventListener('input', renderPromptWithHighlights);
    });

    function renderPromptWithHighlights() {
        const promptContent = document.getElementById('premium-prompt-content');
        if (!promptContent) return;

        let updatedPrompt = originalPrompt;
        let filledVariables = {};

        // Collect filled values
        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                filledVariables[placeholder] = value;
            }
        });

        // Replace filled variables and highlight remaining
        let htmlContent = escapeHtml(updatedPrompt);

        variables.forEach(placeholder => {
            const escapedPlaceholder = escapeHtml(placeholder);
            const regex = new RegExp(escapeRegex(escapedPlaceholder), 'g');

            if (filledVariables[placeholder]) {
                // Show filled value with green highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable-filled">' + escapeHtml(filledVariables[placeholder]) + '</span>'
                );
            } else {
                // Show original placeholder with yellow highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable">' + escapedPlaceholder + '</span>'
                );
            }
        });

        promptContent.innerHTML = htmlContent;
    }

    function escapeRegex(string) {
        return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    }

    function escapeHtml(text) {
        const div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function resetPrompt() {
        // Clear all input fields
        document.querySelectorAll('.customize-input').forEach(input => {
            input.value = '';
        });

        // Re-render with original placeholders highlighted
        renderPromptWithHighlights();

        // Visual feedback
        const resetBtns = document.querySelectorAll('.prompt-header-reset, .prompt-cta-reset');
        resetBtns.forEach(btn => {
            const originalText = btn.querySelector('span').textContent;
            btn.querySelector('span').textContent = 'Reset!';
            setTimeout(() => {
                btn.querySelector('span').textContent = originalText;
            }, 1000);
        });
    }


    function getCustomizedPrompt() {
        let updatedPrompt = originalPrompt;

        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                const regex = new RegExp(escapeRegex(placeholder), 'g');
                updatedPrompt = updatedPrompt.replace(regex, value);
            }
        });

        return updatedPrompt;
    }
</script>

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>List your “expensive endpoints” first.</strong> Give the AI a small table of routes with why they’re costly (DB fanout, third-party calls, exports). Example follow-up: “Here are 8 endpoints; mark which need burst limits vs sustained limits, and propose different windows for each.”</li>


<li><strong>Describe abusive traffic like a story.</strong> Add what you observed: user agents, referrers, IP ASNs, request patterns, retries, and peak RPS. Then ask: “Based on this pattern, what keys should we rate-limit on (IP, token, account, org, API key), and what evasions should we expect next?”</li>

<li><strong>Force explicit 429 contracts.</strong> Many teams forget the client experience. Ask the model to output the exact JSON body, headers (including Retry-After), and which fields are safe: “Write a 429 response spec for public endpoints vs authenticated endpoints; avoid revealing internal thresholds.”</li>


<li><strong>Iterate on tuning, not just rules.</strong> After the first pass, tighten it with a controlled prompt: “Now make option A more aggressive for anonymous traffic, but keep authenticated power users under 1% false positives. Explain the tradeoffs in 6 bullets.”</li>


<li><strong>Combine it with your observability reality.</strong> Tell it what you actually use (CloudWatch, Datadog, Grafana, ELK) and request concrete metric names and alert thresholds. A good follow-up: “Propose 10 metrics, 5 dashboards, and 6 alerts; include what each alert means and the likely next action.”</li>

</ul>
<!-- /wp:post-content -->
</div>

<div class="related-prompts-section">
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading">Related Prompts</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Once you’ve designed layered throttling, these related prompts help you operationalize the work across teams, process, and capacity.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you also need to standardize how engineering work moves from “incoming” to “done,” the maturity framework in <a href="https://flowpast.com/prompts/build-a-task-management-maturity-audit-with-this-ai-prompt/">Build a Task Management Maturity Audit with this AI Prompt</a> helps you spot bottlenecks that make rate-limit rollouts risky (unclear ownership, missing change windows, weak post-deploy checks). It pairs well when your problem isn’t only abuse, but slow execution and inconsistent follow-through.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For teams doing ongoing platform hardening, <a href="https://flowpast.com/prompts/build-an-adaptive-task-manager-blueprint-ai-prompt/">Build an Adaptive Task Manager Blueprint AI Prompt</a> is useful right after you generate your throttling blueprint. You can convert the rollout plan into a living system: recurring tuning tasks, dashboard reviews, and “attack pattern” retrospectives that don’t get forgotten.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>When rate limits touch multiple groups (API, SRE, support, and sometimes sales), miscommunication becomes its own incident. <a href="https://flowpast.com/prompts/create-a-task-handoff-playbook-with-this-ai-prompt/">Create a Task Handoff Playbook with this AI Prompt</a> helps you define who owns policy changes, who handles customer escalations about 429s, and what needs to be documented before toggling stricter rules.</p>
<!-- /wp:paragraph -->

<br>

<!-- wp:paragraph -->
<p>Quick reference:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul>
<!-- wp:list-item -->
<li><a href="https://flowpast.com/prompts/build-a-task-management-maturity-audit-with-this-ai-prompt/">Build a Task Management Maturity Audit with this AI Prompt</a>: Diagnose process gaps blocking safe rollouts.</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li><a href="https://flowpast.com/prompts/build-an-adaptive-task-manager-blueprint-ai-prompt/">Build an Adaptive Task Manager Blueprint AI Prompt</a>: Turn the plan into recurring ops tasks.</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li><a href="https://flowpast.com/prompts/build-a-talent-management-blueprint-with-this-ai-prompt/">Build a Talent Management Blueprint with this AI Prompt</a>: Staff ownership for platform reliability work.</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li><a href="https://flowpast.com/prompts/build-an-inventory-management-blueprint-with-this-ai-prompt/">Build an Inventory Management Blueprint with this AI Prompt</a>: Improve tracking of “rate-limit dependencies” as assets.</li>
<!-- /wp:list-item -->
<!-- wp:list-item -->
<li><a href="https://flowpast.com/prompts/create-a-task-handoff-playbook-with-this-ai-prompt/">Create a Task Handoff Playbook with this AI Prompt</a>: Prevent drops during cross-team handoffs.</li>
<!-- /wp:list-item -->
</ul>
<!-- /wp:list -->
</div>

<div class="faq-section">
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading">Common Questions</h2>
<!-- /wp:heading -->

<div class="faq-item">
<span class="question">Which roles benefit most from this API rate limits AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>Backend Engineers</strong> use it to turn vague “add rate limiting” tickets into a layered policy plus middleware implementation details. <strong>Platform/SRE Leads</strong> rely on it for telemetry, alerting, and low-risk rollout steps that reduce production surprises. <strong>API Product Managers</strong> get a clearer client experience spec (429 + Retry-After, safe messages) so integrations break less often. <strong>Security Engineers</strong> apply it to map attacker behaviors to controls and to plan adaptive tuning as abuse evolves.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this API rate limits AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>SaaS companies</strong> use it to protect multi-tenant APIs where one noisy customer (or leaked token) can degrade everyone’s experience. It helps separate per-account limits from per-IP limits and avoids punishing office NAT traffic. <strong>E-commerce and marketplaces</strong> apply it to deter scraping of pricing, inventory, and search results, especially around promotions when traffic surges are normal but abuse spikes too. <strong>Fintech and payments</strong> teams use it to tame login-related retry storms and to throttle sensitive endpoints without leaking thresholds to attackers. <strong>Media and data providers</strong> get value because content and datasets attract automated extraction, so layered identity + IP throttles plus monitoring are essential.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for designing API rate limits produce weak results?</span>
<!-- wp:paragraph -->
<p class="answer">A typical prompt like “Write me a rate limiting strategy for my API” fails because it: lacks attacker behavior modeling (bursting, IP rotation, retries) so the limits are easy to evade, provides no layered enforcement plan (IP plus identity plus fallback) and ends up as a single brittle rule, ignores state storage tradeoffs so it suggests patterns that break under load or across instances, produces generic 429 advice instead of a client-safe contract with Retry-After, and misses operational visibility so you cannot tune limits safely after launch.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Can I customize this API rate limits prompt for my specific situation?</span>
<!-- wp:paragraph -->
<p class="answer">Yes. The fastest way is to add your stack (language, framework, gateway), your traffic shape (avg/peak RPS, burstiness), and a short list of endpoints with “cost” notes so the policy can vary by route. Include identity signals you already have (API key, user ID, org ID) and clarify what unauthenticated traffic looks like (public endpoints, onboarding, webhooks). Then ask a targeted follow-up like: “Rewrite the blueprint for Node/Express behind NGINX, with Redis counters, and propose per-endpoint limits for /search, /export, /login, and /webhook.”</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this API rate limits prompt?</span>
<!-- wp:paragraph -->
<p class="answer">The biggest mistake is leaving your abuse scenario too vague — instead of “we get scraped,” provide “/search gets 300 RPS bursts for 2–3 minutes from rotating residential IPs, then a 10x retry spike on 5xx.” Another common error is not listing identity keys; “authenticated users” is weak compared to “rate-limit by org_id, then user_id, with API key as fallback.” People also forget to specify which endpoints are public vs authenticated, which leads to policies that block onboarding flows. Finally, teams often omit rollout constraints (feature flags, percentage rollout, shadow mode), so the plan is correct on paper but risky to deploy.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Who should NOT use this API rate limits prompt?</span>
<!-- wp:paragraph -->
<p class="answer">This prompt isn’t ideal for teams looking for a copy-paste snippet with zero tuning, because rate limiting only works well when it reflects your routes, tenants, and traffic shape. It’s also not a fit if you cannot change application code or edge configuration at all; you may need a managed gateway/WAF approach instead. And if you haven’t identified your core identity signals (API keys, user IDs, org IDs), you’ll get a weaker plan until that foundation exists.</p>
<!-- /wp:paragraph -->
</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this API rate limits AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Backend Engineers use it to turn vague “add rate limiting” tickets into a layered policy plus middleware implementation details. Platform/SRE Leads rely on it for telemetry, alerting, and low-risk rollout steps that reduce production surprises. API Product Managers get a clearer client experience spec (429 + Retry-After, safe messages) so integrations break less often. Security Engineers apply it to map attacker behaviors to controls and to plan adaptive tuning as abuse evolves."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this API rate limits AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SaaS companies use it to protect multi-tenant APIs where one noisy customer (or leaked token) can degrade everyone’s experience. It helps separate per-account limits from per-IP limits and avoids punishing office NAT traffic. E-commerce and marketplaces apply it to deter scraping of pricing, inventory, and search results, especially around promotions when traffic surges are normal but abuse spikes too. Fintech and payments teams use it to tame login-related retry storms and to throttle sensitive endpoints without leaking thresholds to attackers. Media and data providers get value because content and datasets attract automated extraction, so layered identity + IP throttles plus monitoring are essential."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for designing API rate limits produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like “Write me a rate limiting strategy for my API” fails because it: lacks attacker behavior modeling (bursting, IP rotation, retries) so the limits are easy to evade, provides no layered enforcement plan (IP plus identity plus fallback) and ends up as a single brittle rule, ignores state storage tradeoffs so it suggests patterns that break under load or across instances, produces generic 429 advice instead of a client-safe contract with Retry-After, and misses operational visibility so you cannot tune limits safely after launch."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this API rate limits prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. The fastest way is to add your stack (language, framework, gateway), your traffic shape (avg/peak RPS, burstiness), and a short list of endpoints with “cost” notes so the policy can vary by route. Include identity signals you already have (API key, user ID, org ID) and clarify what unauthenticated traffic looks like (public endpoints, onboarding, webhooks). Then ask a targeted follow-up like: “Rewrite the blueprint for Node/Express behind NGINX, with Redis counters, and propose per-endpoint limits for /search, /export, /login, and /webhook.”"
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this API rate limits prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving your abuse scenario too vague — instead of “we get scraped,” provide “/search gets 300 RPS bursts for 2–3 minutes from rotating residential IPs, then a 10x retry spike on 5xx.” Another common error is not listing identity keys; “authenticated users” is weak compared to “rate-limit by org_id, then user_id, with API key as fallback.” People also forget to specify which endpoints are public vs authenticated, which leads to policies that block onboarding flows. Finally, teams often omit rollout constraints (feature flags, percentage rollout, shadow mode), so the plan is correct on paper but risky to deploy."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this API rate limits prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for teams looking for a copy-paste snippet with zero tuning, because rate limiting only works well when it reflects your routes, tenants, and traffic shape. It’s also not a fit if you cannot change application code or edge configuration at all; you may need a managed gateway/WAF approach instead. And if you haven’t identified your core identity signals (API keys, user IDs, org IDs), you’ll get a weaker plan until that foundation exists."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">
<!-- wp:paragraph -->
<p>Abuse doesn’t wait for your roadmap. Use this prompt to design layered API rate limits you can actually deploy, observe, and tune, then paste it into your workflow and start hardening today.</p>
<!-- /wp:paragraph -->
</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5001441.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Build Token-Safe JWT Auth Blueprint AI Prompt</title>
		<link>https://flowpast.com/prompts/build-token-safe-jwt-auth-blueprint-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:49:32 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5001440</guid>

					<description><![CDATA[Session hijacks keep happening - the ultimate AI Prompt that designs HTTP-only cookie JWT auth with CSRF defense, rotation, monitoring, and code. Discover more AI prompts for marketing, sales, and ops.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: JWT auth blueprint -->

<div class="hook-introduction">

<p>Session hijacks keep happening because many “JWT setups” quietly put tokens where attackers love them: in browser storage, exposed to XSS, and copied into headers by hand. Then refresh logic gets bolted on later, cookie flags are wrong, and you end up with random logouts or (worse) long-lived stolen sessions. It’s messy, and it’s avoidable.</p>



<p>This <strong>JWT auth blueprint</strong> is built for <strong>backend engineers</strong> who need a cookie-based JWT model with sane rotation rules, <strong>security-minded tech leads</strong> cleaning up risky token handling before an audit or incident, and <strong>startup founders</strong> who want “secure by default” auth without breaking UX. The output is a production-ready blueprint: headers, cookie settings, endpoint flows, stack-specific code snippets, tests, and an incident response plan for suspected credential compromise.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It designs a cookie-based JWT session architecture where tokens are never accessible to JavaScript.</li>
          <li>It defines access and refresh lifetimes, rotation rules, and failure modes to keep logins smooth but predictable.</li>
          <li>It outputs concrete implementation details for headers, cookie flags, CORS behavior, and CSRF defenses.</li>
          <li>It produces stack-aligned code snippets based on your [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY] inputs.</li>
          <li>It adds monitoring, detection signals, and automated containment steps for suspected session theft or replay.</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>You currently store JWTs in localStorage or sessionStorage and want to remove that exposure without rewriting everything.</li>
          <li>Your app has “mysterious logouts” because refresh logic and cookie/CORS settings were patched together over time.</li>
          <li>You are adding a new SPA or mobile web frontend and need a consistent auth flow that won’t become a support nightmare.</li>
          <li>A security review flagged XSS risk, token theft, or missing CSRF protection in cookie-based sessions.</li>
          <li>You are scaling traffic and need monitoring and incident playbooks, not just an auth diagram in a slide deck.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A complete JWT cookie session blueprint with recommended token lifetimes and rotation policy.</li>
           <li>Endpoint-by-endpoint flow for login, silent refresh, logout, and “session invalid” handling.</li>
           <li>Stack-specific code snippets for [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY], including headers and cookie attributes.</li>
           <li>A CSRF defense package: chosen approach, configuration notes, and validation logic for protected routes.</li>
           <li>A monitoring and containment checklist with alert signals plus automated steps to quarantine suspicious sessions.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: Token-Safe Cookie JWT Auth Blueprint</h2>



<div class="prompt-viewer-wrapper" id="prompt-section">
    <div class="prompt-comparison-row prompt-premium">
        <!-- Header with buttons -->
        <div class="prompt-row-header">
            <!-- <span class="prompt-row-icon">✨</span> -->
            <span class="prompt-row-title">
                                    Step 1: Customize the prompt with your input
                            </span>
            <div class="prompt-header-buttons">
                                    <button class="prompt-header-btn prompt-header-reset" onclick="resetPrompt()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                                <button class="prompt-header-btn prompt-header-copy-green flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span>Customize and Copy Full Prompt</span>
                </button>
            </div>
        </div>

        <!-- Customize the Prompt Section -->
                    <div class="prompt-customize-section">
                <span class="customize-title">Customize the Prompt</span>
                <p class="customize-subtitle">Fill in the fields below to personalize this prompt for your needs.</p>
                <table class="customize-table">
                    <thead>
                        <tr>
                            <th>Variable</th>
                            <th>What to Enter</th>
                            <th>Customise the prompt</th>
                        </tr>
                    </thead>
                    <tbody>
                                                    <tr>
                                <td class="var-name"><code>[BACKEND_TECHNOLOGY]</code></td>
                                <td class="var-desc">
                                    Specify the backend programming language or framework used to build the server-side of the application.                                    <div class="var-example">For example: "Node.js with Express or Python with Django"</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[BACKEND_TECHNOLOGY]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[FRONTEND_TECHNOLOGY]</code></td>
                                <td class="var-desc">
                                    Specify the frontend framework or library used for building the user interface of the application.                                    <div class="var-example">For example: "React.js or Angular"</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[FRONTEND_TECHNOLOGY]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[UPPERCASE_WITH_UNDERSCORES]</code></td>
                                <td class="var-desc">
                                    Enter a variable or input name formatted in uppercase letters with underscores separating words.                                    <div class="var-example">For example: "USER_SESSION_ID or ACCESS_TOKEN"</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[UPPERCASE_WITH_UNDERSCORES]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[APPLICATION_TYPE]</code></td>
                                <td class="var-desc">
                                    Describe the type of application being developed, including its purpose and target audience.                                    <div class="var-example">For example: "E-commerce web application for small businesses"</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[APPLICATION_TYPE]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[CURRENT_SECURITY_LEVEL]</code></td>
                                <td class="var-desc">
                                    Provide details about the current security approach or mechanisms implemented in the application.                                    <div class="var-example">For example: "Using JWT stored in localStorage with basic CSRF protection"</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[CURRENT_SECURITY_LEVEL]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[CHALLENGE]</code></td>
                                <td class="var-desc">
                                    Describe the specific authentication or security challenge the application is facing or trying to solve.                                    <div class="var-example">For example: "Preventing session hijacking while maintaining a seamless user experience"</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[CHALLENGE]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[CONTEXT]</code></td>
                                <td class="var-desc">
                                    Provide any relevant background or situational details that impact the security architecture or implementation.                                    <div class="var-example">For example: "Application operates in a high-risk environment with frequent phishing attempts targeting users"</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[CONTEXT]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                            </tbody>
                </table>

                <button class="copy-customized-btn flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span class="copy-customized-text">Customise the prompt now</span>
                </button>
            </div>
        
        <!-- Full Prompt Code Header -->
                    <div class="prompt-code-header">
                <span class="prompt-code-title">
                    Step 2: Copy the Prompt
                </span>
                <div class="prompt-code-buttons">
                    <!-- Reset: Only visible when unlocked -->
                    <button class="prompt-header-btn prompt-header-reset btn-when-unlocked" onclick="resetPrompt()" style="display: none;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                    <!-- Copy Full Prompt -->
                    <button class="prompt-header-btn prompt-header-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                            <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                        </svg>
                        <span>Copy Full Prompt</span>
                    </button>
                </div>
            </div>
        

        <!-- Prompt Content -->
        <div class="prompt-box prompt-gated-wrapper">
            <!-- Gated: Blurred content -->
            <div class="prompt-gated-content">
                <div class="prompt-header-visible">OBJECTIVE</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PERSONA</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">CONSTRAINTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">What This Is NOT (Scope Boundaries)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PROCESS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">INPUTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">OUTPUT SPECIFICATION</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">1) Security Architecture</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">2) Cookie Implementation (HTTP-only)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">3) Session Management &amp; Silent Refresh</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">4) Middleware Design (Validation + User Context)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">5) Threat Detection &amp; Automated Response</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">6) Code Examples (Tailored)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">7) Security Testing Plan</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">8) Deployment Checklist</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">QUALITY CHECKS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div>            </div>
            <!-- Unlocked: Full content (hidden by default) -->
            <div class="prompt-content-full" id="premium-prompt-content" style="display: none;">
                ## OBJECTIVE
Create a production-ready JWT authentication blueprint that removes all client-side token storage/handling, resists XSS/token theft/session hijacking, preserves a smooth login experience, and includes concrete implementation details (code, headers, settings, tests, and incident response).

## PERSONA
Act as a seasoned application-security architect who has built and reviewed real-world auth systems under active attack. Communicate in a pragmatic, engineering-first style: precise, skeptical of “best practice” platitudes, and focused on deployable patterns with clear tradeoffs.

## CONSTRAINTS
- Prioritize designs where tokens are never accessible to JavaScript (no localStorage/sessionStorage/in-memory token juggling in the browser).
- Use HTTP-only cookies as the primary transport/storage for session credentials.
- Provide stack-specific snippets aligned to [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY].
- Prefer actionable configuration over generic advice.
- Preserve UX: silent refresh, minimal re-logins, predictable failure modes.
- Include monitoring plus automated containment steps for suspected credential compromise.
- **Variable format compliance:** user-provided items must be in **[UPPERCASE_WITH_UNDERSCORES]**; any AI-filled template fields must use **{Title Case}**.

### What This Is NOT (Scope Boundaries)
- Not a full IAM/SSO vendor selection guide.
- Not a complete pentest report or formal threat model document.
- Not a substitute for legal/compliance requirements (PCI/HIPAA/etc.).
- Not an endorsement of putting access tokens in browser storage “with extra encryption.”

## PROCESS
1. **Pre-analysis (must output first):** Briefly restate your understanding of the app context and the likely threat paths, based on the provided inputs. List any assumptions.
2. **Architecture build-out:** Propose a cookie-based JWT session model (access + refresh or equivalent) with clear lifetimes and rotation rules.
3. **Implementation details:** Provide headers, cookie attributes, CORS/CSRF posture, and server routes/handlers needed for login, refresh, logout, and revocation.
4. **Middleware &amp; request flow:** Define how each request is authenticated, how user context is attached, and how failures are handled without leaking information.
5. **Threat response:** Describe detection signals (logs/metrics), alert thresholds, and automated actions (revoke, rotate, step-up auth, lockouts).
6. **Testing plan:** Give repeatable tests (unit/integration/e2e) and a small “attack simulation” checklist.
7. **Edge cases:** If inputs are incomplete or contradictory, ask targeted questions and provide a safe default path labeled as {Assumed Default}.
8. **Finish with validation:** Provide a short verification checklist (4–5 items).

## INPUTS
- **Application type:** [APPLICATION_TYPE]
- **Backend technology/framework:** [BACKEND_TECHNOLOGY]
- **Frontend technology/framework:** [FRONTEND_TECHNOLOGY]
- **Current JWT/security approach:** [CURRENT_SECURITY_LEVEL]
- **Specific security concerns/requirements:** [CHALLENGE]
- **Environment details (domains, hosting, reverse proxy, etc.):** [CONTEXT]

## OUTPUT SPECIFICATION
Use the following sections and include stack-specific code/config wherever possible:

### 1) Security Architecture
Provide:
- {Session Model} (e.g., “short-lived access token + rotating refresh token in HTTP-only cookie”)
- {Token Contents} (claims, issuer/audience, minimal PII guidance)
- {Lifetime Policy} (access TTL, refresh TTL, idle timeout, absolute timeout)
- {Rotation &amp; Revocation Strategy} (refresh rotation, reuse detection, server-side denylist/allowlist approach)
- {UX Behavior} (what the user experiences during refresh/expiry)

### 2) Cookie Implementation (HTTP-only)
Include:
- {Cookie Names} and purposes
- Exact cookie attributes: HttpOnly, Secure, SameSite, Path, Domain, Max-Age/Expires
- Required security headers (at minimum): CSP guidance, HSTS, X-Content-Type-Options, Referrer-Policy, Permissions-Policy
- CORS settings compatible with cookie auth
- CSRF strategy compatible with SameSite policy (double-submit, origin checks, CSRF token cookie pattern, etc.)

### 3) Session Management &amp; Silent Refresh
Include:
- {Auth Endpoints} (login/refresh/logout/me)
- {Refresh Flow} described as steps (server-centric; frontend should not touch tokens)
- Concurrency handling (multiple tabs, refresh storms)
- Logout semantics (server + client cookie clearing)
- Failure handling (when to force re-auth vs retry)

### 4) Middleware Design (Validation + User Context)
Include:
- {Middleware Responsibilities}
- Signature verification, issuer/audience checks, clock skew handling
- Attaching {User Context} to request
- Authorization hooks (roles/scopes) without overloading JWT
- Performance notes (caching keys/JWKS if applicable)

### 5) Threat Detection &amp; Automated Response
Include:
- What to log (auth events, refresh reuse, IP/UA changes, anomaly signals)
- {Detection Rules} (examples with thresholds)
- {Automated Actions} (revoke session family, require re-auth, notify user, rate limit, temporarily block)
- Guidance for compromised refresh token scenarios
- Safe error messaging patterns

### 6) Code Examples (Tailored)
Provide:
- {Backend Implementation Snippets} for [BACKEND_TECHNOLOGY]
- {Frontend Integration Notes} for [FRONTEND_TECHNOLOGY] (cookie-based requests, handling 401/419, retry pattern)
- {Configuration Snippets} (proxy/load balancer, environment variables, secure defaults)
- A minimal example for each: login handler, refresh handler, auth middleware, logout handler

### 7) Security Testing Plan
Include:
- Unit tests (token validation, expiry, rotation, CSRF checks)
- Integration tests (cookie attributes, CORS behavior, refresh rotation correctness)
- E2E tests (silent refresh, multi-tab, logout)
- “Adversary checks” (XSS attempt to read tokens, replay refresh, session fixation attempt)

### 8) Deployment Checklist
A step-by-step pre-production list including:
- Cookie flags verified in prod
- TLS/HSTS enabled and tested
- CSP in report-only then enforced
- Logging/alerts wired
- Key rotation/JWKS strategy confirmed
- Incident runbook basics (revocation, forced logout, secret rotation)

## QUALITY CHECKS
At the end, output a **Quality Validation Checklist** with 4–5 bullets confirming:
- No client-side token storage/reading is required
- Cookies and headers are correctly specified for the chosen stack
- CSRF protections are compatible with cookie-based auth
- Refresh rotation + compromise handling is explicitly covered
- Tests include at least one replay/reuse scenario and one XSS-driven verification attempt            </div>
        </div>


    </div>

    <!-- CTA Row - Full width buttons -->
    <div class="prompt-cta-row">
        <button class="prompt-cta-btn prompt-cta-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
            </svg>
            <span class="cta-copy-text">Copy Full Prompt</span>
        </button>
    </div>
</div>

<style>
    /* Gated prompt states */
    .prompt-gated-wrapper {
        position: relative;
    }

    /* When unlocked - show full content, hide gated */
    body.flowpast-unlocked .prompt-gated-wrapper .prompt-gated-content {
        display: none;
    }

    body.flowpast-unlocked .prompt-gated-wrapper .prompt-content-full {
        display: block !important;
    }

    /* Show/hide elements based on unlock state */
    body.flowpast-unlocked .btn-when-unlocked {
        display: inline-flex !important;
    }

    .prompt-viewer-wrapper {
        scroll-margin-top: 250px;
    }

    /* ========================================
   PROMPT VIEWER - MAIN WRAPPER
   ======================================== */
    .prompt-viewer-wrapper {
        margin: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ========================================
   PROMPT BOX CONTAINER
   ======================================== */
    .prompt-comparison-row {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    /* ========================================
   HEADER WITH BUTTONS
   ======================================== */
    .prompt-row-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .prompt-row-icon {
        font-size: 20px;
    }

    .prompt-row-title {
        font-weight: 600;
        font-size: 22px;
        color: #fff !important;
        text-decoration: underline
    }

    .prompt-header-buttons {
        margin-left: auto;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Header buttons */
    .prompt-header-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-header-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-header-copy:hover {
        background: #2a2a2a;
    }

    .prompt-header-copy.copied {
        background: #2e7d32;
    }

    .prompt-header-copy-green {
        background: #04AA6D !important;
        color: #fff !important;
    }

    .prompt-header-copy-green:hover {
        background: #039860 !important;
    }

    .prompt-header-copy-green.copied {
        background: #2e7d32 !important;
    }

    .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-header-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-1px);
    }

    /* ========================================
   PROMPT CONTENT - FULL (NO SCROLL)
   ======================================== */
    .prompt-box {
        background: #ffffff;
    }

    .prompt-content-full {
        padding: 24px;
        margin: 0;
        color: #202124;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.7;
        white-space: pre-wrap;
        word-wrap: break-word;
        /* No scroll - show full content */
        max-height: none;
        overflow: visible;
    }

    /* Highlighted variable in prompt */
    .prompt-variable {
        background: #fff3cd;
        color: #1967d2;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ffc107;
    }

    .prompt-variable-filled {
        background: #d4edda;
        color: #155724;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #28a745;
    }

    /* ========================================
   GATED CONTENT (NO ACCESS)
   ======================================== */
    .prompt-gated-content {
        padding: 24px;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.8;
        max-height: none;
        overflow: visible;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        cursor: default;
    }

    /* ## headers - larger, black */
    .prompt-header-visible {
        color: #202124;
        font-weight: 600;
        margin: 5px 0 0px 0;
        font-size: 20px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* ### headers - smaller, black */
    .prompt-header-visible.subheader {
        color: #202124;
        font-weight: 600;
        margin: 5px 0;
        font-size: 18px;
    }

    .prompt-header-visible:first-child {
        margin-top: 0;
    }

    /* ========================================
   LOCKED SECTION BLOCK
   ======================================== */
    .locked-section {
        position: relative;
        margin: 4px 0 8px 0;
        border-radius: 6px;
        overflow: hidden;
        background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .locked-section-bg {
        position: relative;
    }

    .locked-section-lines {
        padding: 8px 12px;
        position: relative;
    }

    .locked-line {
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 3px;
        margin-bottom: 4px;
        margin-left: 12px;
    }

    .locked-line:last-child {
        margin-bottom: 0;
    }

    .locked-section-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        font-size: 24px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }

    /* Subheader locked sections - slightly indented */
    /*  .prompt-header-visible.subheader+.locked-section {
        margin-left: 16px;
    } */

    /* ========================================
   COMPATIBILITY BADGES
   ======================================== */
    .prompt-compatibility {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
    }

    .compat-label {
        font-size: 13px;
        color: #5f6368;
        font-weight: 500;
    }

    .compat-badge {
        padding: 4px 10px;
        background: #e8f0fe;
        color: #1967d2;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }

    /* ========================================
   CTA ROW - FULL WIDTH BUTTONS
   ======================================== */
    .prompt-cta-row {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .prompt-cta-btn {
        flex: 1;
        min-width: 200px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 24px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-cta-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-copy:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-copy.copied {
        background: #2e7d32;
    }

    .prompt-cta-reset {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-reset:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-cta-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    /* ========================================
    CUSTOMIZE YOUR PROMPT SECTION
    ======================================== */
    .prompt-customize-section {
        padding: 24px;
        border-bottom: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .customize-title {
        margin: 0 0 8px 0;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
    }

    .customize-subtitle {
        margin: 0 0 20px 0;
        font-size: 14px;
        color: #5f6368;
    }

    .customize-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .customize-table th {
        text-align: left;
        padding: 12px;
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        font-size: 13px;
        font-weight: 600;
        color: #202124;
    }

    .customize-table td {
        padding: 12px;
        border: 1px solid #e0e0e0;
        vertical-align: top;
    }

    .customize-table .var-name {
        width: 25%;
        background: #f8f9fa;
    }

    .customize-table .var-name code {
        background: #fff3cd;
        color: #1967d2;
        border: 1px solid #ffc107;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        word-break: break-all;
        font-weight: 600;
    }

    .customize-table .var-desc {
        width: 35%;
        font-size: 13px;
        color: #5f6368;
        line-height: 1.5;
    }

    .customize-table .var-example {
        margin-top: 8px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #dadce0;
        font-size: 12px;
        color: #5f6368;
        font-style: italic;
        border-radius: 0 4px 4px 0;
    }

    .customize-table .var-input {
        width: 40%;
    }

    .customize-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #dadce0;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .customize-input:focus {
        outline: none;
        border-color: rgb(5, 152, 98);
        box-shadow: 0 0 0 3px rgba(5, 152, 98, 0.1);
    }

    .customize-input::placeholder {
        color: #9aa0a6;
        font-style: italic;
    }

    .copy-customized-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: rgb(5, 152, 98);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .copy-customized-btn:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    .copy-customized-btn.copied {
        background: #2e7d32;
    }

    /* ========================================
    FULL PROMPT CODE HEADER
    ======================================== */
    .prompt-code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
    }

    .prompt-code-title {
        font-size: 22px;
        font-weight: 600;
        text-decoration: underline;

    }

    .prompt-code-buttons {
        display: flex;
        gap: 8px;
    }

    .prompt-code-buttons .prompt-header-btn {
        padding: 8px 14px;
        font-size: 13px;
        background: #ffffff;
        color: #202124;
        border: 1px solid #dadce0;
    }

    .prompt-code-buttons .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
        border-color: rgb(5, 152, 98);
    }

    .prompt-code-buttons .prompt-header-btn.prompt-header-access:hover {
        background: rgb(4, 130, 83) !important;
        border-color: rgb(4, 130, 83);
        color: #fff !important;
    }

    .prompt-code-buttons .prompt-header-btn:hover {
        background: #f1f3f4;
    }

    .prompt-code-buttons .prompt-header-copy.copied {
        background: #d4edda;
        color: #155724;
        border-color: #28a745;
    }

    .prompt-header-reset {
        background: #ffffff;
        color: #202124;
    }

    /* ========================================
   RESPONSIVE
   ======================================== */
    @media (max-width: 768px) {
        .prompt-row-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .prompt-header-buttons {
            margin-left: 0;
            width: 100%;
        }

        .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }

        .prompt-cta-row {
            flex-direction: column;
        }

        .prompt-cta-btn {
            width: 100%;
        }

        /* Customize table responsive */
        .customize-table,
        .customize-table thead,
        .customize-table tbody,
        .customize-table tr,
        .customize-table th,
        .customize-table td {
            display: block;
        }

        .customize-table thead {
            display: none;
        }

        .customize-table tr {
            margin-bottom: 16px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
        }

        .customize-table td {
            width: 100% !important;
            border: none;
            border-bottom: 1px solid #e0e0e0;
        }

        .customize-table td:last-child {
            border-bottom: none;
        }

        .customize-table .var-name {
            background: #f1f3f4;
            font-weight: 600;
        }

        .prompt-code-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }

        .prompt-code-buttons {
            width: 100%;
        }

        .prompt-code-buttons .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }
    }
</style>

<script>
    function handlePromptCopy() {
        // Check if unlocked via cookie
        if (typeof window.flowpastIsUnlocked === 'function' && !window.flowpastIsUnlocked()) {
            // Show email popup
            if (typeof window.flowpastShowEmailPopup === 'function') {
                window.flowpastShowEmailPopup('prompt');
            }
            return;
        }

        // Copy the customized prompt (with filled variables)
        const customizedPrompt = getCustomizedPrompt();
        const copyButtons = document.querySelectorAll('.prompt-header-copy, .prompt-header-copy-green, .prompt-cta-copy, .copy-customized-btn');

        navigator.clipboard.writeText(customizedPrompt).then(() => {
            copyButtons.forEach(btn => {
                btn.classList.add('copied');
                const textSpan = btn.querySelector('span');
                if (textSpan) textSpan.textContent = 'Copied!';
            });

            setTimeout(() => {
                copyButtons.forEach(btn => {
                    btn.classList.remove('copied');
                    const textSpan = btn.querySelector('span');
                    if (textSpan) textSpan.textContent = 'Copy Full Prompt';
                });
            }, 2000);
        }).catch(err => {
            console.error('Failed to copy:', err);
        });
    }

    // Store original prompt for customization
    const originalPrompt = "## OBJECTIVE\r\nCreate a production-ready JWT authentication blueprint that removes all client-side token storage\/handling, resists XSS\/token theft\/session hijacking, preserves a smooth login experience, and includes concrete implementation details (code, headers, settings, tests, and incident response).\r\n\r\n## PERSONA\r\nAct as a seasoned application-security architect who has built and reviewed real-world auth systems under active attack. Communicate in a pragmatic, engineering-first style: precise, skeptical of \u201cbest practice\u201d platitudes, and focused on deployable patterns with clear tradeoffs.\r\n\r\n## CONSTRAINTS\r\n- Prioritize designs where tokens are never accessible to JavaScript (no localStorage\/sessionStorage\/in-memory token juggling in the browser).\r\n- Use HTTP-only cookies as the primary transport\/storage for session credentials.\r\n- Provide stack-specific snippets aligned to [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY].\r\n- Prefer actionable configuration over generic advice.\r\n- Preserve UX: silent refresh, minimal re-logins, predictable failure modes.\r\n- Include monitoring plus automated containment steps for suspected credential compromise.\r\n- **Variable format compliance:** user-provided items must be in **[UPPERCASE_WITH_UNDERSCORES]**; any AI-filled template fields must use **{Title Case}**.\r\n\r\n### What This Is NOT (Scope Boundaries)\r\n- Not a full IAM\/SSO vendor selection guide.\r\n- Not a complete pentest report or formal threat model document.\r\n- Not a substitute for legal\/compliance requirements (PCI\/HIPAA\/etc.).\r\n- Not an endorsement of putting access tokens in browser storage \u201cwith extra encryption.\u201d\r\n\r\n## PROCESS\r\n1. **Pre-analysis (must output first):** Briefly restate your understanding of the app context and the likely threat paths, based on the provided inputs. List any assumptions.\r\n2. **Architecture build-out:** Propose a cookie-based JWT session model (access + refresh or equivalent) with clear lifetimes and rotation rules.\r\n3. **Implementation details:** Provide headers, cookie attributes, CORS\/CSRF posture, and server routes\/handlers needed for login, refresh, logout, and revocation.\r\n4. **Middleware & request flow:** Define how each request is authenticated, how user context is attached, and how failures are handled without leaking information.\r\n5. **Threat response:** Describe detection signals (logs\/metrics), alert thresholds, and automated actions (revoke, rotate, step-up auth, lockouts).\r\n6. **Testing plan:** Give repeatable tests (unit\/integration\/e2e) and a small \u201cattack simulation\u201d checklist.\r\n7. **Edge cases:** If inputs are incomplete or contradictory, ask targeted questions and provide a safe default path labeled as {Assumed Default}.\r\n8. **Finish with validation:** Provide a short verification checklist (4\u20135 items).\r\n\r\n## INPUTS\r\n- **Application type:** [APPLICATION_TYPE]\r\n- **Backend technology\/framework:** [BACKEND_TECHNOLOGY]\r\n- **Frontend technology\/framework:** [FRONTEND_TECHNOLOGY]\r\n- **Current JWT\/security approach:** [CURRENT_SECURITY_LEVEL]\r\n- **Specific security concerns\/requirements:** [CHALLENGE]\r\n- **Environment details (domains, hosting, reverse proxy, etc.):** [CONTEXT]\r\n\r\n## OUTPUT SPECIFICATION\r\nUse the following sections and include stack-specific code\/config wherever possible:\r\n\r\n### 1) Security Architecture\r\nProvide:\r\n- {Session Model} (e.g., \u201cshort-lived access token + rotating refresh token in HTTP-only cookie\u201d)\r\n- {Token Contents} (claims, issuer\/audience, minimal PII guidance)\r\n- {Lifetime Policy} (access TTL, refresh TTL, idle timeout, absolute timeout)\r\n- {Rotation & Revocation Strategy} (refresh rotation, reuse detection, server-side denylist\/allowlist approach)\r\n- {UX Behavior} (what the user experiences during refresh\/expiry)\r\n\r\n### 2) Cookie Implementation (HTTP-only)\r\nInclude:\r\n- {Cookie Names} and purposes\r\n- Exact cookie attributes: HttpOnly, Secure, SameSite, Path, Domain, Max-Age\/Expires\r\n- Required security headers (at minimum): CSP guidance, HSTS, X-Content-Type-Options, Referrer-Policy, Permissions-Policy\r\n- CORS settings compatible with cookie auth\r\n- CSRF strategy compatible with SameSite policy (double-submit, origin checks, CSRF token cookie pattern, etc.)\r\n\r\n### 3) Session Management & Silent Refresh\r\nInclude:\r\n- {Auth Endpoints} (login\/refresh\/logout\/me)\r\n- {Refresh Flow} described as steps (server-centric; frontend should not touch tokens)\r\n- Concurrency handling (multiple tabs, refresh storms)\r\n- Logout semantics (server + client cookie clearing)\r\n- Failure handling (when to force re-auth vs retry)\r\n\r\n### 4) Middleware Design (Validation + User Context)\r\nInclude:\r\n- {Middleware Responsibilities}\r\n- Signature verification, issuer\/audience checks, clock skew handling\r\n- Attaching {User Context} to request\r\n- Authorization hooks (roles\/scopes) without overloading JWT\r\n- Performance notes (caching keys\/JWKS if applicable)\r\n\r\n### 5) Threat Detection & Automated Response\r\nInclude:\r\n- What to log (auth events, refresh reuse, IP\/UA changes, anomaly signals)\r\n- {Detection Rules} (examples with thresholds)\r\n- {Automated Actions} (revoke session family, require re-auth, notify user, rate limit, temporarily block)\r\n- Guidance for compromised refresh token scenarios\r\n- Safe error messaging patterns\r\n\r\n### 6) Code Examples (Tailored)\r\nProvide:\r\n- {Backend Implementation Snippets} for [BACKEND_TECHNOLOGY]\r\n- {Frontend Integration Notes} for [FRONTEND_TECHNOLOGY] (cookie-based requests, handling 401\/419, retry pattern)\r\n- {Configuration Snippets} (proxy\/load balancer, environment variables, secure defaults)\r\n- A minimal example for each: login handler, refresh handler, auth middleware, logout handler\r\n\r\n### 7) Security Testing Plan\r\nInclude:\r\n- Unit tests (token validation, expiry, rotation, CSRF checks)\r\n- Integration tests (cookie attributes, CORS behavior, refresh rotation correctness)\r\n- E2E tests (silent refresh, multi-tab, logout)\r\n- \u201cAdversary checks\u201d (XSS attempt to read tokens, replay refresh, session fixation attempt)\r\n\r\n### 8) Deployment Checklist\r\nA step-by-step pre-production list including:\r\n- Cookie flags verified in prod\r\n- TLS\/HSTS enabled and tested\r\n- CSP in report-only then enforced\r\n- Logging\/alerts wired\r\n- Key rotation\/JWKS strategy confirmed\r\n- Incident runbook basics (revocation, forced logout, secret rotation)\r\n\r\n## QUALITY CHECKS\r\nAt the end, output a **Quality Validation Checklist** with 4\u20135 bullets confirming:\r\n- No client-side token storage\/reading is required\r\n- Cookies and headers are correctly specified for the chosen stack\r\n- CSRF protections are compatible with cookie-based auth\r\n- Refresh rotation + compromise handling is explicitly covered\r\n- Tests include at least one replay\/reuse scenario and one XSS-driven verification attempt";
    const variables = ["[BACKEND_TECHNOLOGY]","[FRONTEND_TECHNOLOGY]","[UPPERCASE_WITH_UNDERSCORES]","[APPLICATION_TYPE]","[CURRENT_SECURITY_LEVEL]","[CHALLENGE]","[CONTEXT]"];
    // Initial render with highlighted variables
    document.addEventListener('DOMContentLoaded', function() {
        renderPromptWithHighlights();
    });

    // Live update prompt as user types
    document.querySelectorAll('.customize-input').forEach(input => {
        input.addEventListener('input', renderPromptWithHighlights);
    });

    function renderPromptWithHighlights() {
        const promptContent = document.getElementById('premium-prompt-content');
        if (!promptContent) return;

        let updatedPrompt = originalPrompt;
        let filledVariables = {};

        // Collect filled values
        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                filledVariables[placeholder] = value;
            }
        });

        // Replace filled variables and highlight remaining
        let htmlContent = escapeHtml(updatedPrompt);

        variables.forEach(placeholder => {
            const escapedPlaceholder = escapeHtml(placeholder);
            const regex = new RegExp(escapeRegex(escapedPlaceholder), 'g');

            if (filledVariables[placeholder]) {
                // Show filled value with green highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable-filled">' + escapeHtml(filledVariables[placeholder]) + '</span>'
                );
            } else {
                // Show original placeholder with yellow highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable">' + escapedPlaceholder + '</span>'
                );
            }
        });

        promptContent.innerHTML = htmlContent;
    }

    function escapeRegex(string) {
        return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    }

    function escapeHtml(text) {
        const div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function resetPrompt() {
        // Clear all input fields
        document.querySelectorAll('.customize-input').forEach(input => {
            input.value = '';
        });

        // Re-render with original placeholders highlighted
        renderPromptWithHighlights();

        // Visual feedback
        const resetBtns = document.querySelectorAll('.prompt-header-reset, .prompt-cta-reset');
        resetBtns.forEach(btn => {
            const originalText = btn.querySelector('span').textContent;
            btn.querySelector('span').textContent = 'Reset!';
            setTimeout(() => {
                btn.querySelector('span').textContent = originalText;
            }, 1000);
        });
    }


    function getCustomizedPrompt() {
        let updatedPrompt = originalPrompt;

        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                const regex = new RegExp(escapeRegex(placeholder), 'g');
                updatedPrompt = updatedPrompt.replace(regex, value);
            }
        });

        return updatedPrompt;
    }
</script>

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>Be painfully specific about your app shape.</strong> Tell the AI if it’s a pure SPA, SSR + API, or a hybrid with multiple subdomains, because cookie scope and CORS rules change fast. Add details like “api.example.com + app.example.com” and whether you must support cross-site requests. If you don’t, you’ll get a generic design that breaks in production.</li>


<li><strong>Fill in [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY] with versions, not labels.</strong> “Node” is vague; “Node 20 + Express 4 behind Nginx” is useful. Same for frontend: “Next.js 14 App Router” or “React + Vite served from CloudFront.” Follow-up prompt: “Now rewrite the implementation section using Next.js route handlers and Express middleware.”</li>


<li><strong>Ask it to choose one CSRF pattern and defend it.</strong> Cookie auth forces the CSRF conversation, and hand-wavy answers are how teams ship gaps. Prompt: “Pick double-submit cookie or synchronizer token for my case, and include exact cookie names, validation steps, and how it behaves with same-site requests.”</li>


<li><strong>Iterate on lifetimes using your real risk tolerance.</strong> The first pass will be a reasonable default, but you can tune it for your user behavior and threat level. After the initial output, try: “Make access tokens 5 minutes, refresh 14 days with rotation; now explain the UX impact and how you’ll avoid surprise logouts.”</li>


<li><strong>Force the incident plan to be executable.</strong> Monitoring is only helpful if it turns into actions your team will actually run at 2 a.m. Ask: “Add detection rules for refresh token replay and impossible travel; include automated responses (session revoke, step-up auth) and what to log for later forensics.” Honestly, this is where most “auth guides” fall apart.</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>Once your authentication blueprint is solid, these prompts help you remove performance and process drag that shows up during implementation and rollout:</p>



<p>If you also need to tighten the delivery pipeline around security work (reviews, QA, release coordination), <a href="https://flowpast.com/prompts/fix-workflow-bottlenecks-and-throughput-ai-prompt/">Fix Workflow Bottlenecks and Throughput AI Prompt</a> helps you map where tickets stall and what to change first. It pairs well when your auth project keeps slipping because approvals, handoffs, and “one more change” loops are uncontrolled.</p>



<p>For teams doing repeated auth-related fixes across services, <a href="https://flowpast.com/prompts/fix-workflow-bottlenecks-and-boost-throughput-ai-prompt/">Fix Workflow Bottlenecks and Boost Throughput AI Prompt</a> is useful right after you pick the target design. Use it to standardize execution: checklists, ownership, and a pragmatic cadence so the blueprint turns into merged code, not a forgotten doc.</p>



<p>When your main pain is day-to-day friction (slow code reviews, unclear definitions of done, environment drift), <a href="https://flowpast.com/prompts/fix-daily-workflow-bottlenecks-ai-prompt/">Fix Daily Workflow Bottlenecks AI Prompt</a> complements this JWT work nicely. You’ll feel it during auth refactors, because you’re touching sensitive endpoints and tests, and small inefficiencies multiply.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/fix-workflow-bottlenecks-and-throughput-ai-prompt/">Fix Workflow Bottlenecks and Throughput AI Prompt</a>: Find handoffs slowing important projects.</li>


<li><a href="https://flowpast.com/prompts/fix-workflow-bottlenecks-and-boost-throughput-ai-prompt/">Fix Workflow Bottlenecks and Boost Throughput AI Prompt</a>: Turn plans into repeatable delivery.</li>


<li><a href="https://flowpast.com/prompts/fix-daily-workflow-bottlenecks-ai-prompt/">Fix Daily Workflow Bottlenecks AI Prompt</a>: Remove everyday blockers during refactors.</li>


<li><a href="https://flowpast.com/prompts/diagnose-runtime-bottlenecks-and-fixes-ai-prompt/">Diagnose Runtime Bottlenecks and Fixes AI Prompt</a>: Spot performance issues after changes.</li>


<li><a href="https://flowpast.com/prompts/build-a-tailored-i-o-mastery-plan-ai-prompt/">Build a Tailored I O Mastery Plan AI Prompt</a>: Train skills for better execution.</li>

</ul>

</div>

<div class="faq-section">

<h2 class="wp-block-heading">Common Questions</h2>


<div class="faq-item">
<span class="question">Which roles benefit most from this JWT auth blueprint AI prompt?</span>

<p class="answer"><strong>Backend Engineers</strong> use it to implement cookie-based JWT sessions with correct flags, lifetimes, and rotation so tokens never touch JavaScript. <strong>Security Engineers</strong> lean on it to validate CSRF posture, refresh-token replay defenses, and logging/monitoring signals they can alert on. <strong>Tech Leads</strong> apply it to standardize auth across services and reduce “it works on my machine” security drift. <strong>Full-Stack Developers</strong> benefit because it bridges frontend constraints (CORS, cookie behavior) with server-side enforcement in one deployable plan.</p>

</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this JWT auth blueprint AI prompt?</span>

<p class="answer"><strong>SaaS companies</strong> get value because a single stolen session can expose multiple tenants, and cookie + rotation patterns help limit blast radius. This prompt also forces clarity on lifetimes and revocation, which matters when support teams handle account takeovers. <strong>E-commerce brands</strong> use it to reduce checkout fraud and protect customer accounts without adding constant re-logins that hurt conversions. <strong>Fintech and payments-adjacent apps</strong> benefit from the monitoring and containment steps, because incident response expectations are higher and “we’ll check logs later” is not good enough. <strong>Healthcare and patient portals</strong> apply it to tighten session handling and audit-friendly logging while still keeping the experience usable for non-technical patients.</p>

</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for designing JWT authentication produce weak results?</span>

<p class="answer">A typical prompt like “Write me a JWT auth setup for my app” fails because it: lacks key context like subdomains, cross-site requests, and your actual tech stack, so cookie and CORS advice comes out wrong. It provides no enforceable structure for refresh rotation and replay detection, which is where many real attacks land. It ignores CSRF tradeoffs that appear the moment you use cookies, so you get insecure defaults or vague “enable CSRF.” It produces generic “store the token in localStorage” patterns instead of a design that keeps tokens out of JavaScript. And it usually misses monitoring plus containment steps, so you have no plan when sessions are being abused.</p>

</div>

<div class="faq-item">
<span class="question">Can I customize this JWT auth blueprint prompt for my specific situation?</span>

<p class="answer">Yes, but you need to feed it the right variables in the format it expects, especially [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY]. Add your domain model (single domain vs api/app subdomains), your login UX requirements (silent refresh, “remember me,” device limits), and any constraints like “must support third-party embedded widgets.” A good follow-up is: “Given [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY], output the exact cookie names, SameSite values, CORS settings, and the refresh endpoint pseudocode.” If you have an existing system, ask it to produce a migration plan in phases so you can ship safely.</p>

</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this JWT auth blueprint prompt?</span>

<p class="answer">The biggest mistake is leaving [BACKEND_TECHNOLOGY] too vague — instead of “Python,” try “Python 3.12 + FastAPI + Uvicorn behind Cloudflare.” Another common error is underspecifying [FRONTEND_TECHNOLOGY]; “React” is different from “Next.js with server actions,” and cookie behavior and routing matter. People also forget to describe their domain setup, which is how you end up with unusable SameSite/CORS guidance; “single origin https://app.example.com” is a good input, “we have a website” is not. Finally, teams skip UX requirements, so the model may choose lifetimes that cause constant logins; say “silent refresh required, tolerate re-login only after 14 days or password change.”</p>

</div>

<div class="faq-item">
<span class="question">Who should NOT use this JWT auth blueprint prompt?</span>

<p class="answer">This prompt isn’t ideal for teams that need a full SSO/IAM vendor decision or enterprise federation design, because it is focused on deployable cookie-based JWT patterns, not product selection. It’s also a poor fit if you want a one-page quick template without iteration, since the best results come from clarifying your stack, domain model, and threat assumptions. And if you can’t use HTTP-only cookies at all (for example, a constrained client environment that forbids them), you will need a different approach. In those cases, start with a formal architecture review or a dedicated auth framework evaluation instead.</p>

</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this JWT auth blueprint AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Backend Engineers use it to implement cookie-based JWT sessions with correct flags, lifetimes, and rotation so tokens never touch JavaScript. Security Engineers lean on it to validate CSRF posture, refresh-token replay defenses, and logging/monitoring signals they can alert on. Tech Leads apply it to standardize auth across services and reduce “it works on my machine” security drift. Full-Stack Developers benefit because it bridges frontend constraints (CORS, cookie behavior) with server-side enforcement in one deployable plan."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this JWT auth blueprint AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SaaS companies get value because a single stolen session can expose multiple tenants, and cookie + rotation patterns help limit blast radius. This prompt also forces clarity on lifetimes and revocation, which matters when support teams handle account takeovers. E-commerce brands use it to reduce checkout fraud and protect customer accounts without adding constant re-logins that hurt conversions. Fintech and payments-adjacent apps benefit from the monitoring and containment steps, because incident response expectations are higher and “we’ll check logs later” is not good enough. Healthcare and patient portals apply it to tighten session handling and audit-friendly logging while still keeping the experience usable for non-technical patients."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for designing JWT authentication produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like “Write me a JWT auth setup for my app” fails because it: lacks key context like subdomains, cross-site requests, and your actual tech stack, so cookie and CORS advice comes out wrong. It provides no enforceable structure for refresh rotation and replay detection, which is where many real attacks land. It ignores CSRF tradeoffs that appear the moment you use cookies, so you get insecure defaults or vague “enable CSRF.” It produces generic “store the token in localStorage” patterns instead of a design that keeps tokens out of JavaScript. And it usually misses monitoring plus containment steps, so you have no plan when sessions are being abused."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this JWT auth blueprint prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes, but you need to feed it the right variables in the format it expects, especially [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY]. Add your domain model (single domain vs api/app subdomains), your login UX requirements (silent refresh, “remember me,” device limits), and any constraints like “must support third-party embedded widgets.” A good follow-up is: “Given [BACKEND_TECHNOLOGY] and [FRONTEND_TECHNOLOGY], output the exact cookie names, SameSite values, CORS settings, and the refresh endpoint pseudocode.” If you have an existing system, ask it to produce a migration plan in phases so you can ship safely."
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this JWT auth blueprint prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving [BACKEND_TECHNOLOGY] too vague — instead of “Python,” try “Python 3.12 + FastAPI + Uvicorn behind Cloudflare.” Another common error is underspecifying [FRONTEND_TECHNOLOGY]; “React” is different from “Next.js with server actions,” and cookie behavior and routing matter. People also forget to describe their domain setup, which is how you end up with unusable SameSite/CORS guidance; “single origin https://app.example.com” is a good input, “we have a website” is not. Finally, teams skip UX requirements, so the model may choose lifetimes that cause constant logins; say “silent refresh required, tolerate re-login only after 14 days or password change.”"
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this JWT auth blueprint prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for teams that need a full SSO/IAM vendor decision or enterprise federation design, because it is focused on deployable cookie-based JWT patterns, not product selection. It’s also a poor fit if you want a one-page quick template without iteration, since the best results come from clarifying your stack, domain model, and threat assumptions. And if you can’t use HTTP-only cookies at all (for example, a constrained client environment that forbids them), you will need a different approach. In those cases, start with a formal architecture review or a dedicated auth framework evaluation instead."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">

<p>Auth is one of those systems you only notice when it fails, and attackers notice it first. Use this prompt to get a token-safe, cookie-based JWT blueprint you can actually implement, then paste it into your AI tool and start tightening the real seams.</p>

</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5001440.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Design Cookie-Based JWT Auth Flow AI Prompt</title>
		<link>https://flowpast.com/prompts/design-cookie-based-jwt-auth-flow-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:48:24 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5001439</guid>

					<description><![CDATA[Cookie sessions get hijacked - a proven AI Prompt that designs JWT auth with HTTP-only cookies, CSRF defense, rotation, middleware, and logging. Discover more AI prompts for marketing, sales, and ops.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: cookie-based JWT auth -->
<div class="hook-introduction">

<p>JWT auth breaks in the boring places. Tokens end up in localStorage, XSS turns into account takeover, and refresh flows become a pile of edge cases nobody monitors. Then you ship “good enough” auth and spend the next quarter chasing weird logout bugs and suspicious replays.</p>



<p>This <strong>cookie-based JWT auth</strong> is built for <strong>product engineers</strong> who need a secure login/refresh/logout flow that won’t leak tokens to browser JavaScript, <strong>tech leads</strong> who have to standardize middleware and cookie policies across multiple services, and <strong>security-minded founders</strong> who want a practical plan before a penetration test. The output is a production-grade design doc with implementation patterns (cookies, headers, rotation rules, middleware structure) plus logging and monitoring signals you can actually wire up.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It maps an end-to-end login → authenticated request → silent refresh → logout flow where the browser never reads tokens via JavaScript.</li>
          <li>It defines an access/refresh token model, including lifetimes, rotation strategy, and how to invalidate sessions server-side after theft or logout.</li>
          <li>It specifies cookie flags and header patterns (SameSite, Secure, HttpOnly, Path scoping, CSRF headers) with concrete configuration defaults.</li>
          <li>It provides middleware patterns to authenticate requests, attach user context, handle clock skew, and block tampered or replayed tokens.</li>
          <li>It adds operational guidance: what to log, which signals indicate abuse, and what alerts help you catch refresh-token reuse quickly.</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>You are migrating away from localStorage/sessionStorage tokens and need a safer approach without rewriting the whole front end.</li>
          <li>Your refresh flow is unreliable (random 401s, logout loops, “works on my machine”), and you need clear error behavior and race handling.</li>
          <li>You are about to ship an SPA + API and need CSRF defenses that match cookie-based auth rather than bearer tokens.</li>
          <li>A security review or customer questionnaire is asking how you prevent XSS token harvesting, replay after theft, and session hijacking.</li>
          <li>You are scaling to multiple services and need consistent middleware and logging conventions so incidents can be investigated fast.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A complete auth flow blueprint with step-by-step request/response sequences for login, refresh, and logout.</li>
           <li>A token policy table that includes access/refresh TTLs, rotation rules, reuse detection, and safe clock-skew handling.</li>
           <li>Cookie and header configuration examples (HttpOnly/Secure/SameSite, CSRF header, CORS notes) ready to paste into docs.</li>
           <li>Middleware pseudocode for auth verification, user-context attachment, and consistent error responses across endpoints.</li>
           <li>A monitoring checklist with concrete log fields and alert ideas for replay attempts, refresh anomalies, and suspicious logout races.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: Production-Grade Cookie JWT Auth Flow</h2>



<div class="prompt-viewer-wrapper" id="prompt-section">
    <div class="prompt-comparison-row prompt-premium">
        <!-- Header with buttons -->
        <div class="prompt-row-header">
            <!-- <span class="prompt-row-icon">✨</span> -->
            <span class="prompt-row-title">
                                    Step 1: Customize the prompt with your input
                            </span>
            <div class="prompt-header-buttons">
                                    <button class="prompt-header-btn prompt-header-reset" onclick="resetPrompt()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                                <button class="prompt-header-btn prompt-header-copy-green flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span>Customize and Copy Full Prompt</span>
                </button>
            </div>
        </div>

        <!-- Customize the Prompt Section -->
                    <div class="prompt-customize-section">
                <span class="customize-title">Customize the Prompt</span>
                <p class="customize-subtitle">Fill in the fields below to personalize this prompt for your needs.</p>
                <table class="customize-table">
                    <thead>
                        <tr>
                            <th>Variable</th>
                            <th>What to Enter</th>
                            <th>Customise the prompt</th>
                        </tr>
                    </thead>
                    <tbody>
                                                    <tr>
                                <td class="var-name"><code>[FORMAT]</code></td>
                                <td class="var-desc">
                                    Specify the type of application you are working on, such as web, mobile, or desktop, and include any relevant details about its functionality or user interaction.                                    <div class="var-example">For example: "Single-page web application for e-commerce, built with React and interacting with REST APIs."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[FORMAT]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[CONTEXT]</code></td>
                                <td class="var-desc">
                                    Provide details about the frameworks, runtime environment, hosting setup, and reverse proxy configuration currently in use for the application.                                    <div class="var-example">For example: "Node.js backend using Express, hosted on AWS Lambda with an NGINX reverse proxy in front."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[CONTEXT]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[CHALLENGE]</code></td>
                                <td class="var-desc">
                                    Outline the specific security or compliance standards the application must adhere to, such as SOC2, HIPAA, PCI, or GDPR.                                    <div class="var-example">For example: "The application must comply with GDPR for handling user data and SOC2 for operational security standards."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[CHALLENGE]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[TIMEFRAME]</code></td>
                                <td class="var-desc">
                                    Specify the desired session length, including both idle timeout and absolute expiration duration, to help define token lifetimes.                                    <div class="var-example">For example: "Idle timeout of 15 minutes and absolute session expiration after 24 hours."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[TIMEFRAME]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[PRODUCT_DESCRIPTION]</code></td>
                                <td class="var-desc">
                                    Describe any observed vulnerabilities or issues with the current authentication system, such as token theft, session hijacking, or poor logout handling.                                    <div class="var-example">For example: "Tokens stored in localStorage are vulnerable to XSS attacks, and session hijacking has been observed due to missing CSRF protection."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[PRODUCT_DESCRIPTION]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                            </tbody>
                </table>

                <button class="copy-customized-btn flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span class="copy-customized-text">Customise the prompt now</span>
                </button>
            </div>
        
        <!-- Full Prompt Code Header -->
                    <div class="prompt-code-header">
                <span class="prompt-code-title">
                    Step 2: Copy the Prompt
                </span>
                <div class="prompt-code-buttons">
                    <!-- Reset: Only visible when unlocked -->
                    <button class="prompt-header-btn prompt-header-reset btn-when-unlocked" onclick="resetPrompt()" style="display: none;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                    <!-- Copy Full Prompt -->
                    <button class="prompt-header-btn prompt-header-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                            <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                        </svg>
                        <span>Copy Full Prompt</span>
                    </button>
                </div>
            </div>
        

        <!-- Prompt Content -->
        <div class="prompt-box prompt-gated-wrapper">
            <!-- Gated: Blurred content -->
            <div class="prompt-gated-content">
                <div class="prompt-header-visible">OBJECTIVE</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PERSONA</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">CONSTRAINTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PROCESS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">What This Is NOT (scope boundaries)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">INPUTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">OUTPUT SPECIFICATION</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">1) {Security Architecture}</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">2) {Cookie Implementation}</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">3) {Token Refresh System}</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">4) {Validation Middleware}</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">5) {Logout Security}</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">6) {Frontend Integration}</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">7) {Security Monitoring}</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">8) {Implementation Checklist}</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">QUALITY CHECKS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div>            </div>
            <!-- Unlocked: Full content (hidden by default) -->
            <div class="prompt-content-full" id="premium-prompt-content" style="display: none;">
                ## OBJECTIVE
Create a production-grade JWT authentication design that removes all browser-accessible token storage and closes the common exploit paths (XSS token harvesting, token replay after theft, session hijacking). The deliverable must explain exactly how to implement HTTP-only cookie auth, silent refresh, server-side validation, and secure sign-out—complete with code patterns and operational monitoring guidance.

## PERSONA
Act as an ex–security advisor focused on real-world auth failures. You think in attacker workflows first, favor defenses that are transparent to legitimate users, and you translate security intent into implementable engineering steps for modern web stacks.

## CONSTRAINTS
- Prioritize architectures where tokens are never read or stored by client JavaScript.
- Use HTTP-only cookies as the primary transport for session credentials.
- Include CSRF defenses appropriate for cookie-based auth.
- Provide specific configuration values/patterns (cookie flags, headers, rotation rules, middleware structure), not vague best practices.
- Keep the front end free of token logic; the server owns issuance, refresh, and invalidation.
- Include explicit handling for expiration, tampering, reuse, clock skew, and logout races.
- Add practical logging/monitoring signals for auth abuse detection.
- If inputs are missing or unclear, ask targeted questions and provide safe default assumptions labeled as such.

## PROCESS
1. **Pre-Analysis Step (required):** Briefly restate the scenario in your own words and list any assumptions you’ll use.
2. Propose the end-to-end auth flow (login → authenticated requests → refresh → logout).
3. Define token model: access vs refresh token responsibilities, lifetimes, rotation, and server-side invalidation strategy.
4. Specify cookie settings and security headers for the given stack/environment.
5. Provide middleware patterns for request authentication and user-context attachment.
6. Detail error behavior (what the client sees vs what gets logged) for each failure mode.
7. Add monitoring guidance (events, metrics, alerts) tuned for token abuse.
8. Finish with an implementation checklist that engineers can follow and verify.

### What This Is NOT (scope boundaries)
- Not a generic “JWT overview” or cryptography primer.
- Not a recommendation to store tokens in localStorage/sessionStorage.
- Not a substitute for a full penetration test or legal compliance review.
- Not a one-size-fits-all SSO/OAuth redesign unless explicitly requested.

## INPUTS
- **Application type:** [FORMAT]
- **Current tech stack (frameworks, runtime, hosting, reverse proxy):** [CONTEXT]
- **Security/compliance requirements (e.g., SOC2, HIPAA, PCI, GDPR):** [CHALLENGE]
- **Desired session length (idle + absolute):** [TIMEFRAME]
- **Existing authentication issues/vulnerabilities observed:** [PRODUCT_DESCRIPTION]

## OUTPUT SPECIFICATION
Use the following sections and include implementation-ready detail in each:

### 1) {Security Architecture}
- Threat model summary: {Primary Threats} and {Excluded Threats}
- Recommended JWT layout: {Token Types}, {Claims}, {Signing Algorithm}, {Key Management}
- Session strategy: {Access Lifetime}, {Refresh Lifetime}, {Rotation Policy}, {Revocation Approach}
- Request flow diagram (text): {Flow Steps}

### 2) {Cookie Implementation}
- Cookie set(s) required: {Cookie Names} and purposes
- Exact cookie attributes with rationale:
  - {HttpOnly}, {Secure}, {SameSite}, {Domain}, {Path}, {MaxAge}
- Required headers &amp; platform controls:
  - {CSP Guidance}, {HSTS}, {X-Content-Type-Options}, {Referrer-Policy}
- CSRF protections for cookie auth:
  - {CSRF Pattern} (e.g., double-submit or synchronizer token) and when to enforce it

### 3) {Token Refresh System}
- Refresh endpoint design: {Route}, {Expected Cookies}, {Response Behavior}
- Rotation &amp; reuse detection: {How You Detect Replay}, {What You Invalidate}
- Concurrency handling: {Multiple Tabs Strategy} and {Race Resolution}
- Example server pseudo/code: {Refresh Handler Example}

### 4) {Validation Middleware}
- Middleware responsibilities: {Verification Steps} (signature, exp/nbf, issuer/audience, jti, user status)
- User context attachment: {User Context Shape}
- Authorization hooks: {RBAC/ABAC Extension Points}
- Example middleware pseudo/code: {Middleware Example}

### 5) {Logout Security}
- Logout types: {Client-Initiated Logout} and {Server-Forced Logout}
- Invalidation design: {Blacklist/Allowlist/Session Store} and retention window
- Cookie clearing strategy: {Clear Cookie Rules} (path/domain alignment)
- Example endpoint pseudo/code: {Logout Handler Example}

### 6) {Frontend Integration}
- Frontend request rules: {Fetch/XHR Settings} (credentials mode, CORS interaction)
- UI auth state approach: {Session Check Endpoint} and caching guidance
- No-token guarantee: explicitly state what the frontend must never do

### 7) {Security Monitoring}
- Error taxonomy: {Client-Facing Errors} vs {Server Logs}
- Log events to capture: {Auth Event List} (failed verification, refresh reuse, abnormal IP/UA shifts)
- Metrics &amp; alerts: {Alert Conditions} and {Suggested Thresholds}
- Incident response notes: {Triage Steps} for suspected token theft

### 8) {Implementation Checklist}
Provide a step-by-step list where each step includes:
- {Step}
- {How To Implement}
- {How To Verify}
- {Failure Modes To Test}

## QUALITY CHECKS
At the end, include a verification list confirming:
- Tokens are never accessible to client JavaScript (no localStorage/sessionStorage, no JS-readable cookies).
- Cookies use appropriate flags and CSRF protections are enforced where needed.
- Refresh rotation + reuse detection is defined and implementable server-side.
- Middleware validates all critical claims and handles clock skew/tampering safely.
- Logout reliably invalidates sessions and clears cookies without path/domain mismatches.            </div>
        </div>


    </div>

    <!-- CTA Row - Full width buttons -->
    <div class="prompt-cta-row">
        <button class="prompt-cta-btn prompt-cta-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
            </svg>
            <span class="cta-copy-text">Copy Full Prompt</span>
        </button>
    </div>
</div>

<style>
    /* Gated prompt states */
    .prompt-gated-wrapper {
        position: relative;
    }

    /* When unlocked - show full content, hide gated */
    body.flowpast-unlocked .prompt-gated-wrapper .prompt-gated-content {
        display: none;
    }

    body.flowpast-unlocked .prompt-gated-wrapper .prompt-content-full {
        display: block !important;
    }

    /* Show/hide elements based on unlock state */
    body.flowpast-unlocked .btn-when-unlocked {
        display: inline-flex !important;
    }

    .prompt-viewer-wrapper {
        scroll-margin-top: 250px;
    }

    /* ========================================
   PROMPT VIEWER - MAIN WRAPPER
   ======================================== */
    .prompt-viewer-wrapper {
        margin: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ========================================
   PROMPT BOX CONTAINER
   ======================================== */
    .prompt-comparison-row {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    /* ========================================
   HEADER WITH BUTTONS
   ======================================== */
    .prompt-row-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .prompt-row-icon {
        font-size: 20px;
    }

    .prompt-row-title {
        font-weight: 600;
        font-size: 22px;
        color: #fff !important;
        text-decoration: underline
    }

    .prompt-header-buttons {
        margin-left: auto;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Header buttons */
    .prompt-header-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-header-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-header-copy:hover {
        background: #2a2a2a;
    }

    .prompt-header-copy.copied {
        background: #2e7d32;
    }

    .prompt-header-copy-green {
        background: #04AA6D !important;
        color: #fff !important;
    }

    .prompt-header-copy-green:hover {
        background: #039860 !important;
    }

    .prompt-header-copy-green.copied {
        background: #2e7d32 !important;
    }

    .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-header-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-1px);
    }

    /* ========================================
   PROMPT CONTENT - FULL (NO SCROLL)
   ======================================== */
    .prompt-box {
        background: #ffffff;
    }

    .prompt-content-full {
        padding: 24px;
        margin: 0;
        color: #202124;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.7;
        white-space: pre-wrap;
        word-wrap: break-word;
        /* No scroll - show full content */
        max-height: none;
        overflow: visible;
    }

    /* Highlighted variable in prompt */
    .prompt-variable {
        background: #fff3cd;
        color: #1967d2;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ffc107;
    }

    .prompt-variable-filled {
        background: #d4edda;
        color: #155724;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #28a745;
    }

    /* ========================================
   GATED CONTENT (NO ACCESS)
   ======================================== */
    .prompt-gated-content {
        padding: 24px;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.8;
        max-height: none;
        overflow: visible;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        cursor: default;
    }

    /* ## headers - larger, black */
    .prompt-header-visible {
        color: #202124;
        font-weight: 600;
        margin: 5px 0 0px 0;
        font-size: 20px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* ### headers - smaller, black */
    .prompt-header-visible.subheader {
        color: #202124;
        font-weight: 600;
        margin: 5px 0;
        font-size: 18px;
    }

    .prompt-header-visible:first-child {
        margin-top: 0;
    }

    /* ========================================
   LOCKED SECTION BLOCK
   ======================================== */
    .locked-section {
        position: relative;
        margin: 4px 0 8px 0;
        border-radius: 6px;
        overflow: hidden;
        background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .locked-section-bg {
        position: relative;
    }

    .locked-section-lines {
        padding: 8px 12px;
        position: relative;
    }

    .locked-line {
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 3px;
        margin-bottom: 4px;
        margin-left: 12px;
    }

    .locked-line:last-child {
        margin-bottom: 0;
    }

    .locked-section-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        font-size: 24px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }

    /* Subheader locked sections - slightly indented */
    /*  .prompt-header-visible.subheader+.locked-section {
        margin-left: 16px;
    } */

    /* ========================================
   COMPATIBILITY BADGES
   ======================================== */
    .prompt-compatibility {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
    }

    .compat-label {
        font-size: 13px;
        color: #5f6368;
        font-weight: 500;
    }

    .compat-badge {
        padding: 4px 10px;
        background: #e8f0fe;
        color: #1967d2;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }

    /* ========================================
   CTA ROW - FULL WIDTH BUTTONS
   ======================================== */
    .prompt-cta-row {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .prompt-cta-btn {
        flex: 1;
        min-width: 200px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 24px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-cta-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-copy:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-copy.copied {
        background: #2e7d32;
    }

    .prompt-cta-reset {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-reset:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-cta-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    /* ========================================
    CUSTOMIZE YOUR PROMPT SECTION
    ======================================== */
    .prompt-customize-section {
        padding: 24px;
        border-bottom: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .customize-title {
        margin: 0 0 8px 0;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
    }

    .customize-subtitle {
        margin: 0 0 20px 0;
        font-size: 14px;
        color: #5f6368;
    }

    .customize-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .customize-table th {
        text-align: left;
        padding: 12px;
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        font-size: 13px;
        font-weight: 600;
        color: #202124;
    }

    .customize-table td {
        padding: 12px;
        border: 1px solid #e0e0e0;
        vertical-align: top;
    }

    .customize-table .var-name {
        width: 25%;
        background: #f8f9fa;
    }

    .customize-table .var-name code {
        background: #fff3cd;
        color: #1967d2;
        border: 1px solid #ffc107;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        word-break: break-all;
        font-weight: 600;
    }

    .customize-table .var-desc {
        width: 35%;
        font-size: 13px;
        color: #5f6368;
        line-height: 1.5;
    }

    .customize-table .var-example {
        margin-top: 8px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #dadce0;
        font-size: 12px;
        color: #5f6368;
        font-style: italic;
        border-radius: 0 4px 4px 0;
    }

    .customize-table .var-input {
        width: 40%;
    }

    .customize-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #dadce0;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .customize-input:focus {
        outline: none;
        border-color: rgb(5, 152, 98);
        box-shadow: 0 0 0 3px rgba(5, 152, 98, 0.1);
    }

    .customize-input::placeholder {
        color: #9aa0a6;
        font-style: italic;
    }

    .copy-customized-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: rgb(5, 152, 98);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .copy-customized-btn:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    .copy-customized-btn.copied {
        background: #2e7d32;
    }

    /* ========================================
    FULL PROMPT CODE HEADER
    ======================================== */
    .prompt-code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
    }

    .prompt-code-title {
        font-size: 22px;
        font-weight: 600;
        text-decoration: underline;

    }

    .prompt-code-buttons {
        display: flex;
        gap: 8px;
    }

    .prompt-code-buttons .prompt-header-btn {
        padding: 8px 14px;
        font-size: 13px;
        background: #ffffff;
        color: #202124;
        border: 1px solid #dadce0;
    }

    .prompt-code-buttons .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
        border-color: rgb(5, 152, 98);
    }

    .prompt-code-buttons .prompt-header-btn.prompt-header-access:hover {
        background: rgb(4, 130, 83) !important;
        border-color: rgb(4, 130, 83);
        color: #fff !important;
    }

    .prompt-code-buttons .prompt-header-btn:hover {
        background: #f1f3f4;
    }

    .prompt-code-buttons .prompt-header-copy.copied {
        background: #d4edda;
        color: #155724;
        border-color: #28a745;
    }

    .prompt-header-reset {
        background: #ffffff;
        color: #202124;
    }

    /* ========================================
   RESPONSIVE
   ======================================== */
    @media (max-width: 768px) {
        .prompt-row-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .prompt-header-buttons {
            margin-left: 0;
            width: 100%;
        }

        .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }

        .prompt-cta-row {
            flex-direction: column;
        }

        .prompt-cta-btn {
            width: 100%;
        }

        /* Customize table responsive */
        .customize-table,
        .customize-table thead,
        .customize-table tbody,
        .customize-table tr,
        .customize-table th,
        .customize-table td {
            display: block;
        }

        .customize-table thead {
            display: none;
        }

        .customize-table tr {
            margin-bottom: 16px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
        }

        .customize-table td {
            width: 100% !important;
            border: none;
            border-bottom: 1px solid #e0e0e0;
        }

        .customize-table td:last-child {
            border-bottom: none;
        }

        .customize-table .var-name {
            background: #f1f3f4;
            font-weight: 600;
        }

        .prompt-code-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }

        .prompt-code-buttons {
            width: 100%;
        }

        .prompt-code-buttons .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }
    }
</style>

<script>
    function handlePromptCopy() {
        // Check if unlocked via cookie
        if (typeof window.flowpastIsUnlocked === 'function' && !window.flowpastIsUnlocked()) {
            // Show email popup
            if (typeof window.flowpastShowEmailPopup === 'function') {
                window.flowpastShowEmailPopup('prompt');
            }
            return;
        }

        // Copy the customized prompt (with filled variables)
        const customizedPrompt = getCustomizedPrompt();
        const copyButtons = document.querySelectorAll('.prompt-header-copy, .prompt-header-copy-green, .prompt-cta-copy, .copy-customized-btn');

        navigator.clipboard.writeText(customizedPrompt).then(() => {
            copyButtons.forEach(btn => {
                btn.classList.add('copied');
                const textSpan = btn.querySelector('span');
                if (textSpan) textSpan.textContent = 'Copied!';
            });

            setTimeout(() => {
                copyButtons.forEach(btn => {
                    btn.classList.remove('copied');
                    const textSpan = btn.querySelector('span');
                    if (textSpan) textSpan.textContent = 'Copy Full Prompt';
                });
            }, 2000);
        }).catch(err => {
            console.error('Failed to copy:', err);
        });
    }

    // Store original prompt for customization
    const originalPrompt = "## OBJECTIVE\r\nCreate a production-grade JWT authentication design that removes all browser-accessible token storage and closes the common exploit paths (XSS token harvesting, token replay after theft, session hijacking). The deliverable must explain exactly how to implement HTTP-only cookie auth, silent refresh, server-side validation, and secure sign-out\u2014complete with code patterns and operational monitoring guidance.\r\n\r\n## PERSONA\r\nAct as an ex\u2013security advisor focused on real-world auth failures. You think in attacker workflows first, favor defenses that are transparent to legitimate users, and you translate security intent into implementable engineering steps for modern web stacks.\r\n\r\n## CONSTRAINTS\r\n- Prioritize architectures where tokens are never read or stored by client JavaScript.\r\n- Use HTTP-only cookies as the primary transport for session credentials.\r\n- Include CSRF defenses appropriate for cookie-based auth.\r\n- Provide specific configuration values\/patterns (cookie flags, headers, rotation rules, middleware structure), not vague best practices.\r\n- Keep the front end free of token logic; the server owns issuance, refresh, and invalidation.\r\n- Include explicit handling for expiration, tampering, reuse, clock skew, and logout races.\r\n- Add practical logging\/monitoring signals for auth abuse detection.\r\n- If inputs are missing or unclear, ask targeted questions and provide safe default assumptions labeled as such.\r\n\r\n## PROCESS\r\n1. **Pre-Analysis Step (required):** Briefly restate the scenario in your own words and list any assumptions you\u2019ll use.\r\n2. Propose the end-to-end auth flow (login \u2192 authenticated requests \u2192 refresh \u2192 logout).\r\n3. Define token model: access vs refresh token responsibilities, lifetimes, rotation, and server-side invalidation strategy.\r\n4. Specify cookie settings and security headers for the given stack\/environment.\r\n5. Provide middleware patterns for request authentication and user-context attachment.\r\n6. Detail error behavior (what the client sees vs what gets logged) for each failure mode.\r\n7. Add monitoring guidance (events, metrics, alerts) tuned for token abuse.\r\n8. Finish with an implementation checklist that engineers can follow and verify.\r\n\r\n### What This Is NOT (scope boundaries)\r\n- Not a generic \u201cJWT overview\u201d or cryptography primer.\r\n- Not a recommendation to store tokens in localStorage\/sessionStorage.\r\n- Not a substitute for a full penetration test or legal compliance review.\r\n- Not a one-size-fits-all SSO\/OAuth redesign unless explicitly requested.\r\n\r\n## INPUTS\r\n- **Application type:** [FORMAT]\r\n- **Current tech stack (frameworks, runtime, hosting, reverse proxy):** [CONTEXT]\r\n- **Security\/compliance requirements (e.g., SOC2, HIPAA, PCI, GDPR):** [CHALLENGE]\r\n- **Desired session length (idle + absolute):** [TIMEFRAME]\r\n- **Existing authentication issues\/vulnerabilities observed:** [PRODUCT_DESCRIPTION]\r\n\r\n## OUTPUT SPECIFICATION\r\nUse the following sections and include implementation-ready detail in each:\r\n\r\n### 1) {Security Architecture}\r\n- Threat model summary: {Primary Threats} and {Excluded Threats}\r\n- Recommended JWT layout: {Token Types}, {Claims}, {Signing Algorithm}, {Key Management}\r\n- Session strategy: {Access Lifetime}, {Refresh Lifetime}, {Rotation Policy}, {Revocation Approach}\r\n- Request flow diagram (text): {Flow Steps}\r\n\r\n### 2) {Cookie Implementation}\r\n- Cookie set(s) required: {Cookie Names} and purposes\r\n- Exact cookie attributes with rationale:\r\n  - {HttpOnly}, {Secure}, {SameSite}, {Domain}, {Path}, {MaxAge}\r\n- Required headers & platform controls:\r\n  - {CSP Guidance}, {HSTS}, {X-Content-Type-Options}, {Referrer-Policy}\r\n- CSRF protections for cookie auth:\r\n  - {CSRF Pattern} (e.g., double-submit or synchronizer token) and when to enforce it\r\n\r\n### 3) {Token Refresh System}\r\n- Refresh endpoint design: {Route}, {Expected Cookies}, {Response Behavior}\r\n- Rotation & reuse detection: {How You Detect Replay}, {What You Invalidate}\r\n- Concurrency handling: {Multiple Tabs Strategy} and {Race Resolution}\r\n- Example server pseudo\/code: {Refresh Handler Example}\r\n\r\n### 4) {Validation Middleware}\r\n- Middleware responsibilities: {Verification Steps} (signature, exp\/nbf, issuer\/audience, jti, user status)\r\n- User context attachment: {User Context Shape}\r\n- Authorization hooks: {RBAC\/ABAC Extension Points}\r\n- Example middleware pseudo\/code: {Middleware Example}\r\n\r\n### 5) {Logout Security}\r\n- Logout types: {Client-Initiated Logout} and {Server-Forced Logout}\r\n- Invalidation design: {Blacklist\/Allowlist\/Session Store} and retention window\r\n- Cookie clearing strategy: {Clear Cookie Rules} (path\/domain alignment)\r\n- Example endpoint pseudo\/code: {Logout Handler Example}\r\n\r\n### 6) {Frontend Integration}\r\n- Frontend request rules: {Fetch\/XHR Settings} (credentials mode, CORS interaction)\r\n- UI auth state approach: {Session Check Endpoint} and caching guidance\r\n- No-token guarantee: explicitly state what the frontend must never do\r\n\r\n### 7) {Security Monitoring}\r\n- Error taxonomy: {Client-Facing Errors} vs {Server Logs}\r\n- Log events to capture: {Auth Event List} (failed verification, refresh reuse, abnormal IP\/UA shifts)\r\n- Metrics & alerts: {Alert Conditions} and {Suggested Thresholds}\r\n- Incident response notes: {Triage Steps} for suspected token theft\r\n\r\n### 8) {Implementation Checklist}\r\nProvide a step-by-step list where each step includes:\r\n- {Step}\r\n- {How To Implement}\r\n- {How To Verify}\r\n- {Failure Modes To Test}\r\n\r\n## QUALITY CHECKS\r\nAt the end, include a verification list confirming:\r\n- Tokens are never accessible to client JavaScript (no localStorage\/sessionStorage, no JS-readable cookies).\r\n- Cookies use appropriate flags and CSRF protections are enforced where needed.\r\n- Refresh rotation + reuse detection is defined and implementable server-side.\r\n- Middleware validates all critical claims and handles clock skew\/tampering safely.\r\n- Logout reliably invalidates sessions and clears cookies without path\/domain mismatches.";
    const variables = ["[FORMAT]","[CONTEXT]","[CHALLENGE]","[TIMEFRAME]","[PRODUCT_DESCRIPTION]"];
    // Initial render with highlighted variables
    document.addEventListener('DOMContentLoaded', function() {
        renderPromptWithHighlights();
    });

    // Live update prompt as user types
    document.querySelectorAll('.customize-input').forEach(input => {
        input.addEventListener('input', renderPromptWithHighlights);
    });

    function renderPromptWithHighlights() {
        const promptContent = document.getElementById('premium-prompt-content');
        if (!promptContent) return;

        let updatedPrompt = originalPrompt;
        let filledVariables = {};

        // Collect filled values
        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                filledVariables[placeholder] = value;
            }
        });

        // Replace filled variables and highlight remaining
        let htmlContent = escapeHtml(updatedPrompt);

        variables.forEach(placeholder => {
            const escapedPlaceholder = escapeHtml(placeholder);
            const regex = new RegExp(escapeRegex(escapedPlaceholder), 'g');

            if (filledVariables[placeholder]) {
                // Show filled value with green highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable-filled">' + escapeHtml(filledVariables[placeholder]) + '</span>'
                );
            } else {
                // Show original placeholder with yellow highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable">' + escapedPlaceholder + '</span>'
                );
            }
        });

        promptContent.innerHTML = htmlContent;
    }

    function escapeRegex(string) {
        return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    }

    function escapeHtml(text) {
        const div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function resetPrompt() {
        // Clear all input fields
        document.querySelectorAll('.customize-input').forEach(input => {
            input.value = '';
        });

        // Re-render with original placeholders highlighted
        renderPromptWithHighlights();

        // Visual feedback
        const resetBtns = document.querySelectorAll('.prompt-header-reset, .prompt-cta-reset');
        resetBtns.forEach(btn => {
            const originalText = btn.querySelector('span').textContent;
            btn.querySelector('span').textContent = 'Reset!';
            setTimeout(() => {
                btn.querySelector('span').textContent = originalText;
            }, 1000);
        });
    }


    function getCustomizedPrompt() {
        let updatedPrompt = originalPrompt;

        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                const regex = new RegExp(escapeRegex(placeholder), 'g');
                updatedPrompt = updatedPrompt.replace(regex, value);
            }
        });

        return updatedPrompt;
    }
</script>

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>State your client type and API topology.</strong> Tell the prompt if you have an SPA hitting a separate API domain, a monolith, or a BFF (backend-for-frontend). Add one line like: “Frontend: Next.js on app.example.com, API: api.example.com behind ALB” so cookie domain/path and CORS/CSRF details come out correctly.</li>


<li><strong>Ask for a concrete cookie matrix.</strong> After the first output, follow up with: “Give me the exact cookie names, flags, domain/path scope, and max-age for access, refresh, and CSRF cookies.” This forces specific values instead of generalities and makes implementation reviews easier.</li>


<li><strong>Force reuse-detection and logout race handling.</strong> Many designs skip this, and frankly it’s where real incidents live. Prompt: “Include refresh token rotation with reuse detection, and explain what happens when a stolen refresh is used after the legit client already rotated.”</li>


<li><strong>Iterate on error behavior, not just security.</strong> Once you get the secure flow, ask: “Now rewrite the client-visible errors and retry rules to avoid infinite refresh loops; include examples for 401 vs 403 vs 419 (CSRF) responses.” The goal is secure and calm UX.</li>


<li><strong>Make it operational by requesting log schemas.</strong> Add: “Provide a JSON log example for login, refresh, refresh-deny (replay), and logout, including fields like user_id, session_id, token_family_id, ip_hash, user_agent_hash, and reason codes.” That turns a design into something your SIEM can use.</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>Once your auth flow is designed, you’ll usually need check-in systems and onboarding workflows to roll it out safely across teams and customers.</p>



<p>If you also need a structured way to keep users engaged after launch (and catch issues early), <a href="https://flowpast.com/prompts/build-a-customer-check-in-system-with-this-ai-prompt/">Build a Customer Check-In System with this AI Prompt</a> helps you design a repeatable cadence, questions, and follow-ups. It pairs well with security changes because cookie/auth migrations often create subtle friction, and proactive check-ins surface it before churn does.</p>



<p>For teams doing internal rollouts, <a href="https://flowpast.com/prompts/build-a-first-week-onboarding-checklist-with-this-ai-prompt/">Build a First-Week Onboarding Checklist with this AI Prompt</a> can turn your new auth requirements into a clear first-week plan for engineers and support. Use it when you’re standardizing cookie flags, CSRF expectations, or logging fields across repos and want fewer “but I didn’t know” surprises.</p>



<p>Security work can be intense, and burn-out makes mistakes more likely. When you want to spot process strain while you’re pushing important changes, <a href="https://flowpast.com/prompts/workplace-well-being-diagnosis-and-action-plan-ai-prompt/">Workplace Well-Being Diagnosis and Action Plan AI Prompt</a> gives you a practical way to diagnose team bottlenecks, on-call pain, and workflow gaps that often show up during auth or infrastructure migrations.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/build-a-customer-check-in-system-with-this-ai-prompt/">Build a Customer Check-In System with this AI Prompt</a>: Create cadence, questions, and follow-up workflow.</li>


<li><a href="https://flowpast.com/prompts/build-a-first-week-onboarding-checklist-with-this-ai-prompt/">Build a First-Week Onboarding Checklist with this AI Prompt</a>: Turn changes into clear week-one tasks.</li>

<li><a href="https://flowpast.com/prompts/workplace-well-being-diagnosis-and-action-plan-ai-prompt/">Workplace Well-Being Diagnosis and Action Plan AI Prompt</a>: Identify bottlenecks and reduce rollout stress.</li>


<li><a href="https://flowpast.com/prompts/build-a-recurring-life-check-in-worksheet-ai-prompt/">Build a Recurring Life Check-In Worksheet AI Prompt</a>: Build a repeatable self-review structure.</li>


<li><a href="https://flowpast.com/prompts/build-a-shame-free-spending-check-in-with-this-ai-prompt/">Build a Shame-Free Spending Check-In with this AI Prompt</a>: Create a clear spending review routine.</li>

</ul>
<!-- /wp:post-content -->
</div>

<div class="faq-section">
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading">Common Questions</h2>
<!-- /wp:heading -->

<div class="faq-item">
<span class="question">Which roles benefit most from this cookie-based JWT auth AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>Backend engineers</strong> use this to turn “use HttpOnly cookies” into an actual flow with middleware, rotation, and server-side invalidation. <strong>Frontend leads</strong> benefit because the design keeps the UI free of token storage and refresh logic, reducing fragile client code and weird edge cases. <strong>Security engineers</strong> apply it to threat-model common exploit paths (XSS harvesting, replay, session fixation) and verify controls like CSRF defense and reuse detection. <strong>Engineering managers</strong> use the deliverable as a rollout reference so multiple services implement the same cookie flags, error behavior, and logging fields.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this cookie-based JWT auth AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>SaaS companies</strong> get value because multi-tenant apps often face strict security questionnaires, and a documented cookie-based JWT approach with rotation and monitoring answers them cleanly. <strong>E-commerce brands</strong> benefit when checkout and account areas are frequent XSS targets; keeping tokens out of JavaScript reduces the blast radius of a front-end bug. <strong>Fintech and regulated products</strong> use this to align session handling with compliance expectations like strong logout behavior, session invalidation, and audit-friendly logs. <strong>Agencies building web platforms for clients</strong> can standardize an auth baseline across projects, which makes delivery faster and reduces “custom auth” liability.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for designing cookie-based JWT auth flows produce weak results?</span>
<!-- wp:paragraph -->
<p class="answer">A typical prompt like &#8220;<em>Write me a secure JWT auth system using cookies</em>&#8221; fails because it: lacks concrete rotation and reuse-detection rules, provides no middleware structure for verification and user-context attachment, ignores CSRF mechanics that are mandatory for cookie credentials, produces vague “set HttpOnly and Secure” advice instead of exact cookie/header patterns, and misses operational guidance like logging fields and alertable signals. You end up with something that sounds secure but falls apart under replay, logout races, and real attacker workflows.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Can I customize this cookie-based JWT auth prompt for my specific situation?</span>
<!-- wp:paragraph -->
<p class="answer">Yes. The fastest way is to prepend your environment details (SPA vs server-rendered, single domain vs subdomains, mobile clients, and whether you have a gateway/proxy that terminates TLS). Then ask for stack-specific output, for example: “Assume Node/Express + Next.js behind Cloudflare; give cookie Domain/Path, SameSite choice, CSRF header pattern, and middleware pseudocode.” If you have unusual constraints (cross-site embeds, third-party IdP, multiple APIs), say so up front and request “safe defaults” plus alternative options with tradeoffs.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this cookie-based JWT auth prompt?</span>
<!-- wp:paragraph -->
<p class="answer">The biggest mistake is leaving the deployment topology vague—instead of “a web app,” say “SPA on app.example.com calling api.example.com with credentials included.” Another common error is not asking for explicit CSRF handling; “we use cookies” is not enough, so request a specific double-submit or origin/CSRF-header pattern and when to enforce it. Teams also forget to demand refresh rotation details, which leads to replayable refresh tokens; ask for “rotation plus server-side reuse detection” and what happens on reuse. Finally, people skip monitoring outputs; insist on a list of log fields and sample events so you can detect refresh storms, invalid signature spikes, and suspicious geo/IP changes.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Who should NOT use this cookie-based JWT auth prompt?</span>
<!-- wp:paragraph -->
<p class="answer">This prompt isn’t ideal for teams that need a minimal, one-endpoint demo and won’t implement rotation, invalidation, and monitoring. It’s also a poor fit if your product is strictly non-browser (for example, machine-to-machine APIs) where cookies and CSRF simply aren’t the right tools. And if you have not validated basic requirements like session duration, device trust rules, or logout expectations, the design may feel too “heavy” too early. In those cases, start by documenting requirements and threat model scope, then come back to this prompt for the production-ready version.</p>
<!-- /wp:paragraph -->
</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this cookie-based JWT auth AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Backend engineers use this to turn “use HttpOnly cookies” into an actual flow with middleware, rotation, and server-side invalidation. Frontend leads benefit because the design keeps the UI free of token storage and refresh logic, reducing fragile client code and weird edge cases. Security engineers apply it to threat-model common exploit paths (XSS harvesting, replay, session fixation) and verify controls like CSRF defense and reuse detection. Engineering managers use the deliverable as a rollout reference so multiple services implement the same cookie flags, error behavior, and logging fields."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this cookie-based JWT auth AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SaaS companies get value because multi-tenant apps often face strict security questionnaires, and a documented cookie-based JWT approach with rotation and monitoring answers them cleanly. E-commerce brands benefit when checkout and account areas are frequent XSS targets; keeping tokens out of JavaScript reduces the blast radius of a front-end bug. Fintech and regulated products use this to align session handling with compliance expectations like strong logout behavior, session invalidation, and audit-friendly logs. Agencies building web platforms for clients can standardize an auth baseline across projects, which makes delivery faster and reduces “custom auth” liability."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for designing cookie-based JWT auth flows produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like \"Write me a secure JWT auth system using cookies\" fails because it: lacks concrete rotation and reuse-detection rules, provides no middleware structure for verification and user-context attachment, ignores CSRF mechanics that are mandatory for cookie credentials, produces vague “set HttpOnly and Secure” advice instead of exact cookie/header patterns, and misses operational guidance like logging fields and alertable signals. You end up with something that sounds secure but falls apart under replay, logout races, and real attacker workflows."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this cookie-based JWT auth prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. The fastest way is to prepend your environment details (SPA vs server-rendered, single domain vs subdomains, mobile clients, and whether you have a gateway/proxy that terminates TLS). Then ask for stack-specific output, for example: “Assume Node/Express + Next.js behind Cloudflare; give cookie Domain/Path, SameSite choice, CSRF header pattern, and middleware pseudocode.” If you have unusual constraints (cross-site embeds, third-party IdP, multiple APIs), say so up front and request “safe defaults” plus alternative options with tradeoffs."
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this cookie-based JWT auth prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving the deployment topology vague—instead of “a web app,” say “SPA on app.example.com calling api.example.com with credentials included.” Another common error is not asking for explicit CSRF handling; “we use cookies” is not enough, so request a specific double-submit or origin/CSRF-header pattern and when to enforce it. Teams also forget to demand refresh rotation details, which leads to replayable refresh tokens; ask for “rotation plus server-side reuse detection” and what happens on reuse. Finally, people skip monitoring outputs; insist on a list of log fields and sample events so you can detect refresh storms, invalid signature spikes, and suspicious geo/IP changes."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this cookie-based JWT auth prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for teams that need a minimal, one-endpoint demo and won’t implement rotation, invalidation, and monitoring. It’s also a poor fit if your product is strictly non-browser (for example, machine-to-machine APIs) where cookies and CSRF simply aren’t the right tools. And if you have not validated basic requirements like session duration, device trust rules, or logout expectations, the design may feel too “heavy” too early. In those cases, start by documenting requirements and threat model scope, then come back to this prompt for the production-ready version."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">
<!-- wp:paragraph -->
<p>Auth is either calm or chaotic. This prompt helps you design the calm version, with cookies, CSRF defense, rotation, and monitoring spelled out so you can implement it with confidence.</p>
<!-- /wp:paragraph -->
</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5001439.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Build a React Error Boundary Package with this AI Prompt</title>
		<link>https://flowpast.com/prompts/build-a-react-error-boundary-package-with-this-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:47:14 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5001438</guid>

					<description><![CDATA[React crashes take pages down - the ultimate AI Prompt that delivers a reusable Error Boundary package with fallbacks, retries, tests, and telemetry. Discover more AI prompts for marketing, sales, and ops.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: React error boundary -->
<div class="hook-introduction">

<p>React apps don’t usually fail gracefully. One buggy widget can trigger a blank screen, wipe out conversion paths, and leave you scrambling for logs you can’t trust. And the worst part? It often happens in production, not in your tidy local environment.</p>



<p>This <strong>React error boundary</strong> is built for <strong>frontend leads</strong> shipping complex UIs under incident pressure, <strong>SaaS product teams</strong> who need better telemetry and safer releases, and <strong>agency developers</strong> who have to deliver a reusable “drop-in” reliability layer across multiple client codebases. The output is a production-usable Error Boundary package in React (with TypeScript support), including fallback UI patterns, reset/retry flows, monitoring integration points, edge-case guidance, and realistic tests.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>Generates a reusable ErrorBoundary “circuit breaker” system that isolates failures to a subtree instead of crashing the whole UI.</li>
          <li>Designs accessible, customizable fallback experiences that include meaningful messaging and optional reset or “try again” behaviors.</li>
          <li>Creates a clean integration surface for error reporting (with a safe default) so you can plug in Sentry, Datadog, New Relic, or custom logging.</li>
          <li>Explains placement patterns (route-level, feature-level, widget-level) and provides example layouts that match real app architectures.</li>
          <li>Adds test guidance and sample tests (unit plus integration) so the boundary behavior doesn’t regress during refactors.</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>A recent release introduced intermittent “white screen” crashes and you need containment plus diagnostics fast.</li>
          <li>Your UI has third-party components (charts, editors, payment widgets) and you can’t control their failure modes.</li>
          <li>You are preparing for a high-traffic event and need graceful degradation for non-critical panels and widgets.</li>
          <li>Your incident process requires clear reporting, but current logs don’t capture component stack context reliably.</li>
          <li>You are standardizing frontend platform patterns across multiple repos and want one boundary package everyone can adopt.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A reusable ErrorBoundary package structure (components, utilities, and integration hooks) you can paste into a codebase.</li>
           <li>At least 3 fallback UI variants (minimal, user-helpful, and “retry/reset” capable) with accessibility considerations.</li>
           <li>A monitoring/reporting adapter interface with a default reporter and examples for swapping implementations.</li>
           <li>A placement guide with concrete examples for route boundaries, feature boundaries, and widget boundaries.</li>
           <li>A starter test suite outline plus example tests for fallback rendering, reset behavior, and reporter calls.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: Enterprise React Error Boundary Package Builder</h2>



<div class="prompt-viewer-wrapper" id="prompt-section">
    <div class="prompt-comparison-row prompt-premium">
        <!-- Header with buttons -->
        <div class="prompt-row-header">
            <!-- <span class="prompt-row-icon">✨</span> -->
            <span class="prompt-row-title">
                                    Step 1: Customize the prompt with your input
                            </span>
            <div class="prompt-header-buttons">
                                    <button class="prompt-header-btn prompt-header-reset" onclick="resetPrompt()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                                <button class="prompt-header-btn prompt-header-copy-green flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span>Customize and Copy Full Prompt</span>
                </button>
            </div>
        </div>

        <!-- Customize the Prompt Section -->
                    <div class="prompt-customize-section">
                <span class="customize-title">Customize the Prompt</span>
                <p class="customize-subtitle">Fill in the fields below to personalize this prompt for your needs.</p>
                <table class="customize-table">
                    <thead>
                        <tr>
                            <th>Variable</th>
                            <th>What to Enter</th>
                            <th>Customise the prompt</th>
                        </tr>
                    </thead>
                    <tbody>
                                                    <tr>
                                <td class="var-name"><code>[APP_TYPE]</code></td>
                                <td class="var-desc">
                                    Specify the type of application being developed, including its purpose and target audience.                                    <div class="var-example">For example: "Enterprise-grade SaaS platform for project management used by mid-to-large organizations."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[APP_TYPE]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[ERROR_LOGGING_SERVICE]</code></td>
                                <td class="var-desc">
                                    Provide the name of the error monitoring or logging service to be integrated with the toolkit.                                    <div class="var-example">For example: "Sentry, a cloud-based error tracking and performance monitoring tool."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[ERROR_LOGGING_SERVICE]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[UI_FRAMEWORK]</code></td>
                                <td class="var-desc">
                                    Specify the UI framework being used for the project, such as React, Angular, or Vue.js.                                    <div class="var-example">For example: "React with Material-UI for component styling and accessibility."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[UI_FRAMEWORK]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[TYPESCRIPT_REQUIRED]</code></td>
                                <td class="var-desc">
                                    Indicate whether TypeScript is required for the implementation, including any specific version or configuration details.                                    <div class="var-example">For example: "Yes, TypeScript is mandatory and must follow strict type-checking with version 4.8 or higher."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[TYPESCRIPT_REQUIRED]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[RESET_STRATEGY]</code></td>
                                <td class="var-desc">
                                    Define the strategy for resetting the UI after an error, including whether it involves component remounting or state clearing.                                    <div class="var-example">For example: "Soft reset strategy that remounts affected components without clearing the global application state."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[RESET_STRATEGY]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                            </tbody>
                </table>

                <button class="copy-customized-btn flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span class="copy-customized-text">Customise the prompt now</span>
                </button>
            </div>
        
        <!-- Full Prompt Code Header -->
                    <div class="prompt-code-header">
                <span class="prompt-code-title">
                    Step 2: Copy the Prompt
                </span>
                <div class="prompt-code-buttons">
                    <!-- Reset: Only visible when unlocked -->
                    <button class="prompt-header-btn prompt-header-reset btn-when-unlocked" onclick="resetPrompt()" style="display: none;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                    <!-- Copy Full Prompt -->
                    <button class="prompt-header-btn prompt-header-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                            <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                        </svg>
                        <span>Copy Full Prompt</span>
                    </button>
                </div>
            </div>
        

        <!-- Prompt Content -->
        <div class="prompt-box prompt-gated-wrapper">
            <!-- Gated: Blurred content -->
            <div class="prompt-gated-content">
                <div class="prompt-header-visible">OBJECTIVE</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PERSONA</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">CONSTRAINTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PROCESS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Edge Case Handling Rules</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">INPUTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">OUTPUT SPECIFICATION</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">1) Error Boundary Core</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">2) Fallback UI Library</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">3) Logging &amp; Monitoring Integration</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">4) Usage Patterns</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">5) Advanced Capabilities</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">6) Testing Plan</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">7) Integration Playbook</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">QUALITY CHECKS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div>            </div>
            <!-- Unlocked: Full content (hidden by default) -->
            <div class="prompt-content-full" id="premium-prompt-content" style="display: none;">
                ## OBJECTIVE
Design an enterprise-ready React error-resilience toolkit that prevents single-component failures from taking down the entire UI. The centerpiece is a reusable ErrorBoundary system that:
- Captures render/runtime lifecycle errors from descendant components
- Shows accessible, user-friendly fallback experiences (with optional “try again”/reset)
- Reports errors to the chosen monitoring pipeline
- Supports flexible placement (route-level, feature-level, widget-level)
- Includes examples, configuration options, advanced recovery features, and tests

## PERSONA
Act as a battle-tested React/TypeScript architect who has built fault-tolerant frontends under heavy traffic and tight incident-response constraints. You favor pragmatic patterns, strong developer ergonomics, and graceful degradation over brittle “happy path” code.

## CONSTRAINTS
- Provide complete, production-usable React code; use TypeScript when requested.
- Prefer modern React (function components, hooks, context) and clean composition patterns.
- Treat error boundaries as “circuit breakers” that can be deployed at multiple layers.
- Fallback UI must be meaningful, accessible (keyboard, ARIA, contrast-minded), and customizable.
- Include clear integration points for logging/monitoring and a safe default if none is provided.
- Include guidance for edge cases (async errors, event handler errors, data fetching, SSR, StrictMode).
- Include testing approaches (unit + integration) with realistic examples.
- Add code comments/docstrings where they improve maintainability.
- What This Is NOT:
  - Not a generic “try/catch everything” solution for all JavaScript errors
  - Not a replacement for request-level retries, backend observability, or data-layer resilience
  - Not a promise that all errors (e.g., event handlers, async callbacks) are auto-captured without explicit handling

## PROCESS
1. **Pre-analysis (required):** Briefly restate your understanding of [APP_TYPE], [ERROR_LOGGING_SERVICE], [UI_FRAMEWORK], [TYPESCRIPT_REQUIRED], and [RESET_STRATEGY]. If any are missing, list assumptions and offer safe defaults.
2. **Architecture outline:** Propose where boundaries should live (app shell, routes, features, leaf widgets) and why.
3. **Core implementation:** Provide the reusable ErrorBoundary module(s) with configuration and reset/retry capabilities.
4. **Fallback system:** Provide a small set of composable fallback components plus a “render prop” option for contextual UI.
5. **Monitoring integration:** Implement adapters for [ERROR_LOGGING_SERVICE] (or a pluggable interface with one concrete example).
6. **Usage patterns:** Show multiple placements (route, layout, feature section, individual card/widget).
7. **Advanced recovery:** Add optional retry/backoff, “soft reset” remounting, and context-aware messaging.
8. **Tests:** Provide unit/integration tests and note any caveats (jsdom, console suppression, React version).
9. **Implementation guide:** Step-by-step rollout plan and best practices for production.

### Edge Case Handling Rules
- If [ERROR_LOGGING_SERVICE] is “custom” or unspecified, generate a minimal logger interface plus a safe no-op default and a console-based dev implementation.
- If [UI_FRAMEWORK] is unspecified, use accessible semantic HTML with minimal styling and clear extension points.
- If [TYPESCRIPT_REQUIRED] is “no”, provide JavaScript versions *or* TS with notes on stripping types (state your choice in pre-analysis).
- If [RESET_STRATEGY] is unclear, implement a default “remount via key” reset and also show how to plug in a custom reset callback.

## INPUTS
- **Application type:** [APP_TYPE]
- **Error logging service:** [ERROR_LOGGING_SERVICE]
- **UI framework/library:** [UI_FRAMEWORK]
- **TypeScript required (yes/no):** [TYPESCRIPT_REQUIRED]
- **Preferred reset approach:** [RESET_STRATEGY]

## OUTPUT SPECIFICATION
Return the solution in the following sections (use these exact headers):

### 1) Error Boundary Core
Provide:
- {Error Boundary File Name}
- {Complete Component Code}
- {Public Props API}
- {Reset/Retry Behavior}
- {Notes on React Limitations}

### 2) Fallback UI Library
Provide:
- {Generic Fallback Component}
- {Inline/Widget Fallback Component}
- {Full-Page Fallback Component}
- {Accessibility Notes}
- {Customization Hooks}

### 3) Logging &amp; Monitoring Integration
Provide:
- {Logger Interface}
- {Concrete Integration Example}
- {Breadcrumb/Metadata Strategy}
- {PII/Sensitive Data Guardrails}
- {Where to Call the Reporter}

### 4) Usage Patterns
Provide at least:
- {App Shell Example}
- {Route-Level Example}
- {Feature Section Example}
- {Leaf Component Example}
- {Contextual Fallback Example}

### 5) Advanced Capabilities
Include:
- {Retry Mechanism}
- {Exponential Backoff or Throttling}
- {User-Triggered Reset}
- {Programmatic Reset}
- {Circuit-Breaker Placement Guidance}

### 6) Testing Plan
Include:
- {Unit Test Examples}
- {Integration Test Examples}
- {Mocking/Stubbing Strategy}
- {What to Assert}
- {Common Pitfalls}

### 7) Integration Playbook
Include:
- {Adoption Steps}
- {Best Practices}
- {Anti-Patterns to Avoid}
- {Rollout/Observability Checklist}

## QUALITY CHECKS
At the end, include a validation list that confirms:
- The ErrorBoundary is reusable/configurable and supports the chosen [RESET_STRATEGY].
- Fallback UI is accessible and can be adapted to [UI_FRAMEWORK] without rewrites.
- Logging is pluggable and correctly wired for [ERROR_LOGGING_SERVICE] (or a safe default exists).
- Examples cover multiple boundary placements (route + feature + widget at minimum).
- Tests demonstrate failures, resets, and reporting behavior with realistic assertions.            </div>
        </div>


    </div>

    <!-- CTA Row - Full width buttons -->
    <div class="prompt-cta-row">
        <button class="prompt-cta-btn prompt-cta-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
            </svg>
            <span class="cta-copy-text">Copy Full Prompt</span>
        </button>
    </div>
</div>

<style>
    /* Gated prompt states */
    .prompt-gated-wrapper {
        position: relative;
    }

    /* When unlocked - show full content, hide gated */
    body.flowpast-unlocked .prompt-gated-wrapper .prompt-gated-content {
        display: none;
    }

    body.flowpast-unlocked .prompt-gated-wrapper .prompt-content-full {
        display: block !important;
    }

    /* Show/hide elements based on unlock state */
    body.flowpast-unlocked .btn-when-unlocked {
        display: inline-flex !important;
    }

    .prompt-viewer-wrapper {
        scroll-margin-top: 250px;
    }

    /* ========================================
   PROMPT VIEWER - MAIN WRAPPER
   ======================================== */
    .prompt-viewer-wrapper {
        margin: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ========================================
   PROMPT BOX CONTAINER
   ======================================== */
    .prompt-comparison-row {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    /* ========================================
   HEADER WITH BUTTONS
   ======================================== */
    .prompt-row-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .prompt-row-icon {
        font-size: 20px;
    }

    .prompt-row-title {
        font-weight: 600;
        font-size: 22px;
        color: #fff !important;
        text-decoration: underline
    }

    .prompt-header-buttons {
        margin-left: auto;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Header buttons */
    .prompt-header-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-header-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-header-copy:hover {
        background: #2a2a2a;
    }

    .prompt-header-copy.copied {
        background: #2e7d32;
    }

    .prompt-header-copy-green {
        background: #04AA6D !important;
        color: #fff !important;
    }

    .prompt-header-copy-green:hover {
        background: #039860 !important;
    }

    .prompt-header-copy-green.copied {
        background: #2e7d32 !important;
    }

    .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-header-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-1px);
    }

    /* ========================================
   PROMPT CONTENT - FULL (NO SCROLL)
   ======================================== */
    .prompt-box {
        background: #ffffff;
    }

    .prompt-content-full {
        padding: 24px;
        margin: 0;
        color: #202124;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.7;
        white-space: pre-wrap;
        word-wrap: break-word;
        /* No scroll - show full content */
        max-height: none;
        overflow: visible;
    }

    /* Highlighted variable in prompt */
    .prompt-variable {
        background: #fff3cd;
        color: #1967d2;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ffc107;
    }

    .prompt-variable-filled {
        background: #d4edda;
        color: #155724;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #28a745;
    }

    /* ========================================
   GATED CONTENT (NO ACCESS)
   ======================================== */
    .prompt-gated-content {
        padding: 24px;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.8;
        max-height: none;
        overflow: visible;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        cursor: default;
    }

    /* ## headers - larger, black */
    .prompt-header-visible {
        color: #202124;
        font-weight: 600;
        margin: 5px 0 0px 0;
        font-size: 20px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* ### headers - smaller, black */
    .prompt-header-visible.subheader {
        color: #202124;
        font-weight: 600;
        margin: 5px 0;
        font-size: 18px;
    }

    .prompt-header-visible:first-child {
        margin-top: 0;
    }

    /* ========================================
   LOCKED SECTION BLOCK
   ======================================== */
    .locked-section {
        position: relative;
        margin: 4px 0 8px 0;
        border-radius: 6px;
        overflow: hidden;
        background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .locked-section-bg {
        position: relative;
    }

    .locked-section-lines {
        padding: 8px 12px;
        position: relative;
    }

    .locked-line {
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 3px;
        margin-bottom: 4px;
        margin-left: 12px;
    }

    .locked-line:last-child {
        margin-bottom: 0;
    }

    .locked-section-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        font-size: 24px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }

    /* Subheader locked sections - slightly indented */
    /*  .prompt-header-visible.subheader+.locked-section {
        margin-left: 16px;
    } */

    /* ========================================
   COMPATIBILITY BADGES
   ======================================== */
    .prompt-compatibility {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
    }

    .compat-label {
        font-size: 13px;
        color: #5f6368;
        font-weight: 500;
    }

    .compat-badge {
        padding: 4px 10px;
        background: #e8f0fe;
        color: #1967d2;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }

    /* ========================================
   CTA ROW - FULL WIDTH BUTTONS
   ======================================== */
    .prompt-cta-row {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .prompt-cta-btn {
        flex: 1;
        min-width: 200px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 24px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-cta-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-copy:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-copy.copied {
        background: #2e7d32;
    }

    .prompt-cta-reset {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-reset:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-cta-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    /* ========================================
    CUSTOMIZE YOUR PROMPT SECTION
    ======================================== */
    .prompt-customize-section {
        padding: 24px;
        border-bottom: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .customize-title {
        margin: 0 0 8px 0;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
    }

    .customize-subtitle {
        margin: 0 0 20px 0;
        font-size: 14px;
        color: #5f6368;
    }

    .customize-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .customize-table th {
        text-align: left;
        padding: 12px;
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        font-size: 13px;
        font-weight: 600;
        color: #202124;
    }

    .customize-table td {
        padding: 12px;
        border: 1px solid #e0e0e0;
        vertical-align: top;
    }

    .customize-table .var-name {
        width: 25%;
        background: #f8f9fa;
    }

    .customize-table .var-name code {
        background: #fff3cd;
        color: #1967d2;
        border: 1px solid #ffc107;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        word-break: break-all;
        font-weight: 600;
    }

    .customize-table .var-desc {
        width: 35%;
        font-size: 13px;
        color: #5f6368;
        line-height: 1.5;
    }

    .customize-table .var-example {
        margin-top: 8px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #dadce0;
        font-size: 12px;
        color: #5f6368;
        font-style: italic;
        border-radius: 0 4px 4px 0;
    }

    .customize-table .var-input {
        width: 40%;
    }

    .customize-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #dadce0;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .customize-input:focus {
        outline: none;
        border-color: rgb(5, 152, 98);
        box-shadow: 0 0 0 3px rgba(5, 152, 98, 0.1);
    }

    .customize-input::placeholder {
        color: #9aa0a6;
        font-style: italic;
    }

    .copy-customized-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: rgb(5, 152, 98);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .copy-customized-btn:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    .copy-customized-btn.copied {
        background: #2e7d32;
    }

    /* ========================================
    FULL PROMPT CODE HEADER
    ======================================== */
    .prompt-code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
    }

    .prompt-code-title {
        font-size: 22px;
        font-weight: 600;
        text-decoration: underline;

    }

    .prompt-code-buttons {
        display: flex;
        gap: 8px;
    }

    .prompt-code-buttons .prompt-header-btn {
        padding: 8px 14px;
        font-size: 13px;
        background: #ffffff;
        color: #202124;
        border: 1px solid #dadce0;
    }

    .prompt-code-buttons .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
        border-color: rgb(5, 152, 98);
    }

    .prompt-code-buttons .prompt-header-btn.prompt-header-access:hover {
        background: rgb(4, 130, 83) !important;
        border-color: rgb(4, 130, 83);
        color: #fff !important;
    }

    .prompt-code-buttons .prompt-header-btn:hover {
        background: #f1f3f4;
    }

    .prompt-code-buttons .prompt-header-copy.copied {
        background: #d4edda;
        color: #155724;
        border-color: #28a745;
    }

    .prompt-header-reset {
        background: #ffffff;
        color: #202124;
    }

    /* ========================================
   RESPONSIVE
   ======================================== */
    @media (max-width: 768px) {
        .prompt-row-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .prompt-header-buttons {
            margin-left: 0;
            width: 100%;
        }

        .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }

        .prompt-cta-row {
            flex-direction: column;
        }

        .prompt-cta-btn {
            width: 100%;
        }

        /* Customize table responsive */
        .customize-table,
        .customize-table thead,
        .customize-table tbody,
        .customize-table tr,
        .customize-table th,
        .customize-table td {
            display: block;
        }

        .customize-table thead {
            display: none;
        }

        .customize-table tr {
            margin-bottom: 16px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
        }

        .customize-table td {
            width: 100% !important;
            border: none;
            border-bottom: 1px solid #e0e0e0;
        }

        .customize-table td:last-child {
            border-bottom: none;
        }

        .customize-table .var-name {
            background: #f1f3f4;
            font-weight: 600;
        }

        .prompt-code-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }

        .prompt-code-buttons {
            width: 100%;
        }

        .prompt-code-buttons .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }
    }
</style>

<script>
    function handlePromptCopy() {
        // Check if unlocked via cookie
        if (typeof window.flowpastIsUnlocked === 'function' && !window.flowpastIsUnlocked()) {
            // Show email popup
            if (typeof window.flowpastShowEmailPopup === 'function') {
                window.flowpastShowEmailPopup('prompt');
            }
            return;
        }

        // Copy the customized prompt (with filled variables)
        const customizedPrompt = getCustomizedPrompt();
        const copyButtons = document.querySelectorAll('.prompt-header-copy, .prompt-header-copy-green, .prompt-cta-copy, .copy-customized-btn');

        navigator.clipboard.writeText(customizedPrompt).then(() => {
            copyButtons.forEach(btn => {
                btn.classList.add('copied');
                const textSpan = btn.querySelector('span');
                if (textSpan) textSpan.textContent = 'Copied!';
            });

            setTimeout(() => {
                copyButtons.forEach(btn => {
                    btn.classList.remove('copied');
                    const textSpan = btn.querySelector('span');
                    if (textSpan) textSpan.textContent = 'Copy Full Prompt';
                });
            }, 2000);
        }).catch(err => {
            console.error('Failed to copy:', err);
        });
    }

    // Store original prompt for customization
    const originalPrompt = "## OBJECTIVE\r\nDesign an enterprise-ready React error-resilience toolkit that prevents single-component failures from taking down the entire UI. The centerpiece is a reusable ErrorBoundary system that:\r\n- Captures render\/runtime lifecycle errors from descendant components\r\n- Shows accessible, user-friendly fallback experiences (with optional \u201ctry again\u201d\/reset)\r\n- Reports errors to the chosen monitoring pipeline\r\n- Supports flexible placement (route-level, feature-level, widget-level)\r\n- Includes examples, configuration options, advanced recovery features, and tests\r\n\r\n## PERSONA\r\nAct as a battle-tested React\/TypeScript architect who has built fault-tolerant frontends under heavy traffic and tight incident-response constraints. You favor pragmatic patterns, strong developer ergonomics, and graceful degradation over brittle \u201chappy path\u201d code.\r\n\r\n## CONSTRAINTS\r\n- Provide complete, production-usable React code; use TypeScript when requested.\r\n- Prefer modern React (function components, hooks, context) and clean composition patterns.\r\n- Treat error boundaries as \u201ccircuit breakers\u201d that can be deployed at multiple layers.\r\n- Fallback UI must be meaningful, accessible (keyboard, ARIA, contrast-minded), and customizable.\r\n- Include clear integration points for logging\/monitoring and a safe default if none is provided.\r\n- Include guidance for edge cases (async errors, event handler errors, data fetching, SSR, StrictMode).\r\n- Include testing approaches (unit + integration) with realistic examples.\r\n- Add code comments\/docstrings where they improve maintainability.\r\n- What This Is NOT:\r\n  - Not a generic \u201ctry\/catch everything\u201d solution for all JavaScript errors\r\n  - Not a replacement for request-level retries, backend observability, or data-layer resilience\r\n  - Not a promise that all errors (e.g., event handlers, async callbacks) are auto-captured without explicit handling\r\n\r\n## PROCESS\r\n1. **Pre-analysis (required):** Briefly restate your understanding of [APP_TYPE], [ERROR_LOGGING_SERVICE], [UI_FRAMEWORK], [TYPESCRIPT_REQUIRED], and [RESET_STRATEGY]. If any are missing, list assumptions and offer safe defaults.\r\n2. **Architecture outline:** Propose where boundaries should live (app shell, routes, features, leaf widgets) and why.\r\n3. **Core implementation:** Provide the reusable ErrorBoundary module(s) with configuration and reset\/retry capabilities.\r\n4. **Fallback system:** Provide a small set of composable fallback components plus a \u201crender prop\u201d option for contextual UI.\r\n5. **Monitoring integration:** Implement adapters for [ERROR_LOGGING_SERVICE] (or a pluggable interface with one concrete example).\r\n6. **Usage patterns:** Show multiple placements (route, layout, feature section, individual card\/widget).\r\n7. **Advanced recovery:** Add optional retry\/backoff, \u201csoft reset\u201d remounting, and context-aware messaging.\r\n8. **Tests:** Provide unit\/integration tests and note any caveats (jsdom, console suppression, React version).\r\n9. **Implementation guide:** Step-by-step rollout plan and best practices for production.\r\n\r\n### Edge Case Handling Rules\r\n- If [ERROR_LOGGING_SERVICE] is \u201ccustom\u201d or unspecified, generate a minimal logger interface plus a safe no-op default and a console-based dev implementation.\r\n- If [UI_FRAMEWORK] is unspecified, use accessible semantic HTML with minimal styling and clear extension points.\r\n- If [TYPESCRIPT_REQUIRED] is \u201cno\u201d, provide JavaScript versions *or* TS with notes on stripping types (state your choice in pre-analysis).\r\n- If [RESET_STRATEGY] is unclear, implement a default \u201cremount via key\u201d reset and also show how to plug in a custom reset callback.\r\n\r\n## INPUTS\r\n- **Application type:** [APP_TYPE]\r\n- **Error logging service:** [ERROR_LOGGING_SERVICE]\r\n- **UI framework\/library:** [UI_FRAMEWORK]\r\n- **TypeScript required (yes\/no):** [TYPESCRIPT_REQUIRED]\r\n- **Preferred reset approach:** [RESET_STRATEGY]\r\n\r\n## OUTPUT SPECIFICATION\r\nReturn the solution in the following sections (use these exact headers):\r\n\r\n### 1) Error Boundary Core\r\nProvide:\r\n- {Error Boundary File Name}\r\n- {Complete Component Code}\r\n- {Public Props API}\r\n- {Reset\/Retry Behavior}\r\n- {Notes on React Limitations}\r\n\r\n### 2) Fallback UI Library\r\nProvide:\r\n- {Generic Fallback Component}\r\n- {Inline\/Widget Fallback Component}\r\n- {Full-Page Fallback Component}\r\n- {Accessibility Notes}\r\n- {Customization Hooks}\r\n\r\n### 3) Logging & Monitoring Integration\r\nProvide:\r\n- {Logger Interface}\r\n- {Concrete Integration Example}\r\n- {Breadcrumb\/Metadata Strategy}\r\n- {PII\/Sensitive Data Guardrails}\r\n- {Where to Call the Reporter}\r\n\r\n### 4) Usage Patterns\r\nProvide at least:\r\n- {App Shell Example}\r\n- {Route-Level Example}\r\n- {Feature Section Example}\r\n- {Leaf Component Example}\r\n- {Contextual Fallback Example}\r\n\r\n### 5) Advanced Capabilities\r\nInclude:\r\n- {Retry Mechanism}\r\n- {Exponential Backoff or Throttling}\r\n- {User-Triggered Reset}\r\n- {Programmatic Reset}\r\n- {Circuit-Breaker Placement Guidance}\r\n\r\n### 6) Testing Plan\r\nInclude:\r\n- {Unit Test Examples}\r\n- {Integration Test Examples}\r\n- {Mocking\/Stubbing Strategy}\r\n- {What to Assert}\r\n- {Common Pitfalls}\r\n\r\n### 7) Integration Playbook\r\nInclude:\r\n- {Adoption Steps}\r\n- {Best Practices}\r\n- {Anti-Patterns to Avoid}\r\n- {Rollout\/Observability Checklist}\r\n\r\n## QUALITY CHECKS\r\nAt the end, include a validation list that confirms:\r\n- The ErrorBoundary is reusable\/configurable and supports the chosen [RESET_STRATEGY].\r\n- Fallback UI is accessible and can be adapted to [UI_FRAMEWORK] without rewrites.\r\n- Logging is pluggable and correctly wired for [ERROR_LOGGING_SERVICE] (or a safe default exists).\r\n- Examples cover multiple boundary placements (route + feature + widget at minimum).\r\n- Tests demonstrate failures, resets, and reporting behavior with realistic assertions.";
    const variables = ["[APP_TYPE]","[ERROR_LOGGING_SERVICE]","[UI_FRAMEWORK]","[TYPESCRIPT_REQUIRED]","[RESET_STRATEGY]"];
    // Initial render with highlighted variables
    document.addEventListener('DOMContentLoaded', function() {
        renderPromptWithHighlights();
    });

    // Live update prompt as user types
    document.querySelectorAll('.customize-input').forEach(input => {
        input.addEventListener('input', renderPromptWithHighlights);
    });

    function renderPromptWithHighlights() {
        const promptContent = document.getElementById('premium-prompt-content');
        if (!promptContent) return;

        let updatedPrompt = originalPrompt;
        let filledVariables = {};

        // Collect filled values
        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                filledVariables[placeholder] = value;
            }
        });

        // Replace filled variables and highlight remaining
        let htmlContent = escapeHtml(updatedPrompt);

        variables.forEach(placeholder => {
            const escapedPlaceholder = escapeHtml(placeholder);
            const regex = new RegExp(escapeRegex(escapedPlaceholder), 'g');

            if (filledVariables[placeholder]) {
                // Show filled value with green highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable-filled">' + escapeHtml(filledVariables[placeholder]) + '</span>'
                );
            } else {
                // Show original placeholder with yellow highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable">' + escapedPlaceholder + '</span>'
                );
            }
        });

        promptContent.innerHTML = htmlContent;
    }

    function escapeRegex(string) {
        return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    }

    function escapeHtml(text) {
        const div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function resetPrompt() {
        // Clear all input fields
        document.querySelectorAll('.customize-input').forEach(input => {
            input.value = '';
        });

        // Re-render with original placeholders highlighted
        renderPromptWithHighlights();

        // Visual feedback
        const resetBtns = document.querySelectorAll('.prompt-header-reset, .prompt-cta-reset');
        resetBtns.forEach(btn => {
            const originalText = btn.querySelector('span').textContent;
            btn.querySelector('span').textContent = 'Reset!';
            setTimeout(() => {
                btn.querySelector('span').textContent = originalText;
            }, 1000);
        });
    }


    function getCustomizedPrompt() {
        let updatedPrompt = originalPrompt;

        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                const regex = new RegExp(escapeRegex(placeholder), 'g');
                updatedPrompt = updatedPrompt.replace(regex, value);
            }
        });

        return updatedPrompt;
    }
</script>

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>Decide your boundary “tiers” before you run it.</strong> Pick 2-3 layers you will actually enforce (for example: route-level for pages, widget-level for risky third-party components). Then ask: “Show a recommended boundary layout for a dashboard with 1 route shell, 3 feature areas, and 6 widgets, highlighting which ones should fail closed vs fail open.”</li>


<li><strong>Be explicit about your telemetry pipeline.</strong> If you use Sentry or Datadog, name it and specify what metadata you need (userId, accountId, route, build SHA). Follow-up prompt: “Add a reporter adapter that attaches tags: appVersion, releaseChannel, routeId, and includes componentStack in the payload.”</li>


<li><strong>Force accessibility requirements in the fallback UI.</strong> Don’t accept a generic “Something went wrong” panel. Ask for keyboard focus management and ARIA labeling: “Make the fallback place focus on the heading, include aria-live guidance, and ensure buttons are reachable and labeled for screen readers.”</li>


<li><strong>Iterate on recovery behavior, not just rendering.</strong> After the first output, try asking: “Now make option 2 more aggressive and option 4 more conservative: option 2 auto-retries once after 2 seconds; option 4 only retries on user click and clears local state.”</li>


<li><strong>Request coverage for the edge cases you actually hit.</strong> Error boundaries won’t magically catch every error type, so tell the prompt what’s been slipping through (async data fetching, event handlers, SSR quirks, StrictMode double-invocation). Example follow-up: “Add a section showing how to handle async errors via explicit try/catch + reporter calls, and how to avoid noisy duplicates in React StrictMode.”</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>Once your UI stops crashing, the next step is turning that stability into measurable growth and cleaner launches.</p>



<p>If you also need to keep users engaged after reliability fixes ship, <a href="https://flowpast.com/prompts/build-a-6-email-lead-nurture-sequence-with-this-ai-prompt/">Build a 6-Email Lead Nurture Sequence with this AI Prompt</a> helps you communicate updates, rebuild trust, and move leads toward a trial or demo without sounding like you’re making excuses.</p>



<p>When you’re planning a relaunch or a big “we fixed it” announcement, <a href="https://flowpast.com/prompts/build-a-5-email-launch-sequence-with-this-ai-prompt/">Build a 5-Email Launch Sequence with this AI Prompt</a> pairs well because you can coordinate release messaging with the same discipline you bring to incident response and postmortems.</p>



<p>For teams doing longer-form education (especially if you’re explaining reliability improvements, new status pages, or best practices to customers), <a href="https://flowpast.com/prompts/build-a-5-day-email-mini-course-blueprint-ai-prompt/">Build a 5-Day Email Mini-Course Blueprint AI Prompt</a> gives you a structured way to teach, reduce support load, and prevent churn from confusion.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/build-a-6-email-lead-nurture-sequence-with-this-ai-prompt/">Build a 6-Email Lead Nurture Sequence with this AI Prompt</a>: Nurture leads with structured follow-ups.</li>


<li><a href="https://flowpast.com/prompts/build-a-5-email-launch-sequence-with-this-ai-prompt/">Build a 5-Email Launch Sequence with this AI Prompt</a>: Plan a clear, conversion-focused launch.</li>


<li><a href="https://flowpast.com/prompts/build-a-5-day-email-mini-course-blueprint-ai-prompt/">Build a 5-Day Email Mini-Course Blueprint AI Prompt</a>: Teach users with a 5-day sequence.</li>

<li><a href="https://flowpast.com/prompts/generate-5-list-growth-ideas-for-buyers-ai-prompt/">Generate 5 List Growth Ideas for Buyers AI Prompt</a>: Find new ways to grow your list.</li>

<li><a href="https://flowpast.com/prompts/build-a-multichannel-seo-growth-blueprint-with-this-ai-prompt/">Build a Multichannel SEO Growth Blueprint with this AI Prompt</a>: Build an SEO plan across channels.</li>
<!-- /wp:post-content -->
</ul>
<!-- /wp:list -->
</div>

<div class="faq-section">
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading">Common Questions</h2>
<!-- /wp:heading -->

<div class="faq-item">
<span class="question">Which roles benefit most from this React error boundary AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>Frontend Tech Leads</strong> use this to standardize how failures are contained across routes, features, and widgets so on-call incidents don’t become full-site outages. <strong>Staff/Principal Engineers</strong> rely on it to design a package-level pattern (reporting adapters, clean APIs, tests) that multiple teams can adopt without bikeshedding. <strong>QA Automation Engineers</strong> benefit because the prompt includes realistic unit and integration test approaches for fallback rendering and reset behavior. <strong>Product Engineers</strong> use it to ship user-friendly recovery UX, not just developer-centric error messages.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this React error boundary AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>SaaS platforms</strong> get big wins because complex dashboards often include many independent widgets, and isolating one failure prevents churn-inducing “blank screens.” <strong>E-commerce</strong> teams use it to protect revenue paths by placing boundaries around risky UI pieces like recommendations, reviews, and third-party payment elements while keeping the cart usable. <strong>Fintech and insurance</strong> products value the telemetry and incident-friendly reporting because compliance-heavy teams need clearer audit trails of what broke and when. <strong>Media and content sites</strong> use boundaries to keep article shells stable even if interactive embeds or personalization modules fail.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for building a React error boundary package produce weak results?</span>
<!-- wp:paragraph -->
<p class="answer">A typical prompt like &#8220;<em>Write me a React error boundary</em>&#8221; fails because it: lacks a multi-layer placement strategy (route vs feature vs widget) so teams deploy it inconsistently, provides no accessible fallback requirements so you get generic panels that frustrate users, ignores monitoring integration details so errors never reach the pipeline with useful context, produces a toy component instead of a reusable package with adapters and examples, and misses edge-case guidance for async errors, event handlers, SSR, and StrictMode.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Can I customize this React error boundary prompt for my specific situation?</span>
<!-- wp:paragraph -->
<p class="answer">Yes, customize it by specifying your app type (for example: “Next.js SSR app” vs “Vite SPA”), your error logging service (Sentry, Datadog, custom endpoint), and your preferred UI library (MUI, Chakra, Tailwind, or no dependency). You can also tell it which recovery patterns you allow, such as “reset on route change,” “retry once,” or “never auto-retry.” A practical follow-up is: “Adapt the package for a Next.js App Router app, include an ErrorBoundary per route segment, and send reports to Sentry with userId, accountId, and release SHA.”</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this React error boundary prompt?</span>
<!-- wp:paragraph -->
<p class="answer">The biggest mistake is leaving your monitoring requirements vague; instead of “log it somewhere,” say “send to Sentry with tags {routeId, featureFlag, releaseSha} and include componentStack.” Another common error is asking for a fallback UI without behavior, like “show an error message,” rather than “show a fallback with a Try again button that calls reset and preserves navigation.” Teams also forget to specify placement; “add it globally” is often worse than “wrap the dashboard route and the chart widget only.” Finally, people assume it will catch async and event-handler failures automatically, so you should explicitly request patterns for try/catch + reporter calls in those areas.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Who should NOT use this React error boundary prompt?</span>
<!-- wp:paragraph -->
<p class="answer">This prompt isn’t ideal for tiny one-page prototypes where a full package (adapters, tests, edge-case guidance) is more overhead than value. It also won’t help if you need backend retries or data-layer resilience, because error boundaries only address certain UI failure modes. And if your team refuses to wire in monitoring or write tests, frankly you won’t get the main payoff. In those cases, start with a minimal boundary wrapper and add observability once you can support it.</p>
<!-- /wp:paragraph -->
</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this React error boundary AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Frontend Tech Leads use this to standardize how failures are contained across routes, features, and widgets so on-call incidents don’t become full-site outages. Staff/Principal Engineers rely on it to design a package-level pattern (reporting adapters, clean APIs, tests) that multiple teams can adopt without bikeshedding. QA Automation Engineers benefit because the prompt includes realistic unit and integration test approaches for fallback rendering and reset behavior. Product Engineers use it to ship user-friendly recovery UX, not just developer-centric error messages."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this React error boundary AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SaaS platforms get big wins because complex dashboards often include many independent widgets, and isolating one failure prevents churn-inducing “blank screens.” E-commerce teams use it to protect revenue paths by placing boundaries around risky UI pieces like recommendations, reviews, and third-party payment elements while keeping the cart usable. Fintech and insurance products value the telemetry and incident-friendly reporting because compliance-heavy teams need clearer audit trails of what broke and when. Media and content sites use boundaries to keep article shells stable even if interactive embeds or personalization modules fail."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for building a React error boundary package produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like \"Write me a React error boundary\" fails because it: lacks a multi-layer placement strategy (route vs feature vs widget) so teams deploy it inconsistently, provides no accessible fallback requirements so you get generic panels that frustrate users, ignores monitoring integration details so errors never reach the pipeline with useful context, produces a toy component instead of a reusable package with adapters and examples, and misses edge-case guidance for async errors, event handlers, SSR, and StrictMode."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this React error boundary prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes, customize it by specifying your app type (for example: “Next.js SSR app” vs “Vite SPA”), your error logging service (Sentry, Datadog, custom endpoint), and your preferred UI library (MUI, Chakra, Tailwind, or no dependency). You can also tell it which recovery patterns you allow, such as “reset on route change,” “retry once,” or “never auto-retry.” A practical follow-up is: “Adapt the package for a Next.js App Router app, include an ErrorBoundary per route segment, and send reports to Sentry with userId, accountId, and release SHA.”"
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this React error boundary prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving your monitoring requirements vague; instead of “log it somewhere,” say “send to Sentry with tags {routeId, featureFlag, releaseSha} and include componentStack.” Another common error is asking for a fallback UI without behavior, like “show an error message,” rather than “show a fallback with a Try again button that calls reset and preserves navigation.” Teams also forget to specify placement; “add it globally” is often worse than “wrap the dashboard route and the chart widget only.” Finally, people assume it will catch async and event-handler failures automatically, so you should explicitly request patterns for try/catch + reporter calls in those areas."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this React error boundary prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for tiny one-page prototypes where a full package (adapters, tests, edge-case guidance) is more overhead than value. It also won’t help if you need backend retries or data-layer resilience, because error boundaries only address certain UI failure modes. And if your team refuses to wire in monitoring or write tests, frankly you won’t get the main payoff. In those cases, start with a minimal boundary wrapper and add observability once you can support it."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">
<!-- wp:paragraph -->
<p>UI reliability is a growth lever, not just an engineering nice-to-have. Paste this prompt into your AI tool, generate the package, and ship a React app that fails safely instead of failing loudly.</p>
<!-- /wp:paragraph -->
</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5001438.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Build a Compliance Checklist with this AI Prompt</title>
		<link>https://flowpast.com/prompts/build-a-compliance-checklist-with-this-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:47:12 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5000807</guid>

					<description><![CDATA[Compliance tasks feel overwhelming - the ultimate AI Prompt that builds a step-by-step checklist with evidence and timing. Access our full AI prompt library for every model.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: compliance checklist AI prompt -->

<div class="hook-introduction">

<p>Compliance work tends to fail in the same boring way. You have a regulation name, a vague sense of risk, and a pile of “we should probably” tasks that never turn into assignable steps. Then an audit, a customer questionnaire, or a security review shows up, and you are scrambling for evidence you can’t easily find.</p>



<p>This <strong>compliance checklist AI prompt</strong> is built for <strong>Compliance Managers</strong> who need a clean plan they can hand to operations, <strong>Founders and Ops Leads</strong> who must get “good enough” governance in place without a big team, and <strong>Consultants</strong> who want a repeatable way to translate standards into tasks clients will actually complete. The output is a practical checklist with at least 11 sequential actions, each one paired with the documentation to keep and a realistic timeline or frequency.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It restates the regulation or standard in plain language and flags ambiguities before it writes the checklist.</li>
          <li>It converts requirements into sequential, executable tasks using action verbs like draft, approve, implement, review, retain, train, test, and monitor.</li>
          <li>It pairs every checklist item with the specific evidence to produce or retain, so you can answer “show me” questions fast.</li>
          <li>It assigns workable timelines or frequencies to each task (for example: weekly, quarterly, annually, or within 30–60 days).</li>
          <li>It adds a final “commonly missed” section to catch real-world gaps like third-party oversight, training proof, and record retention.</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>You have to comply with a named regulation (or industry framework) and you need a first-pass execution plan today.</li>
          <li>An enterprise prospect sends a security or compliance questionnaire and your answers depend on documentation you can’t locate.</li>
          <li>You’re preparing for an internal audit, an external audit, or a certification effort and need a single source of truth for tasks.</li>
          <li>Leadership asks for “a compliance roadmap” and you need something that is operational, not a slide full of principles.</li>
          <li>You’re scaling into new markets, new customer segments, or regulated partnerships and the expectations just got stricter.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A compliance checklist with 11+ actionable items written as a sequence your team can follow.</li>
           <li>Evidence guidance for every item, including record types (policies, logs, tickets, attestations) to create or retain.</li>
           <li>A timing plan with realistic frequencies and target windows you can convert into calendar reminders or project tasks.</li>
           <li>An “Assumptions &#038; Clarifications Needed” note when key context is missing, so you know what to confirm next.</li>
           <li>A final extra-considerations section with common blind spots that derail audits and customer reviews.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: End-to-End Compliance Checklist Builder</h2>



<div class="prompt-viewer-wrapper" id="prompt-section">
    <div class="prompt-comparison-row prompt-premium">
        <!-- Header with buttons -->
        <div class="prompt-row-header">
            <!-- <span class="prompt-row-icon">✨</span> -->
            <span class="prompt-row-title">
                                    Step 1: Customize the prompt with your input
                            </span>
            <div class="prompt-header-buttons">
                                    <button class="prompt-header-btn prompt-header-reset" onclick="resetPrompt()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                                <button class="prompt-header-btn prompt-header-copy-green flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span>Customize and Copy Full Prompt</span>
                </button>
            </div>
        </div>

        <!-- Customize the Prompt Section -->
                    <div class="prompt-customize-section">
                <span class="customize-title">Customize the Prompt</span>
                <p class="customize-subtitle">Fill in the fields below to personalize this prompt for your needs.</p>
                <table class="customize-table">
                    <thead>
                        <tr>
                            <th>Variable</th>
                            <th>What to Enter</th>
                            <th>Customise the prompt</th>
                        </tr>
                    </thead>
                    <tbody>
                                                    <tr>
                                <td class="var-name"><code>[INDUSTRY]</code></td>
                                <td class="var-desc">
                                    Specify the regulation or industry for which the compliance checklist should be tailored. This could be a specific legal standard, sector, or compliance framework.                                    <div class="var-example">For example: "General Data Protection Regulation (GDPR) or Healthcare industry compliance for HIPAA."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[INDUSTRY]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                            </tbody>
                </table>

                <button class="copy-customized-btn flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span class="copy-customized-text">Customise the prompt now</span>
                </button>
            </div>
        
        <!-- Full Prompt Code Header -->
                    <div class="prompt-code-header">
                <span class="prompt-code-title">
                    Step 2: Copy the Prompt
                </span>
                <div class="prompt-code-buttons">
                    <!-- Reset: Only visible when unlocked -->
                    <button class="prompt-header-btn prompt-header-reset btn-when-unlocked" onclick="resetPrompt()" style="display: none;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                    <!-- Copy Full Prompt -->
                    <button class="prompt-header-btn prompt-header-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                            <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                        </svg>
                        <span>Copy Full Prompt</span>
                    </button>
                </div>
            </div>
        

        <!-- Prompt Content -->
        <div class="prompt-box prompt-gated-wrapper">
            <!-- Gated: Blurred content -->
            <div class="prompt-gated-content">
                <div class="prompt-header-visible">OBJECTIVE</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PERSONA</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">CONSTRAINTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">What This Is NOT</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PROCESS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">INPUTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">OUTPUT SPECIFICATION</div><div class="prompt-header-visible subheader">Title</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Optional setup block (include only if needed)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Main checklist (numbered, minimum 11 items)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Additional considerations (bulleted)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">QUALITY CHECKS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div>            </div>
            <!-- Unlocked: Full content (hidden by default) -->
            <div class="prompt-content-full" id="premium-prompt-content" style="display: none;">
                ## OBJECTIVE
Create a practical, end-to-end compliance checklist tailored to a named regulation or industry, including concrete actions, the records to keep, and workable time targets so a user can organize and complete compliance work without guessing.

## PERSONA
Act as a senior regulatory compliance advisor with cross-industry experience translating legal/standards language into operational tasks. Write in plain, business-friendly language that a mixed-experience team can follow.

## CONSTRAINTS
- Use clear wording and minimize specialized terminology; if a technical term is unavoidable, briefly define it in-line.
- Provide **at least 11** actionable checklist items (not fewer).
- Each checklist item must include:
  - the action to take
  - the documentation/evidence to produce or retain
  - a realistic timeline or frequency
- Do not presume the user’s current maturity, tooling, staffing, budget, or existing compliance posture.
- Keep the checklist comprehensive yet usable; avoid overly abstract steps like “ensure compliance.”

### What This Is NOT
- Not legal advice, a legal opinion, or a substitute for counsel/regulators.
- Not an audit report or certification.
- Not a gap assessment of the user’s current state (unless the user explicitly provides that context).
- Not a promise that completing the list guarantees regulatory approval.

## PROCESS
1. **Pre-analysis (state your understanding first):** In 3–5 bullets, restate what you will produce for the given regulation/industry and note any obvious ambiguities.
2. If critical details are missing, proceed with a broadly applicable checklist for the named regulation/industry and add a short “Assumptions &amp; Clarifications Needed” note.
3. Build the checklist as sequential, executable tasks. Prefer verbs that imply doing: “draft,” “approve,” “implement,” “review,” “retain,” “train,” “test,” “monitor.”
4. Add a final section with extra considerations that commonly get missed but matter for real-world compliance.

## INPUTS
- **Regulation or industry to cover:** [INDUSTRY]

## OUTPUT SPECIFICATION
### Title
- **Compliance Checklist — {Regulation Or Industry Name}**

### Optional setup block (include only if needed)
- **Assumptions &amp; Clarifications Needed:**  
  - {Clarification Item 1}  
  - {Clarification Item 2}

### Main checklist (numbered, minimum 11 items)
For each item, output exactly this structure:
1. **{Action Item Title}:** {Action Description}
   - **Required Documentation/Evidence:** {Documentation List}
   - **Timeline/Frequency:** {Timeline}

### Additional considerations (bulleted)
- {Consideration}
- {Consideration}
- {Consideration}

## QUALITY CHECKS
Before finalizing, verify:
- The checklist contains **11+** distinct, concrete actions.
- Every action includes both **documentation** and a **timeline/frequency**.
- Language is readable for non-experts; jargon is minimized or briefly explained.
- No assumptions are made about the user’s current compliance status or resources.
- The “Additional considerations” section adds meaningful items not duplicated in the main list.            </div>
        </div>


    </div>

    <!-- CTA Row - Full width buttons -->
    <div class="prompt-cta-row">
        <button class="prompt-cta-btn prompt-cta-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
            </svg>
            <span class="cta-copy-text">Copy Full Prompt</span>
        </button>
    </div>
</div>

<style>
    /* Gated prompt states */
    .prompt-gated-wrapper {
        position: relative;
    }

    /* When unlocked - show full content, hide gated */
    body.flowpast-unlocked .prompt-gated-wrapper .prompt-gated-content {
        display: none;
    }

    body.flowpast-unlocked .prompt-gated-wrapper .prompt-content-full {
        display: block !important;
    }

    /* Show/hide elements based on unlock state */
    body.flowpast-unlocked .btn-when-unlocked {
        display: inline-flex !important;
    }

    .prompt-viewer-wrapper {
        scroll-margin-top: 250px;
    }

    /* ========================================
   PROMPT VIEWER - MAIN WRAPPER
   ======================================== */
    .prompt-viewer-wrapper {
        margin: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ========================================
   PROMPT BOX CONTAINER
   ======================================== */
    .prompt-comparison-row {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    /* ========================================
   HEADER WITH BUTTONS
   ======================================== */
    .prompt-row-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .prompt-row-icon {
        font-size: 20px;
    }

    .prompt-row-title {
        font-weight: 600;
        font-size: 22px;
        color: #fff !important;
        text-decoration: underline
    }

    .prompt-header-buttons {
        margin-left: auto;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Header buttons */
    .prompt-header-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-header-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-header-copy:hover {
        background: #2a2a2a;
    }

    .prompt-header-copy.copied {
        background: #2e7d32;
    }

    .prompt-header-copy-green {
        background: #04AA6D !important;
        color: #fff !important;
    }

    .prompt-header-copy-green:hover {
        background: #039860 !important;
    }

    .prompt-header-copy-green.copied {
        background: #2e7d32 !important;
    }

    .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-header-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-1px);
    }

    /* ========================================
   PROMPT CONTENT - FULL (NO SCROLL)
   ======================================== */
    .prompt-box {
        background: #ffffff;
    }

    .prompt-content-full {
        padding: 24px;
        margin: 0;
        color: #202124;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.7;
        white-space: pre-wrap;
        word-wrap: break-word;
        /* No scroll - show full content */
        max-height: none;
        overflow: visible;
    }

    /* Highlighted variable in prompt */
    .prompt-variable {
        background: #fff3cd;
        color: #1967d2;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ffc107;
    }

    .prompt-variable-filled {
        background: #d4edda;
        color: #155724;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #28a745;
    }

    /* ========================================
   GATED CONTENT (NO ACCESS)
   ======================================== */
    .prompt-gated-content {
        padding: 24px;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.8;
        max-height: none;
        overflow: visible;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        cursor: default;
    }

    /* ## headers - larger, black */
    .prompt-header-visible {
        color: #202124;
        font-weight: 600;
        margin: 5px 0 0px 0;
        font-size: 20px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* ### headers - smaller, black */
    .prompt-header-visible.subheader {
        color: #202124;
        font-weight: 600;
        margin: 5px 0;
        font-size: 18px;
    }

    .prompt-header-visible:first-child {
        margin-top: 0;
    }

    /* ========================================
   LOCKED SECTION BLOCK
   ======================================== */
    .locked-section {
        position: relative;
        margin: 4px 0 8px 0;
        border-radius: 6px;
        overflow: hidden;
        background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .locked-section-bg {
        position: relative;
    }

    .locked-section-lines {
        padding: 8px 12px;
        position: relative;
    }

    .locked-line {
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 3px;
        margin-bottom: 4px;
        margin-left: 12px;
    }

    .locked-line:last-child {
        margin-bottom: 0;
    }

    .locked-section-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        font-size: 24px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }

    /* Subheader locked sections - slightly indented */
    /*  .prompt-header-visible.subheader+.locked-section {
        margin-left: 16px;
    } */

    /* ========================================
   COMPATIBILITY BADGES
   ======================================== */
    .prompt-compatibility {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
    }

    .compat-label {
        font-size: 13px;
        color: #5f6368;
        font-weight: 500;
    }

    .compat-badge {
        padding: 4px 10px;
        background: #e8f0fe;
        color: #1967d2;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }

    /* ========================================
   CTA ROW - FULL WIDTH BUTTONS
   ======================================== */
    .prompt-cta-row {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .prompt-cta-btn {
        flex: 1;
        min-width: 200px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 24px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-cta-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-copy:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-copy.copied {
        background: #2e7d32;
    }

    .prompt-cta-reset {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-reset:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-cta-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    /* ========================================
    CUSTOMIZE YOUR PROMPT SECTION
    ======================================== */
    .prompt-customize-section {
        padding: 24px;
        border-bottom: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .customize-title {
        margin: 0 0 8px 0;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
    }

    .customize-subtitle {
        margin: 0 0 20px 0;
        font-size: 14px;
        color: #5f6368;
    }

    .customize-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .customize-table th {
        text-align: left;
        padding: 12px;
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        font-size: 13px;
        font-weight: 600;
        color: #202124;
    }

    .customize-table td {
        padding: 12px;
        border: 1px solid #e0e0e0;
        vertical-align: top;
    }

    .customize-table .var-name {
        width: 25%;
        background: #f8f9fa;
    }

    .customize-table .var-name code {
        background: #fff3cd;
        color: #1967d2;
        border: 1px solid #ffc107;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        word-break: break-all;
        font-weight: 600;
    }

    .customize-table .var-desc {
        width: 35%;
        font-size: 13px;
        color: #5f6368;
        line-height: 1.5;
    }

    .customize-table .var-example {
        margin-top: 8px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #dadce0;
        font-size: 12px;
        color: #5f6368;
        font-style: italic;
        border-radius: 0 4px 4px 0;
    }

    .customize-table .var-input {
        width: 40%;
    }

    .customize-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #dadce0;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .customize-input:focus {
        outline: none;
        border-color: rgb(5, 152, 98);
        box-shadow: 0 0 0 3px rgba(5, 152, 98, 0.1);
    }

    .customize-input::placeholder {
        color: #9aa0a6;
        font-style: italic;
    }

    .copy-customized-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: rgb(5, 152, 98);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .copy-customized-btn:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    .copy-customized-btn.copied {
        background: #2e7d32;
    }

    /* ========================================
    FULL PROMPT CODE HEADER
    ======================================== */
    .prompt-code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
    }

    .prompt-code-title {
        font-size: 22px;
        font-weight: 600;
        text-decoration: underline;

    }

    .prompt-code-buttons {
        display: flex;
        gap: 8px;
    }

    .prompt-code-buttons .prompt-header-btn {
        padding: 8px 14px;
        font-size: 13px;
        background: #ffffff;
        color: #202124;
        border: 1px solid #dadce0;
    }

    .prompt-code-buttons .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
        border-color: rgb(5, 152, 98);
    }

    .prompt-code-buttons .prompt-header-btn.prompt-header-access:hover {
        background: rgb(4, 130, 83) !important;
        border-color: rgb(4, 130, 83);
        color: #fff !important;
    }

    .prompt-code-buttons .prompt-header-btn:hover {
        background: #f1f3f4;
    }

    .prompt-code-buttons .prompt-header-copy.copied {
        background: #d4edda;
        color: #155724;
        border-color: #28a745;
    }

    .prompt-header-reset {
        background: #ffffff;
        color: #202124;
    }

    /* ========================================
   RESPONSIVE
   ======================================== */
    @media (max-width: 768px) {
        .prompt-row-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .prompt-header-buttons {
            margin-left: 0;
            width: 100%;
        }

        .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }

        .prompt-cta-row {
            flex-direction: column;
        }

        .prompt-cta-btn {
            width: 100%;
        }

        /* Customize table responsive */
        .customize-table,
        .customize-table thead,
        .customize-table tbody,
        .customize-table tr,
        .customize-table th,
        .customize-table td {
            display: block;
        }

        .customize-table thead {
            display: none;
        }

        .customize-table tr {
            margin-bottom: 16px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
        }

        .customize-table td {
            width: 100% !important;
            border: none;
            border-bottom: 1px solid #e0e0e0;
        }

        .customize-table td:last-child {
            border-bottom: none;
        }

        .customize-table .var-name {
            background: #f1f3f4;
            font-weight: 600;
        }

        .prompt-code-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }

        .prompt-code-buttons {
            width: 100%;
        }

        .prompt-code-buttons .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }
    }
</style>

<script>
    function handlePromptCopy() {
        // Check if unlocked via cookie
        if (typeof window.flowpastIsUnlocked === 'function' && !window.flowpastIsUnlocked()) {
            // Show email popup
            if (typeof window.flowpastShowEmailPopup === 'function') {
                window.flowpastShowEmailPopup('prompt');
            }
            return;
        }

        // Copy the customized prompt (with filled variables)
        const customizedPrompt = getCustomizedPrompt();
        const copyButtons = document.querySelectorAll('.prompt-header-copy, .prompt-header-copy-green, .prompt-cta-copy, .copy-customized-btn');

        navigator.clipboard.writeText(customizedPrompt).then(() => {
            copyButtons.forEach(btn => {
                btn.classList.add('copied');
                const textSpan = btn.querySelector('span');
                if (textSpan) textSpan.textContent = 'Copied!';
            });

            setTimeout(() => {
                copyButtons.forEach(btn => {
                    btn.classList.remove('copied');
                    const textSpan = btn.querySelector('span');
                    if (textSpan) textSpan.textContent = 'Copy Full Prompt';
                });
            }, 2000);
        }).catch(err => {
            console.error('Failed to copy:', err);
        });
    }

    // Store original prompt for customization
    const originalPrompt = "## OBJECTIVE\r\nCreate a practical, end-to-end compliance checklist tailored to a named regulation or industry, including concrete actions, the records to keep, and workable time targets so a user can organize and complete compliance work without guessing.\r\n\r\n## PERSONA\r\nAct as a senior regulatory compliance advisor with cross-industry experience translating legal\/standards language into operational tasks. Write in plain, business-friendly language that a mixed-experience team can follow.\r\n\r\n## CONSTRAINTS\r\n- Use clear wording and minimize specialized terminology; if a technical term is unavoidable, briefly define it in-line.\r\n- Provide **at least 11** actionable checklist items (not fewer).\r\n- Each checklist item must include:\r\n  - the action to take\r\n  - the documentation\/evidence to produce or retain\r\n  - a realistic timeline or frequency\r\n- Do not presume the user\u2019s current maturity, tooling, staffing, budget, or existing compliance posture.\r\n- Keep the checklist comprehensive yet usable; avoid overly abstract steps like \u201censure compliance.\u201d\r\n\r\n### What This Is NOT\r\n- Not legal advice, a legal opinion, or a substitute for counsel\/regulators.\r\n- Not an audit report or certification.\r\n- Not a gap assessment of the user\u2019s current state (unless the user explicitly provides that context).\r\n- Not a promise that completing the list guarantees regulatory approval.\r\n\r\n## PROCESS\r\n1. **Pre-analysis (state your understanding first):** In 3\u20135 bullets, restate what you will produce for the given regulation\/industry and note any obvious ambiguities.\r\n2. If critical details are missing, proceed with a broadly applicable checklist for the named regulation\/industry and add a short \u201cAssumptions & Clarifications Needed\u201d note.\r\n3. Build the checklist as sequential, executable tasks. Prefer verbs that imply doing: \u201cdraft,\u201d \u201capprove,\u201d \u201cimplement,\u201d \u201creview,\u201d \u201cretain,\u201d \u201ctrain,\u201d \u201ctest,\u201d \u201cmonitor.\u201d\r\n4. Add a final section with extra considerations that commonly get missed but matter for real-world compliance.\r\n\r\n## INPUTS\r\n- **Regulation or industry to cover:** [INDUSTRY]\r\n\r\n## OUTPUT SPECIFICATION\r\n### Title\r\n- **Compliance Checklist \u2014 {Regulation Or Industry Name}**\r\n\r\n### Optional setup block (include only if needed)\r\n- **Assumptions & Clarifications Needed:**  \r\n  - {Clarification Item 1}  \r\n  - {Clarification Item 2}\r\n\r\n### Main checklist (numbered, minimum 11 items)\r\nFor each item, output exactly this structure:\r\n1. **{Action Item Title}:** {Action Description}\r\n   - **Required Documentation\/Evidence:** {Documentation List}\r\n   - **Timeline\/Frequency:** {Timeline}\r\n\r\n### Additional considerations (bulleted)\r\n- {Consideration}\r\n- {Consideration}\r\n- {Consideration}\r\n\r\n## QUALITY CHECKS\r\nBefore finalizing, verify:\r\n- The checklist contains **11+** distinct, concrete actions.\r\n- Every action includes both **documentation** and a **timeline\/frequency**.\r\n- Language is readable for non-experts; jargon is minimized or briefly explained.\r\n- No assumptions are made about the user\u2019s current compliance status or resources.\r\n- The \u201cAdditional considerations\u201d section adds meaningful items not duplicated in the main list.";
    const variables = ["[INDUSTRY]"];
    // Initial render with highlighted variables
    document.addEventListener('DOMContentLoaded', function() {
        renderPromptWithHighlights();
    });

    // Live update prompt as user types
    document.querySelectorAll('.customize-input').forEach(input => {
        input.addEventListener('input', renderPromptWithHighlights);
    });

    function renderPromptWithHighlights() {
        const promptContent = document.getElementById('premium-prompt-content');
        if (!promptContent) return;

        let updatedPrompt = originalPrompt;
        let filledVariables = {};

        // Collect filled values
        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                filledVariables[placeholder] = value;
            }
        });

        // Replace filled variables and highlight remaining
        let htmlContent = escapeHtml(updatedPrompt);

        variables.forEach(placeholder => {
            const escapedPlaceholder = escapeHtml(placeholder);
            const regex = new RegExp(escapeRegex(escapedPlaceholder), 'g');

            if (filledVariables[placeholder]) {
                // Show filled value with green highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable-filled">' + escapeHtml(filledVariables[placeholder]) + '</span>'
                );
            } else {
                // Show original placeholder with yellow highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable">' + escapedPlaceholder + '</span>'
                );
            }
        });

        promptContent.innerHTML = htmlContent;
    }

    function escapeRegex(string) {
        return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    }

    function escapeHtml(text) {
        const div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function resetPrompt() {
        // Clear all input fields
        document.querySelectorAll('.customize-input').forEach(input => {
            input.value = '';
        });

        // Re-render with original placeholders highlighted
        renderPromptWithHighlights();

        // Visual feedback
        const resetBtns = document.querySelectorAll('.prompt-header-reset, .prompt-cta-reset');
        resetBtns.forEach(btn => {
            const originalText = btn.querySelector('span').textContent;
            btn.querySelector('span').textContent = 'Reset!';
            setTimeout(() => {
                btn.querySelector('span').textContent = originalText;
            }, 1000);
        });
    }


    function getCustomizedPrompt() {
        let updatedPrompt = originalPrompt;

        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                const regex = new RegExp(escapeRegex(placeholder), 'g');
                updatedPrompt = updatedPrompt.replace(regex, value);
            }
        });

        return updatedPrompt;
    }
</script>

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>Name the exact compliance target, not a vague theme.</strong> Use “GDPR (EU) for a B2B SaaS as a processor” instead of “data privacy,” or “HIPAA Security Rule for a telehealth app” instead of “HIPAA.” If you’re unsure, ask a quick follow-up: “List the top 3 plausible frameworks that apply to my situation and recommend one to start with.”</li>


<li><strong>Ask for role ownership in the same run.</strong> After the checklist is generated, prompt: “Add an ‘Owner’ column for each checklist item using roles (Compliance, IT, Security, HR, Finance, Legal, Engineering, Vendor Management).” You’ll get something you can paste straight into Asana, Jira, or a spreadsheet.</li>


<li><strong>Force evidence to be audit-ready.</strong> If the evidence reads like “keep documentation,” tighten it with: “For each item, specify 2–3 example artifacts (policy doc name, screenshot type, log source, ticket fields) and how long to retain them.” Honestly, most teams do the work and still fail because proof is scattered.</li>


<li><strong>Iterate the timelines based on reality.</strong> The prompt provides workable timing, but you should tune it to your cadence. After the first output, try asking: “Now adjust timelines for a lean team (2 people) and prioritize tasks into Week 1, Weeks 2–4, Months 2–3, and Ongoing.”</li>


<li><strong>Use a second pass to create a tracker.</strong> Once you like the checklist, follow with: “Convert this into a tracker table with columns: Task, Owner, Due date, Frequency, Evidence, Status, Notes, Risk if missed.” If you also need to justify budget or headcount, pair it with a quantified view like the <a href="https://flowpast.com/prompts/certification-roi-comparison-report-ai-prompt/">Certification ROI Comparison Report AI Prompt</a>.</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>Once you have a checklist, these prompts help you justify the effort, measure adoption, and report progress in a way stakeholders actually read.</p>



<p>If you also need to make the business case for audits or formal programs, the <a href="https://flowpast.com/prompts/certification-roi-comparison-report-ai-prompt/">Certification ROI Comparison Report AI Prompt</a> helps you compare certification paths and explain ROI in plain terms. It pairs well when your checklist reveals big lifts (training, tooling, external assessments) and leadership wants numbers before approving spend.</p>



<p>For teams doing internal enablement, the <a href="https://flowpast.com/prompts/build-an-onboarding-roi-dashboard-with-this-ai-prompt/">Build an Onboarding ROI Dashboard with this AI Prompt</a> is useful right after you set compliance training and policy rollouts. When you’re required to train staff and prove it happened, a dashboard approach makes completion rates, time-to-productivity, and refresh cycles much easier to track.</p>



<p>When your compliance program touches customer lifecycle outcomes (think churn risk from failed security reviews or renewals blocked by missing documentation), use the <a href="https://flowpast.com/prompts/create-a-retention-intelligence-report-with-this-ai-prompt/">Create a Retention Intelligence Report with this AI Prompt</a> to connect operational work to retention. It’s a smart follow-up when Sales or CS keeps saying, “Compliance is slowing deals,” and you want to quantify the impact.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/certification-roi-comparison-report-ai-prompt/">Certification ROI Comparison Report AI Prompt</a>: Compare certification options and ROI.</li>


<li><a href="https://flowpast.com/prompts/build-an-onboarding-roi-dashboard-with-this-ai-prompt/">Build an Onboarding ROI Dashboard with this AI Prompt</a>: Track training and enablement outcomes.</li>

<li>
<li><a href="https://flowpast.com/prompts/create-a-retention-intelligence-report-with-this-ai-prompt/">Create a Retention Intelligence Report with this AI Prompt</a>: Tie operational risk to retention.</li>


<li><a href="https://flowpast.com/prompts/create-influencer-roi-readouts-with-this-ai-prompt/">Create Influencer ROI Readouts with this AI Prompt</a>: Report ROI with consistent evidence.</li>


<li><a href="https://flowpast.com/prompts/create-a-workout-performance-report-with-this-ai-prompt/">Create a Workout Performance Report with this AI Prompt</a>: Build a repeatable reporting cadence.</li>

</ul>

</div>

<div class="faq-section">

<h2 class="wp-block-heading">Common Questions</h2>


<div class="faq-item">
<span class="question">Which roles benefit most from this compliance checklist AI prompt?</span>

<p class="answer"><strong>Compliance Managers</strong> use this to translate a regulation into an assignable task list with evidence and timing, which is what auditors and executives usually ask for. <strong>Security or GRC Leads</strong> lean on it to align policies, controls, and monitoring into a cadence (monthly reviews, quarterly access checks, annual policy sign-offs). <strong>Operations Leaders</strong> benefit because it produces a practical plan that doesn’t assume fancy tooling or a big staff, so they can schedule work and reduce fire drills. <strong>Consultants and internal auditors</strong> use it as a repeatable starting framework, then tailor it to a client’s environment and terminology.</p>

</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this compliance checklist AI prompt?</span>

<p class="answer"><strong>SaaS and cloud services</strong> get value when customers demand proof of security practices, vendor oversight, and change management, especially during procurement. <strong>Healthcare and digital health</strong> teams use it to organize HIPAA-style administrative and technical safeguards, then keep the right training and access evidence on file. <strong>Financial services and fintech</strong> apply it to tighten recordkeeping, risk reviews, and third-party controls where missing documentation becomes a regulatory issue quickly. <strong>E-commerce and retail</strong> teams use it for privacy and payment-related obligations, plus ongoing monitoring so compliance doesn’t degrade after peak season.</p>

</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for building a compliance checklist produce weak results?</span>

<p class="answer">A typical prompt like “Write me a compliance checklist for GDPR” fails because it: lacks a pre-analysis that clarifies what the checklist will cover and where ambiguity exists, provides no requirement that every item includes evidence to retain, ignores timing (so you get one-time tasks instead of a recurring compliance cadence), produces generic statements like “ensure security” instead of executable verbs, and misses a “commonly overlooked” section where real audit gaps tend to hide. The result reads fine, but it is hard to assign, hard to track, and almost impossible to defend with documentation.</p>

</div>

<div class="faq-item">
<span class="question">Can I customize this compliance checklist AI prompt for my specific situation?</span>

<p class="answer">Yes, even though the prompt has no form fields, you customize it by adding context before you run it. The most important variables to specify are the named regulation or framework, your role in scope (for example: controller vs processor, covered entity vs business associate), the type of data involved, and any operational boundaries like regions or business units. After it outputs the checklist, ask: “Revise this checklist for a team of [size] supporting [product type], and add any items specific to [country/state/industry].” If you want it tighter, add: “Replace any abstract steps with concrete actions and example evidence artifacts.”</p>

</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this compliance checklist AI prompt?</span>

<p class="answer">The biggest mistake is leaving the regulation too vague — instead of “privacy compliance,” use “GDPR + UK GDPR for a B2B SaaS handling employee data in the EU and UK.” Another common error is not stating scope boundaries; “our company” is fuzzy, but “our customer support function and production SaaS environment” is usable. People also forget to request evidence detail, which leads to weak outputs; ask for “example artifacts and retention period” so each item is provable. Finally, teams accept timelines that don’t match their cadence, so follow up with a prioritization pass (Week 1, Month 1, Quarter 1, ongoing) and assign owners.</p>

</div>

<div class="faq-item">
<span class="question">Who should NOT use this compliance checklist AI prompt?</span>

<p class="answer">This prompt isn’t ideal for situations where you need a legal opinion, a formal interpretation of a disputed requirement, or jurisdiction-specific counsel advice. It’s also not the right tool if you are trying to certify immediately and need a full gap assessment mapped to your current controls, systems, and evidence library. If you need that level of precision, use the checklist as a planning baseline, then bring in counsel, an auditor, or a dedicated compliance platform to validate and operationalize it.</p>

</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this compliance checklist AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Compliance Managers use this to translate a regulation into an assignable task list with evidence and timing, which is what auditors and executives usually ask for. Security or GRC Leads lean on it to align policies, controls, and monitoring into a cadence (monthly reviews, quarterly access checks, annual policy sign-offs). Operations Leaders benefit because it produces a practical plan that doesn’t assume fancy tooling or a big staff, so they can schedule work and reduce fire drills. Consultants and internal auditors use it as a repeatable starting framework, then tailor it to a client’s environment and terminology."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this compliance checklist AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SaaS and cloud services get value when customers demand proof of security practices, vendor oversight, and change management, especially during procurement. Healthcare and digital health teams use it to organize HIPAA-style administrative and technical safeguards, then keep the right training and access evidence on file. Financial services and fintech apply it to tighten recordkeeping, risk reviews, and third-party controls where missing documentation becomes a regulatory issue quickly. E-commerce and retail teams use it for privacy and payment-related obligations, plus ongoing monitoring so compliance doesn’t degrade after peak season."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for building a compliance checklist produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like “Write me a compliance checklist for GDPR” fails because it: lacks a pre-analysis that clarifies what the checklist will cover and where ambiguity exists, provides no requirement that every item includes evidence to retain, ignores timing (so you get one-time tasks instead of a recurring compliance cadence), produces generic statements like “ensure security” instead of executable verbs, and misses a “commonly overlooked” section where real audit gaps tend to hide. The result reads fine, but it is hard to assign, hard to track, and almost impossible to defend with documentation."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this compliance checklist AI prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes, even though the prompt has no form fields, you customize it by adding context before you run it. The most important variables to specify are the named regulation or framework, your role in scope (for example: controller vs processor, covered entity vs business associate), the type of data involved, and any operational boundaries like regions or business units. After it outputs the checklist, ask: “Revise this checklist for a team of [size] supporting [product type], and add any items specific to [country/state/industry].” If you want it tighter, add: “Replace any abstract steps with concrete actions and example evidence artifacts.”"
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this compliance checklist AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving the regulation too vague — instead of “privacy compliance,” use “GDPR + UK GDPR for a B2B SaaS handling employee data in the EU and UK.” Another common error is not stating scope boundaries; “our company” is fuzzy, but “our customer support function and production SaaS environment” is usable. People also forget to request evidence detail, which leads to weak outputs; ask for “example artifacts and retention period” so each item is provable. Finally, teams accept timelines that don’t match their cadence, so follow up with a prioritization pass (Week 1, Month 1, Quarter 1, ongoing) and assign owners."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this compliance checklist AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for situations where you need a legal opinion, a formal interpretation of a disputed requirement, or jurisdiction-specific counsel advice. It’s also not the right tool if you are trying to certify immediately and need a full gap assessment mapped to your current controls, systems, and evidence library. If you need that level of precision, use the checklist as a planning baseline, then bring in counsel, an auditor, or a dedicated compliance platform to validate and operationalize it."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">

<p>Compliance gets easier when it becomes a schedule of concrete actions plus proof, not a cloud of good intentions. Paste the prompt into your model, name the regulation, and walk away with a checklist your team can actually execute.</p>

</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5000807.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Run a Website Technical Audit Checklist AI Prompt</title>
		<link>https://flowpast.com/prompts/run-a-website-technical-audit-checklist-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:46:10 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5002243</guid>

					<description><![CDATA[Site issues hurt sales - a ready-to-use AI Prompt that outputs a prioritized technical audit checklist for speed, mobile, HTTPS, and WCAG. Discover more AI prompts for marketing, sales, and ops.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: technical audit checklist -->
<div class="hook-introduction">

<p>Your website can look fine and still leak revenue. A slow homepage, a broken mobile menu, mixed-content warnings, or missing accessibility basics quietly push people to bounce (and they’re hard to spot without a process). Most teams “fix things as they notice them,” which is honestly how issues linger for months.</p>



<p>This <strong>technical audit checklist</strong> is built for <strong>marketing managers</strong> who need a clear dev handoff before a campaign push, <strong>site owners</strong> trying to pinpoint why conversions dipped after a theme/plugin change, and <strong>consultants</strong> who must deliver a credible technical audit without turning it into a six-week engagement. The output is a prioritized, checkbox-based audit across speed, mobile, HTTPS/security, accessibility (WCAG-related checks), and overall site health, plus a “next 48 hours” punch list.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It reviews the site at your provided URL and organizes findings across speed, mobile responsiveness, HTTPS/security, accessibility, and general health checks.</li>
          <li>It writes each finding as an action item with “what to check,” “why it matters,” and “how to fix it,” instead of generic best practices.</li>
          <li>It assigns a severity/impact rating (Critical/High/Medium/Low) and calls out the expected benefit so you can sequence work logically.</li>
          <li>It uses checkbox formatting in every section, making it easy to paste into a ticketing system or share as a remediation checklist.</li>
          <li>When live testing isn’t possible, it clearly separates inferences from items that must be verified with tools (PageSpeed Insights, Lighthouse, Search Console, etc.).</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>Your site feels “slow,” but you need a prioritized plan before asking a developer to optimize anything.</li>
          <li>You’re preparing for a launch, migration, or big traffic event and want to reduce preventable technical failures.</li>
          <li>Mobile conversions are lagging desktop, and you suspect layout shifts, tap target issues, or responsiveness bugs.</li>
          <li>You’ve seen browser warnings (not secure, mixed content) or you’re tightening trust signals for paid traffic and SEO.</li>
          <li>You’re scaling content and campaigns and need an ongoing technical baseline so small issues don’t snowball.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A multi-section technical audit checklist with 30–60 checkbox items (volume varies by site complexity).</li>
           <li>Severity-ranked findings (Critical/High/Medium/Low) with a short “expected outcome” note for each.</li>
           <li>Implementation-ready fix guidance, including tool suggestions and configuration examples where relevant.</li>
           <li>A “Next 48 hours” punch list containing the highest-impact remediation steps.</li>
           <li>A short set of follow-up questions and verification steps if the URL is invalid, blocked, or requires login.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: Prioritized Website Technical Audit Checklist</h2>



<div class="prompt-viewer-wrapper" id="prompt-section">
    <div class="prompt-comparison-row prompt-premium">
        <!-- Header with buttons -->
        <div class="prompt-row-header">
            <!-- <span class="prompt-row-icon">✨</span> -->
            <span class="prompt-row-title">
                                    Step 1: Customize the prompt with your input
                            </span>
            <div class="prompt-header-buttons">
                                    <button class="prompt-header-btn prompt-header-reset" onclick="resetPrompt()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                                <button class="prompt-header-btn prompt-header-copy-green flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span>Customize and Copy Full Prompt</span>
                </button>
            </div>
        </div>

        <!-- Customize the Prompt Section -->
                    <div class="prompt-customize-section">
                <span class="customize-title">Customize the Prompt</span>
                <p class="customize-subtitle">Fill in the fields below to personalize this prompt for your needs.</p>
                <table class="customize-table">
                    <thead>
                        <tr>
                            <th>Variable</th>
                            <th>What to Enter</th>
                            <th>Customise the prompt</th>
                        </tr>
                    </thead>
                    <tbody>
                                                    <tr>
                                <td class="var-name"><code>[COMPANY_DOCUMENTS]</code></td>
                                <td class="var-desc">
                                    List the employment-related documents to be reviewed, such as contracts, policies, handbooks, or any other relevant materials.                                    <div class="var-example">For example: "Employee handbook, standard employment contracts, grievance procedure documentation, contractor agreements, and remote work policies."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[COMPANY_DOCUMENTS]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[REGIONAL_LABOR_LAWS]</code></td>
                                <td class="var-desc">
                                    Provide the specific national and local labor laws, statutes, or regulations applicable to the jurisdictions under review.                                    <div class="var-example">For example: "United States: Fair Labor Standards Act (FLSA), Title VII of the Civil Rights Act; Germany: Arbeitszeitgesetz (Working Hours Act), Allgemeines Gleichbehandlungsgesetz (General Equal Treatment Act)."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[REGIONAL_LABOR_LAWS]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[INDUSTRY_WORKFORCE_COMPOSITION]</code></td>
                                <td class="var-desc">
                                    Describe the composition of the workforce, including types of workers (e.g., full-time, part-time, contractors), their roles, and any unique employment arrangements.                                    <div class="var-example">For example: "The workforce includes 200 full-time employees, 50 part-time employees, and 30 independent contractors, with roles spanning manufacturing, logistics, and administrative support."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[INDUSTRY_WORKFORCE_COMPOSITION]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[JURISDICTIONS]</code></td>
                                <td class="var-desc">
                                    List the geographic regions or countries where the organization operates and where labor compliance needs to be assessed.                                    <div class="var-example">For example: "United States, Germany, India, and Brazil."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[JURISDICTIONS]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[PRIMARY_GOAL]</code></td>
                                <td class="var-desc">
                                    State the main objective of the audit, such as identifying compliance gaps, resolving conflicts between ILO conventions and local laws, or developing a remediation plan.                                    <div class="var-example">For example: "Identify discrepancies between company policies and ILO conventions, and recommend corrective actions to ensure compliance with both ILO standards and local labor laws."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[PRIMARY_GOAL]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[TIMEFRAME]</code></td>
                                <td class="var-desc">
                                    Specify the timeline for completing the labor compliance audit and delivering the final report.                                    <div class="var-example">For example: "Four weeks from the start of the audit process."</div>
                                </td>
                                <td class="var-input">
                                                                            <input
                                            type="text"
                                            class="customize-input"
                                            data-placeholder="[TIMEFRAME]"
                                            placeholder="Enter your value here..." />
                                                                    </td>
                            </tr>
                                            </tbody>
                </table>

                <button class="copy-customized-btn flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span class="copy-customized-text">Customise the prompt now</span>
                </button>
            </div>
        
        <!-- Full Prompt Code Header -->
                    <div class="prompt-code-header">
                <span class="prompt-code-title">
                    Step 2: Copy the Prompt
                </span>
                <div class="prompt-code-buttons">
                    <!-- Reset: Only visible when unlocked -->
                    <button class="prompt-header-btn prompt-header-reset btn-when-unlocked" onclick="resetPrompt()" style="display: none;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                    <!-- Copy Full Prompt -->
                    <button class="prompt-header-btn prompt-header-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                            <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                        </svg>
                        <span>Copy Full Prompt</span>
                    </button>
                </div>
            </div>
        

        <!-- Prompt Content -->
        <div class="prompt-box prompt-gated-wrapper">
            <!-- Gated: Blurred content -->
            <div class="prompt-gated-content">
                <div class="prompt-header-visible">OBJECTIVE</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PERSONA</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">CONSTRAINTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PROCESS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">INPUTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">OUTPUT SPECIFICATION</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">1) Executive Overview</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">2) Standards Map (ILO + Local Law Crosswalk)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">3) Phase A — Document Examination Results</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">4) Phase B — Gap &amp; Risk Analysis</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">5) Priority Matrix (Critical Issues Triage)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">6) Phase C — Remediation &amp; Control Plan</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">7) Contractor / Remote / Cross-Border Addendum (if in scope)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">8) Appendix</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">QUALITY CHECKS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div>            </div>
            <!-- Unlocked: Full content (hidden by default) -->
            <div class="prompt-content-full" id="premium-prompt-content" style="display: none;">
                ## OBJECTIVE
Produce a formal labor-standards compliance audit that crosswalks an organization’s employment documents and real-world practices against (a) relevant ILO Conventions and (b) applicable national/local labor rules across the jurisdictions provided. The deliverable must surface practical implementation gaps, highlight conflicts between standards, and lay out a prioritized remediation plan with citations, timelines, and monitoring controls.

## PERSONA
Act as a veteran labor compliance examiner who previously conducted field investigations for an international labor-body and now specializes in multi-country audits. You write with clinical clarity, strong legal referencing habits, and an operations-first mindset (what happens in practice, not just what’s written). You assume failures often come from ambiguity and inconsistent rollout—not intent—so you focus on precise fixes.

## CONSTRAINTS
- Cite ILO sources with specificity (Convention number + relevant article[s]) in brackets: e.g., **[ILO C087, Art. 2]**.
- Cite local law references similarly in brackets using what the user provides (statute name/section/article, decree number, etc.).
- Where ILO guidance and local law diverge, call out the conflict and recommend the more protective/higher standard unless the user explicitly instructs otherwise.
- Concentrate on high-exposure domains:
  - wage computation and deductions
  - working time and overtime
  - discrimination/harassment and equal opportunity
  - freedom of association / collective bargaining
- No vague conclusions (e.g., “ensure compliance”). Every finding must include a concrete corrective action.
- Rank recommendations by (1) legal/regulatory risk and (2) execution difficulty.
- Include “quick containment” actions plus deeper system changes.
- Address contractors, remote staff, cross-border employment, and third-party labor where applicable.
- **What This Is NOT**
  - Not formal legal representation or jurisdiction-specific legal advice beyond the supplied laws/documents.
  - Not an HR policy rewrite in full (only targeted redlines or clause-level suggestions when needed).
  - Not a full payroll audit with recalculation unless the user provides payroll data and requests it.

## PROCESS
1. **Pre-analysis confirmation (required):** Restate your understanding of the company footprint, worker types, and jurisdictions; list the ILO conventions you expect to be implicated; and name any missing inputs you need.
2. **Phase A — Evidence &amp; Document Examination:**  
   Review contracts, handbook/policies, SOPs, contractor templates, remote-work terms, and any enforcement materials (disciplinary process, grievance channels, timekeeping rules). Map each area to ILO requirements and the provided local laws.
3. **Phase B — Variance &amp; Root-Cause Findings:**  
   Identify mismatches between (i) written policy, (ii) likely day-to-day practice implied by the documents, and (iii) ILO/local requirements. Separate:
   - immediate non-compliance (clear breach)
   - structural weaknesses (ambiguity, missing controls, inconsistent application)
4. **Phase C — Corrective Program Design:**  
   Provide a prioritized remediation plan with:
   - specific actions and owners
   - suggested clause-level fixes (where relevant)
   - timeline bands (near-term vs medium vs long-range)
   - monitoring and evidence trails (what to measure, how often, and what records prove compliance)
5. **Edge-case handling:**  
   If inputs are incomplete, do not guess. Mark items as **“Assessment Pending”**, state what’s missing, and provide interim risk controls that can be implemented without additional data.

## INPUTS
- **Company documents (contracts, policies, handbooks, SOPs, templates):** [COMPANY_DOCUMENTS]
- **Applicable national/local labor laws (all jurisdictions in scope):** [REGIONAL_LABOR_LAWS]
- **Industry + workforce profile (roles, headcount, worker categories, locations, remote/cross-border/contractor use):** [INDUSTRY_WORKFORCE_COMPOSITION]
- **Primary jurisdictions to cover (countries/regions/sites):** [JURISDICTIONS]
- **Audit purpose and priority outcomes (e.g., regulator readiness, acquisition diligence, internal controls):** [PRIMARY_GOAL]
- **Time constraints for remediation planning (if any):** [TIMEFRAME]

## OUTPUT SPECIFICATION
Deliver a **formal compliance report** with bold section headers, bullet-point findings, numbered recommendations, and bracketed citations.

### 1) Executive Overview
- {Audit Scope Summary}
- {Top Risks Snapshot} (3–7 items)
- {Immediate Containment Actions} (if any)

### 2) Standards Map (ILO + Local Law Crosswalk)
Provide a table:
- {Compliance Domain}
- {Relevant ILO Convention/Article}
- {Relevant Local Law Citation}
- {Company Document Reference}
- {Required Standard (Higher-of-Two Note)}
- {Initial Status (Compliant / Partial / Non-Compliant / Assessment Pending)}

### 3) Phase A — Document Examination Results
For each domain (wages, working time, discrimination, collective bargaining, plus any additional triggered areas), include:
- {What the documents say} (quote or clause reference)
- {Where it applies} (worker types, jurisdictions, contractor/remote relevance)
- {Control gaps} (missing definitions, enforcement steps, recordkeeping)

### 4) Phase B — Gap &amp; Risk Analysis
For each finding, include:
- {Finding Title}
- {Observed/Implied Practice Risk}
- {ILO Basis} [ILO …]
- {Local Law Basis} [Local …]
- {Conflict Note} (if standards differ)
- {Risk Rating} (High/Med/Low)
- {Impact Pathway} (penalties, backpay, injunctions, reputational, operational disruption)
- {Root Cause Hypothesis} (policy ambiguity, training gap, vendor control weakness, etc.)

### 5) Priority Matrix (Critical Issues Triage)
Include a matrix table:
- {Issue}
- {Risk Level}
- {Required Action Window} (e.g., 0–30 days / 31–90 / 91–180 / 180+)
- {Execution Complexity}
- {Owner/Function}
- {Proof of Fix}

### 6) Phase C — Remediation &amp; Control Plan
Numbered list of recommendations, each with:
1. {Corrective Action}
2. {Legal/Standards Citation} [ILO …] [Local …]
3. {Implementation Steps}
4. {Timeline}
5. {Dependencies}
6. {Monitoring Mechanism} (KPIs, audits, grievance metrics, timekeeping checks)
7. {Evidence to Retain} (records, acknowledgments, logs, committee minutes, etc.)

### 7) Contractor / Remote / Cross-Border Addendum (if in scope)
- {Third-Party Labor Risks}
- {Contract Clauses to Add or Tighten}
- {Onboarding/Training/Monitoring Requirements}
- {Jurisdictional Triggers} (permanent establishment, local registration, mandatory benefits, etc.)

### 8) Appendix
- {Document Index Reviewed}
- {Open Questions / Missing Inputs}
- {Assumptions Log} (only if the user authorizes assumptions)

## QUALITY CHECKS
Before finalizing, verify:
- All non-trivial claims are backed by at least one bracketed ILO reference and/or provided local-law citation.
- Every identified gap includes a specific corrective action, an owner, and measurable proof-of-fix.
- Conflicts between ILO and local rules are explicitly flagged and the recommended standard is justified.
- The priority matrix aligns with the remediation plan (no “orphan” high-risk issues).
- Any ambiguity or missing data is labeled **Assessment Pending** with clear next-request items.            </div>
        </div>


    </div>

    <!-- CTA Row - Full width buttons -->
    <div class="prompt-cta-row">
        <button class="prompt-cta-btn prompt-cta-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
            </svg>
            <span class="cta-copy-text">Copy Full Prompt</span>
        </button>
    </div>
</div>

<style>
    /* Gated prompt states */
    .prompt-gated-wrapper {
        position: relative;
    }

    /* When unlocked - show full content, hide gated */
    body.flowpast-unlocked .prompt-gated-wrapper .prompt-gated-content {
        display: none;
    }

    body.flowpast-unlocked .prompt-gated-wrapper .prompt-content-full {
        display: block !important;
    }

    /* Show/hide elements based on unlock state */
    body.flowpast-unlocked .btn-when-unlocked {
        display: inline-flex !important;
    }

    .prompt-viewer-wrapper {
        scroll-margin-top: 250px;
    }

    /* ========================================
   PROMPT VIEWER - MAIN WRAPPER
   ======================================== */
    .prompt-viewer-wrapper {
        margin: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ========================================
   PROMPT BOX CONTAINER
   ======================================== */
    .prompt-comparison-row {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    /* ========================================
   HEADER WITH BUTTONS
   ======================================== */
    .prompt-row-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .prompt-row-icon {
        font-size: 20px;
    }

    .prompt-row-title {
        font-weight: 600;
        font-size: 22px;
        color: #fff !important;
        text-decoration: underline
    }

    .prompt-header-buttons {
        margin-left: auto;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Header buttons */
    .prompt-header-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-header-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-header-copy:hover {
        background: #2a2a2a;
    }

    .prompt-header-copy.copied {
        background: #2e7d32;
    }

    .prompt-header-copy-green {
        background: #04AA6D !important;
        color: #fff !important;
    }

    .prompt-header-copy-green:hover {
        background: #039860 !important;
    }

    .prompt-header-copy-green.copied {
        background: #2e7d32 !important;
    }

    .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-header-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-1px);
    }

    /* ========================================
   PROMPT CONTENT - FULL (NO SCROLL)
   ======================================== */
    .prompt-box {
        background: #ffffff;
    }

    .prompt-content-full {
        padding: 24px;
        margin: 0;
        color: #202124;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.7;
        white-space: pre-wrap;
        word-wrap: break-word;
        /* No scroll - show full content */
        max-height: none;
        overflow: visible;
    }

    /* Highlighted variable in prompt */
    .prompt-variable {
        background: #fff3cd;
        color: #1967d2;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ffc107;
    }

    .prompt-variable-filled {
        background: #d4edda;
        color: #155724;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #28a745;
    }

    /* ========================================
   GATED CONTENT (NO ACCESS)
   ======================================== */
    .prompt-gated-content {
        padding: 24px;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.8;
        max-height: none;
        overflow: visible;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        cursor: default;
    }

    /* ## headers - larger, black */
    .prompt-header-visible {
        color: #202124;
        font-weight: 600;
        margin: 5px 0 0px 0;
        font-size: 20px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* ### headers - smaller, black */
    .prompt-header-visible.subheader {
        color: #202124;
        font-weight: 600;
        margin: 5px 0;
        font-size: 18px;
    }

    .prompt-header-visible:first-child {
        margin-top: 0;
    }

    /* ========================================
   LOCKED SECTION BLOCK
   ======================================== */
    .locked-section {
        position: relative;
        margin: 4px 0 8px 0;
        border-radius: 6px;
        overflow: hidden;
        background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .locked-section-bg {
        position: relative;
    }

    .locked-section-lines {
        padding: 8px 12px;
        position: relative;
    }

    .locked-line {
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 3px;
        margin-bottom: 4px;
        margin-left: 12px;
    }

    .locked-line:last-child {
        margin-bottom: 0;
    }

    .locked-section-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        font-size: 24px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }

    /* Subheader locked sections - slightly indented */
    /*  .prompt-header-visible.subheader+.locked-section {
        margin-left: 16px;
    } */

    /* ========================================
   COMPATIBILITY BADGES
   ======================================== */
    .prompt-compatibility {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
    }

    .compat-label {
        font-size: 13px;
        color: #5f6368;
        font-weight: 500;
    }

    .compat-badge {
        padding: 4px 10px;
        background: #e8f0fe;
        color: #1967d2;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }

    /* ========================================
   CTA ROW - FULL WIDTH BUTTONS
   ======================================== */
    .prompt-cta-row {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .prompt-cta-btn {
        flex: 1;
        min-width: 200px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 24px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-cta-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-copy:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-copy.copied {
        background: #2e7d32;
    }

    .prompt-cta-reset {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-reset:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-cta-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    /* ========================================
    CUSTOMIZE YOUR PROMPT SECTION
    ======================================== */
    .prompt-customize-section {
        padding: 24px;
        border-bottom: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .customize-title {
        margin: 0 0 8px 0;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
    }

    .customize-subtitle {
        margin: 0 0 20px 0;
        font-size: 14px;
        color: #5f6368;
    }

    .customize-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .customize-table th {
        text-align: left;
        padding: 12px;
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        font-size: 13px;
        font-weight: 600;
        color: #202124;
    }

    .customize-table td {
        padding: 12px;
        border: 1px solid #e0e0e0;
        vertical-align: top;
    }

    .customize-table .var-name {
        width: 25%;
        background: #f8f9fa;
    }

    .customize-table .var-name code {
        background: #fff3cd;
        color: #1967d2;
        border: 1px solid #ffc107;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        word-break: break-all;
        font-weight: 600;
    }

    .customize-table .var-desc {
        width: 35%;
        font-size: 13px;
        color: #5f6368;
        line-height: 1.5;
    }

    .customize-table .var-example {
        margin-top: 8px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #dadce0;
        font-size: 12px;
        color: #5f6368;
        font-style: italic;
        border-radius: 0 4px 4px 0;
    }

    .customize-table .var-input {
        width: 40%;
    }

    .customize-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #dadce0;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .customize-input:focus {
        outline: none;
        border-color: rgb(5, 152, 98);
        box-shadow: 0 0 0 3px rgba(5, 152, 98, 0.1);
    }

    .customize-input::placeholder {
        color: #9aa0a6;
        font-style: italic;
    }

    .copy-customized-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: rgb(5, 152, 98);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .copy-customized-btn:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    .copy-customized-btn.copied {
        background: #2e7d32;
    }

    /* ========================================
    FULL PROMPT CODE HEADER
    ======================================== */
    .prompt-code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
    }

    .prompt-code-title {
        font-size: 22px;
        font-weight: 600;
        text-decoration: underline;

    }

    .prompt-code-buttons {
        display: flex;
        gap: 8px;
    }

    .prompt-code-buttons .prompt-header-btn {
        padding: 8px 14px;
        font-size: 13px;
        background: #ffffff;
        color: #202124;
        border: 1px solid #dadce0;
    }

    .prompt-code-buttons .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
        border-color: rgb(5, 152, 98);
    }

    .prompt-code-buttons .prompt-header-btn.prompt-header-access:hover {
        background: rgb(4, 130, 83) !important;
        border-color: rgb(4, 130, 83);
        color: #fff !important;
    }

    .prompt-code-buttons .prompt-header-btn:hover {
        background: #f1f3f4;
    }

    .prompt-code-buttons .prompt-header-copy.copied {
        background: #d4edda;
        color: #155724;
        border-color: #28a745;
    }

    .prompt-header-reset {
        background: #ffffff;
        color: #202124;
    }

    /* ========================================
   RESPONSIVE
   ======================================== */
    @media (max-width: 768px) {
        .prompt-row-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .prompt-header-buttons {
            margin-left: 0;
            width: 100%;
        }

        .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }

        .prompt-cta-row {
            flex-direction: column;
        }

        .prompt-cta-btn {
            width: 100%;
        }

        /* Customize table responsive */
        .customize-table,
        .customize-table thead,
        .customize-table tbody,
        .customize-table tr,
        .customize-table th,
        .customize-table td {
            display: block;
        }

        .customize-table thead {
            display: none;
        }

        .customize-table tr {
            margin-bottom: 16px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
        }

        .customize-table td {
            width: 100% !important;
            border: none;
            border-bottom: 1px solid #e0e0e0;
        }

        .customize-table td:last-child {
            border-bottom: none;
        }

        .customize-table .var-name {
            background: #f1f3f4;
            font-weight: 600;
        }

        .prompt-code-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }

        .prompt-code-buttons {
            width: 100%;
        }

        .prompt-code-buttons .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }
    }
</style>

<script>
    function handlePromptCopy() {
        // Check if unlocked via cookie
        if (typeof window.flowpastIsUnlocked === 'function' && !window.flowpastIsUnlocked()) {
            // Show email popup
            if (typeof window.flowpastShowEmailPopup === 'function') {
                window.flowpastShowEmailPopup('prompt');
            }
            return;
        }

        // Copy the customized prompt (with filled variables)
        const customizedPrompt = getCustomizedPrompt();
        const copyButtons = document.querySelectorAll('.prompt-header-copy, .prompt-header-copy-green, .prompt-cta-copy, .copy-customized-btn');

        navigator.clipboard.writeText(customizedPrompt).then(() => {
            copyButtons.forEach(btn => {
                btn.classList.add('copied');
                const textSpan = btn.querySelector('span');
                if (textSpan) textSpan.textContent = 'Copied!';
            });

            setTimeout(() => {
                copyButtons.forEach(btn => {
                    btn.classList.remove('copied');
                    const textSpan = btn.querySelector('span');
                    if (textSpan) textSpan.textContent = 'Copy Full Prompt';
                });
            }, 2000);
        }).catch(err => {
            console.error('Failed to copy:', err);
        });
    }

    // Store original prompt for customization
    const originalPrompt = "## OBJECTIVE\r\nProduce a formal labor-standards compliance audit that crosswalks an organization\u2019s employment documents and real-world practices against (a) relevant ILO Conventions and (b) applicable national\/local labor rules across the jurisdictions provided. The deliverable must surface practical implementation gaps, highlight conflicts between standards, and lay out a prioritized remediation plan with citations, timelines, and monitoring controls.\r\n\r\n## PERSONA\r\nAct as a veteran labor compliance examiner who previously conducted field investigations for an international labor-body and now specializes in multi-country audits. You write with clinical clarity, strong legal referencing habits, and an operations-first mindset (what happens in practice, not just what\u2019s written). You assume failures often come from ambiguity and inconsistent rollout\u2014not intent\u2014so you focus on precise fixes.\r\n\r\n## CONSTRAINTS\r\n- Cite ILO sources with specificity (Convention number + relevant article[s]) in brackets: e.g., **[ILO C087, Art. 2]**.\r\n- Cite local law references similarly in brackets using what the user provides (statute name\/section\/article, decree number, etc.).\r\n- Where ILO guidance and local law diverge, call out the conflict and recommend the more protective\/higher standard unless the user explicitly instructs otherwise.\r\n- Concentrate on high-exposure domains:\r\n  - wage computation and deductions\r\n  - working time and overtime\r\n  - discrimination\/harassment and equal opportunity\r\n  - freedom of association \/ collective bargaining\r\n- No vague conclusions (e.g., \u201censure compliance\u201d). Every finding must include a concrete corrective action.\r\n- Rank recommendations by (1) legal\/regulatory risk and (2) execution difficulty.\r\n- Include \u201cquick containment\u201d actions plus deeper system changes.\r\n- Address contractors, remote staff, cross-border employment, and third-party labor where applicable.\r\n- **What This Is NOT**\r\n  - Not formal legal representation or jurisdiction-specific legal advice beyond the supplied laws\/documents.\r\n  - Not an HR policy rewrite in full (only targeted redlines or clause-level suggestions when needed).\r\n  - Not a full payroll audit with recalculation unless the user provides payroll data and requests it.\r\n\r\n## PROCESS\r\n1. **Pre-analysis confirmation (required):** Restate your understanding of the company footprint, worker types, and jurisdictions; list the ILO conventions you expect to be implicated; and name any missing inputs you need.\r\n2. **Phase A \u2014 Evidence & Document Examination:**  \r\n   Review contracts, handbook\/policies, SOPs, contractor templates, remote-work terms, and any enforcement materials (disciplinary process, grievance channels, timekeeping rules). Map each area to ILO requirements and the provided local laws.\r\n3. **Phase B \u2014 Variance & Root-Cause Findings:**  \r\n   Identify mismatches between (i) written policy, (ii) likely day-to-day practice implied by the documents, and (iii) ILO\/local requirements. Separate:\r\n   - immediate non-compliance (clear breach)\r\n   - structural weaknesses (ambiguity, missing controls, inconsistent application)\r\n4. **Phase C \u2014 Corrective Program Design:**  \r\n   Provide a prioritized remediation plan with:\r\n   - specific actions and owners\r\n   - suggested clause-level fixes (where relevant)\r\n   - timeline bands (near-term vs medium vs long-range)\r\n   - monitoring and evidence trails (what to measure, how often, and what records prove compliance)\r\n5. **Edge-case handling:**  \r\n   If inputs are incomplete, do not guess. Mark items as **\u201cAssessment Pending\u201d**, state what\u2019s missing, and provide interim risk controls that can be implemented without additional data.\r\n\r\n## INPUTS\r\n- **Company documents (contracts, policies, handbooks, SOPs, templates):** [COMPANY_DOCUMENTS]\r\n- **Applicable national\/local labor laws (all jurisdictions in scope):** [REGIONAL_LABOR_LAWS]\r\n- **Industry + workforce profile (roles, headcount, worker categories, locations, remote\/cross-border\/contractor use):** [INDUSTRY_WORKFORCE_COMPOSITION]\r\n- **Primary jurisdictions to cover (countries\/regions\/sites):** [JURISDICTIONS]\r\n- **Audit purpose and priority outcomes (e.g., regulator readiness, acquisition diligence, internal controls):** [PRIMARY_GOAL]\r\n- **Time constraints for remediation planning (if any):** [TIMEFRAME]\r\n\r\n## OUTPUT SPECIFICATION\r\nDeliver a **formal compliance report** with bold section headers, bullet-point findings, numbered recommendations, and bracketed citations.\r\n\r\n### 1) Executive Overview\r\n- {Audit Scope Summary}\r\n- {Top Risks Snapshot} (3\u20137 items)\r\n- {Immediate Containment Actions} (if any)\r\n\r\n### 2) Standards Map (ILO + Local Law Crosswalk)\r\nProvide a table:\r\n- {Compliance Domain}\r\n- {Relevant ILO Convention\/Article}\r\n- {Relevant Local Law Citation}\r\n- {Company Document Reference}\r\n- {Required Standard (Higher-of-Two Note)}\r\n- {Initial Status (Compliant \/ Partial \/ Non-Compliant \/ Assessment Pending)}\r\n\r\n### 3) Phase A \u2014 Document Examination Results\r\nFor each domain (wages, working time, discrimination, collective bargaining, plus any additional triggered areas), include:\r\n- {What the documents say} (quote or clause reference)\r\n- {Where it applies} (worker types, jurisdictions, contractor\/remote relevance)\r\n- {Control gaps} (missing definitions, enforcement steps, recordkeeping)\r\n\r\n### 4) Phase B \u2014 Gap & Risk Analysis\r\nFor each finding, include:\r\n- {Finding Title}\r\n- {Observed\/Implied Practice Risk}\r\n- {ILO Basis} [ILO \u2026]\r\n- {Local Law Basis} [Local \u2026]\r\n- {Conflict Note} (if standards differ)\r\n- {Risk Rating} (High\/Med\/Low)\r\n- {Impact Pathway} (penalties, backpay, injunctions, reputational, operational disruption)\r\n- {Root Cause Hypothesis} (policy ambiguity, training gap, vendor control weakness, etc.)\r\n\r\n### 5) Priority Matrix (Critical Issues Triage)\r\nInclude a matrix table:\r\n- {Issue}\r\n- {Risk Level}\r\n- {Required Action Window} (e.g., 0\u201330 days \/ 31\u201390 \/ 91\u2013180 \/ 180+)\r\n- {Execution Complexity}\r\n- {Owner\/Function}\r\n- {Proof of Fix}\r\n\r\n### 6) Phase C \u2014 Remediation & Control Plan\r\nNumbered list of recommendations, each with:\r\n1. {Corrective Action}\r\n2. {Legal\/Standards Citation} [ILO \u2026] [Local \u2026]\r\n3. {Implementation Steps}\r\n4. {Timeline}\r\n5. {Dependencies}\r\n6. {Monitoring Mechanism} (KPIs, audits, grievance metrics, timekeeping checks)\r\n7. {Evidence to Retain} (records, acknowledgments, logs, committee minutes, etc.)\r\n\r\n### 7) Contractor \/ Remote \/ Cross-Border Addendum (if in scope)\r\n- {Third-Party Labor Risks}\r\n- {Contract Clauses to Add or Tighten}\r\n- {Onboarding\/Training\/Monitoring Requirements}\r\n- {Jurisdictional Triggers} (permanent establishment, local registration, mandatory benefits, etc.)\r\n\r\n### 8) Appendix\r\n- {Document Index Reviewed}\r\n- {Open Questions \/ Missing Inputs}\r\n- {Assumptions Log} (only if the user authorizes assumptions)\r\n\r\n## QUALITY CHECKS\r\nBefore finalizing, verify:\r\n- All non-trivial claims are backed by at least one bracketed ILO reference and\/or provided local-law citation.\r\n- Every identified gap includes a specific corrective action, an owner, and measurable proof-of-fix.\r\n- Conflicts between ILO and local rules are explicitly flagged and the recommended standard is justified.\r\n- The priority matrix aligns with the remediation plan (no \u201corphan\u201d high-risk issues).\r\n- Any ambiguity or missing data is labeled **Assessment Pending** with clear next-request items.";
    const variables = ["[COMPANY_DOCUMENTS]","[REGIONAL_LABOR_LAWS]","[INDUSTRY_WORKFORCE_COMPOSITION]","[JURISDICTIONS]","[PRIMARY_GOAL]","[TIMEFRAME]"];
    // Initial render with highlighted variables
    document.addEventListener('DOMContentLoaded', function() {
        renderPromptWithHighlights();
    });

    // Live update prompt as user types
    document.querySelectorAll('.customize-input').forEach(input => {
        input.addEventListener('input', renderPromptWithHighlights);
    });

    function renderPromptWithHighlights() {
        const promptContent = document.getElementById('premium-prompt-content');
        if (!promptContent) return;

        let updatedPrompt = originalPrompt;
        let filledVariables = {};

        // Collect filled values
        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                filledVariables[placeholder] = value;
            }
        });

        // Replace filled variables and highlight remaining
        let htmlContent = escapeHtml(updatedPrompt);

        variables.forEach(placeholder => {
            const escapedPlaceholder = escapeHtml(placeholder);
            const regex = new RegExp(escapeRegex(escapedPlaceholder), 'g');

            if (filledVariables[placeholder]) {
                // Show filled value with green highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable-filled">' + escapeHtml(filledVariables[placeholder]) + '</span>'
                );
            } else {
                // Show original placeholder with yellow highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable">' + escapedPlaceholder + '</span>'
                );
            }
        });

        promptContent.innerHTML = htmlContent;
    }

    function escapeRegex(string) {
        return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    }

    function escapeHtml(text) {
        const div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function resetPrompt() {
        // Clear all input fields
        document.querySelectorAll('.customize-input').forEach(input => {
            input.value = '';
        });

        // Re-render with original placeholders highlighted
        renderPromptWithHighlights();

        // Visual feedback
        const resetBtns = document.querySelectorAll('.prompt-header-reset, .prompt-cta-reset');
        resetBtns.forEach(btn => {
            const originalText = btn.querySelector('span').textContent;
            btn.querySelector('span').textContent = 'Reset!';
            setTimeout(() => {
                btn.querySelector('span').textContent = originalText;
            }, 1000);
        });
    }


    function getCustomizedPrompt() {
        let updatedPrompt = originalPrompt;

        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                const regex = new RegExp(escapeRegex(placeholder), 'g');
                updatedPrompt = updatedPrompt.replace(regex, value);
            }
        });

        return updatedPrompt;
    }
</script>

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>Give a real URL and a test path, not just the homepage.</strong> If your money page is <em>/pricing</em> or <em>/checkout</em>, include that in your context so the checklist reflects the pages that matter. Try: “Audit https://example.com and prioritize issues impacting /pricing and /checkout on mobile.”</li>


<li><strong>Add business context so prioritization matches reality.</strong> Use the optional context field to say what “success” looks like (lead gen, bookings, ecommerce) and what changed recently. A helpful add-on prompt is: “Given this is a Shopify store, prioritize fixes that reduce cart abandonment and improve Core Web Vitals.”</li>


<li><strong>Ask for tool-specific verification steps.</strong> The prompt already flags what must be verified, but you can make it sharper by requesting exact checks. For example: “For every ‘verify with tools’ item, specify the exact Lighthouse metric or Search Console report to review, plus pass/fail thresholds.”</li>


<li><strong>Iterate with two passes: triage, then implementation.</strong> After the first output, ask: “Now rewrite the Critical and High items as Jira tickets with acceptance criteria, reproduction steps (if relevant), and an estimated effort (S/M/L).” You’ll get something a developer can act on immediately.</li>


<li><strong>Force tradeoffs when you’re resource-constrained.</strong> If you only have one sprint, make the model choose. Use: “Assume we have 8 developer-hours this week. Pick the top 5 actions with the best impact-to-effort ratio and explain the reasoning in one sentence each.”</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>Once your technical checklist is drafted, these prompts can help you schedule the work and keep execution from drifting.</p>



<p>If you also need a realistic plan for knocking out the “next 48 hours” items without derailing everything else, <a href="https://flowpast.com/prompts/create-a-daily-time-block-schedule-with-this-ai-prompt/">Create a Daily Time-Block Schedule with this AI Prompt</a> is a clean companion. It’s especially useful when the audit produces cross-functional tasks (dev fixes, content tweaks, QA checks) and you want a day-by-day layout.</p>



<p>For teams doing recurring site maintenance, <a href="https://flowpast.com/prompts/build-a-daily-time-blocked-schedule-with-this-ai-prompt/">Build a Daily Time-Blocked Schedule with this AI Prompt</a> helps you turn “we should monitor this weekly” into an actual routine. Pair it with your audit by time-blocking ongoing verification like Lighthouse retests, broken-link scans, and accessibility spot checks.</p>



<p>When you’re planning a full remediation sprint (or a week of cleanup before a launch), <a href="https://flowpast.com/prompts/build-a-7-day-time-blocking-template-ai-prompt/">Build a 7-Day Time-Blocking Template AI Prompt</a> is the simplest way to map tasks to specific days. It pairs well with the severity ratings from the audit, so Critical items land early and QA is not an afterthought.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/create-a-daily-time-block-schedule-with-this-ai-prompt/">Create a Daily Time-Block Schedule with this AI Prompt</a>: Plan your day around top fixes.</li>


<li><a href="https://flowpast.com/prompts/build-a-daily-time-blocked-schedule-with-this-ai-prompt/">Build a Daily Time-Blocked Schedule with this AI Prompt</a>: Turn maintenance into a daily routine.</li>


<li><a href="https://flowpast.com/prompts/build-a-7-day-time-blocking-template-ai-prompt/">Build a 7-Day Time-Blocking Template AI Prompt</a>: Schedule a one-week remediation sprint.</li>

<li><a href="https://flowpast.com/prompts/build-a-student-stress-reduction-plan-with-this-ai-prompt/">Build a Student Stress Reduction Plan with this AI Prompt</a>: Reduce overload while juggling deadlines.</li>


<li><a href="https://flowpast.com/prompts/build-a-student-risk-early-warning-system-ai-prompt/">Build a Student Risk Early-Warning System AI Prompt</a>: Flag risks before they become emergencies.</li>

</ul>
<!-- /wp:post-content -->
</div>

<div class="faq-section">
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading">Common Questions</h2>
<!-- /wp:heading -->

<div class="faq-item">
<span class="question">Which roles benefit most from this technical audit checklist AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>Marketing Managers</strong> use this to translate “the site feels slow” into a prioritized list a developer can implement before paid campaigns and launches. <strong>Technical SEO Specialists</strong> lean on it to structure audits around Core Web Vitals, mobile behavior, HTTPS, and crawl/index hygiene without missing basics. <strong>Freelance Web Developers</strong> use the checkbox format to scope work, estimate effort, and avoid vague requests like “make it faster.” <strong>Agency Consultants</strong> apply it when they need a credible, impact-ranked audit deliverable they can review with a client in one call.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this technical audit checklist AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>E-commerce brands</strong> get value because speed, mobile UX, and HTTPS trust signals directly affect add-to-cart and checkout completion; the “next 48 hours” list is perfect before a promotion. <strong>SaaS companies</strong> use it to tighten landing page performance and mobile responsiveness for demo requests and trial signups, where small delays can cut conversion rates. <strong>Professional services firms</strong> (law, accounting, clinics) benefit from accessibility and mobile checks that reduce friction for lead forms and appointment requests, especially on local-intent traffic. <strong>Publishers and content sites</strong> use it to improve load speed, reduce layout shift, and protect ad/analytics performance without breaking core templates.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for running a website technical audit checklist produce weak results?</span>
<!-- wp:paragraph -->
<p class="answer">A typical prompt like “<em>Write me a technical SEO audit for my website</em>” fails because it: lacks a required scope (speed, mobile, HTTPS/security, accessibility, and health) so the output is random, provides no checkbox structure that you can execute, ignores severity/impact ranking so teams don’t know what to fix first, produces generic advice (“compress images”) instead of concrete checks and fixes (“convert hero JPG to AVIF; set long-cache headers for /assets/*”), and skips tool-verification guidance when the model can’t test the site live. This prompt forces a process: restated goal, categorized findings, prioritized actions, and a short punch list to start immediately.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Can I customize this technical audit checklist prompt for my specific situation?</span>
<!-- wp:paragraph -->
<p class="answer">Yes. The easiest way is to be specific with the input fields: use a precise <strong>[WEBSITE_URL]</strong> (include the exact path you care about), and use <strong>[CONTEXT]</strong> to describe your stack (WordPress, Shopify, Webflow), recent changes, and what “primary goal” means (leads, checkout, bookings). After you get the first checklist, run a follow-up like: “Rewrite only the Critical/High items for a WordPress site using Cloudflare, and include exact plugin/config suggestions.” If the site is behind login or blocks scanning, tell the model what it can assume and what you can provide (screenshots, Lighthouse reports, server headers).</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this technical audit checklist prompt?</span>
<!-- wp:paragraph -->
<p class="answer">The biggest mistake is leaving <strong>[WEBSITE_URL]</strong> too vague — instead of “my site,” use “https://example.com/pricing” or “https://example.com/checkout” so the audit targets high-impact pages. Another common error is skipping <strong>[CONTEXT]</strong>; “WordPress site” is thin, while “WordPress + Elementor, WooCommerce, Cloudflare, added a chat widget last week” leads to much more actionable fixes. People also forget to state the <strong>primary goal</strong>, which changes prioritization (e.g., lead form reliability vs. product page speed). Finally, some users treat the output as a legal accessibility certification; the prompt is a practical WCAG-oriented checklist, not a compliance opinion.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Who should NOT use this technical audit checklist prompt?</span>
<!-- wp:paragraph -->
<p class="answer">This prompt isn’t ideal for penetration testing, legal compliance certification, or deep application security reviews, because it explicitly avoids those scopes. It’s also a poor fit if you need a full code rewrite plan or a complete UX/brand redesign; you’ll get engineering-focused remediation steps, not a creative replatform strategy. If you’re not ready to act on findings (no dev access, no budget, no sprint time), run a smaller diagnostic first using PageSpeed Insights and pick one bottleneck to fix.</p>
<!-- /wp:paragraph -->
</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this technical audit checklist AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Marketing Managers use this to translate “the site feels slow” into a prioritized list a developer can implement before paid campaigns and launches. Technical SEO Specialists lean on it to structure audits around Core Web Vitals, mobile behavior, HTTPS, and crawl/index hygiene without missing basics. Freelance Web Developers use the checkbox format to scope work, estimate effort, and avoid vague requests like “make it faster.” Agency Consultants apply it when they need a credible, impact-ranked audit deliverable they can review with a client in one call."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this technical audit checklist AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "E-commerce brands get value because speed, mobile UX, and HTTPS trust signals directly affect add-to-cart and checkout completion; the “next 48 hours” list is perfect before a promotion. SaaS companies use it to tighten landing page performance and mobile responsiveness for demo requests and trial signups, where small delays can cut conversion rates. Professional services firms (law, accounting, clinics) benefit from accessibility and mobile checks that reduce friction for lead forms and appointment requests, especially on local-intent traffic. Publishers and content sites use it to improve load speed, reduce layout shift, and protect ad/analytics performance without breaking core templates."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for running a website technical audit checklist produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like “Write me a technical SEO audit for my website” fails because it: lacks a required scope (speed, mobile, HTTPS/security, accessibility, and health) so the output is random, provides no checkbox structure that you can execute, ignores severity/impact ranking so teams don’t know what to fix first, produces generic advice (“compress images”) instead of concrete checks and fixes (“convert hero JPG to AVIF; set long-cache headers for /assets/*”), and skips tool-verification guidance when the model can’t test the site live. This prompt forces a process: restated goal, categorized findings, prioritized actions, and a short punch list to start immediately."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this technical audit checklist prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. The easiest way is to be specific with the input fields: use a precise [WEBSITE_URL] (include the exact path you care about), and use [CONTEXT] to describe your stack (WordPress, Shopify, Webflow), recent changes, and what “primary goal” means (leads, checkout, bookings). After you get the first checklist, run a follow-up like: “Rewrite only the Critical/High items for a WordPress site using Cloudflare, and include exact plugin/config suggestions.” If the site is behind login or blocks scanning, tell the model what it can assume and what you can provide (screenshots, Lighthouse reports, server headers)."
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this technical audit checklist prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving [WEBSITE_URL] too vague — instead of “my site,” use “https://example.com/pricing” or “https://example.com/checkout” so the audit targets high-impact pages. Another common error is skipping [CONTEXT]; “WordPress site” is thin, while “WordPress + Elementor, WooCommerce, Cloudflare, added a chat widget last week” leads to much more actionable fixes. People also forget to state the primary goal, which changes prioritization (e.g., lead form reliability vs. product page speed). Finally, some users treat the output as a legal accessibility certification; the prompt is a practical WCAG-oriented checklist, not a compliance opinion."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this technical audit checklist prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for penetration testing, legal compliance certification, or deep application security reviews, because it explicitly avoids those scopes. It’s also a poor fit if you need a full code rewrite plan or a complete UX/brand redesign; you’ll get engineering-focused remediation steps, not a creative replatform strategy. If you’re not ready to act on findings (no dev access, no budget, no sprint time), run a smaller diagnostic first using PageSpeed Insights and pick one bottleneck to fix."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">
<!-- wp:paragraph -->
<p>Technical issues don’t announce themselves. They just chip away at rankings, trust, and conversion rate. Paste this prompt into your AI tool, run the checklist, and start with the “next 48 hours” items while momentum is high.</p>
<!-- /wp:paragraph -->
</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5002243.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Build WCAG Light Dark Theme Specs AI Prompt</title>
		<link>https://flowpast.com/prompts/build-wcag-light-dark-theme-specs-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:40:50 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5001432</guid>

					<description><![CDATA[Theme contrast keeps failing - a proven AI Prompt that maps WCAG light dark tokens, focus rings, motion rules, and testing steps. Access our full AI prompt library for every model.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: light dark theme specs -->
<div class="hook-introduction">

<p>Dark mode looks “done” until QA turns on a contrast checker and everything fails. Links disappear, focus rings are invisible, and the hover states you loved become unreadable in real-world lighting. Then you’re stuck debating hex codes instead of shipping.</p>



<p>This <strong>light dark theme specs</strong> is built for <strong>frontend engineers</strong> who need a repeatable, WCAG-aligned theming approach that won’t crumble during accessibility review, <strong>product designers</strong> who must adapt a brand palette without “just inverting colors,” and <strong>UX leads</strong> cleaning up inconsistent focus, motion, and interaction rules across components. The output is a practical implementation spec: token mapping for light/dark, contrast targets, focus ring rules, motion behavior, fallback strategy, plus an audit-and-validation checklist you can hand to your team.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It defines WCAG 2.1 contrast targets for text, large text, and interactive focus indicators across light and dark themes.</li>
          <li>It translates an existing brand palette into theme-safe design tokens (including a near-black dark background instead of pure #000000).</li>
          <li>It specifies focus ring behavior and interaction states so keyboard users can always see where they are (with a 3:1 contrast requirement against adjacent colors).</li>
          <li>It designs theme-switching behavior that respects <code>prefers-reduced-motion</code> and avoids flashy transitions that trigger motion sensitivity.</li>
          <li>It lays out a defensive engineering plan: OS-level preference support, optional in-app override, and graceful fallback when CSS custom properties aren’t available.</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>Your team keeps “fixing dark mode” late in the cycle because contrast failures only show up in QA or after launch.</li>
          <li>You’re migrating to tokens or a design system and need a consistent light/dark rule set before components proliferate.</li>
          <li>You have to satisfy an accessibility audit and want more than a one-off contrast calculator screenshot.</li>
          <li>A competitor’s UI feels more readable and polished at night, and your current dark theme looks muddy or low-contrast.</li>
          <li>You’re scaling the product to more screens and states, and ad-hoc theming decisions are slowing PR reviews and creating regressions.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A two-theme token map (core + semantic tokens) with explicit contrast targets and notes on where to be stricter than the minimum.</li>
           <li>A focus indicator spec covering thickness, offset, and color rules, with contrast checks against adjacent surfaces.</li>
           <li>A motion and theme-switching rule set, including a reduced-motion variant and recommended transition constraints.</li>
           <li>A compatibility plan that includes OS preference handling, an optional app-level override, and a fallback approach for non-supporting environments.</li>
           <li>A validation workflow checklist using real accessibility tooling (not only math), plus a short audit template your team can reuse per release.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: WCAG Light/Dark Theme Implementation Spec</h2>



<div class="prompt-viewer-wrapper" id="prompt-section">
    <div class="prompt-comparison-row prompt-premium">
        <!-- Header with buttons -->
        <div class="prompt-row-header">
            <!-- <span class="prompt-row-icon">✨</span> -->
            <span class="prompt-row-title">
                                    Step 1: Customize the prompt with your input
                            </span>
            <div class="prompt-header-buttons">
                                    <button class="prompt-header-btn prompt-header-reset" onclick="resetPrompt()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                                <button class="prompt-header-btn prompt-header-copy-green flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span>Customize and Copy Full Prompt</span>
                </button>
            </div>
        </div>

        <!-- Customize the Prompt Section -->
                    <div class="prompt-customize-section">
                <span class="customize-title">Customize the Prompt</span>
                <p class="customize-subtitle">Fill in the fields below to personalize this prompt for your needs.</p>
                <table class="customize-table">
                    <thead>
                        <tr>
                            <th>Variable</th>
                            <th>What to Enter</th>
                            <th>Customise the prompt</th>
                        </tr>
                    </thead>
                    <tbody>
                                                    <tr>
                                <td class="var-name"><code>[BRAND_COLOR_PALETTE]</code></td>
                                <td class="var-desc">
                                    Provide the list of colors used in the brand&#039;s visual identity, including hex codes, RGB values, or other formats, along with their intended usage (e.g., primary, secondary, accent).                                    <div class="var-example">For example: "Primary: #1A73E8 (blue), Secondary: #E37400 (orange), Accent: #F4B400 (yellow), Background: #FFFFFF (white), Text: #202124 (black)."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[BRAND_COLOR_PALETTE]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[TARGET_BROWSERS]</code></td>
                                <td class="var-desc">
                                    List the browsers and their versions that the implementation must support, including desktop and mobile environments as applicable.                                    <div class="var-example">For example: "Chrome 112+, Firefox 110+, Safari 16+, Edge 112+, mobile versions of Chrome and Safari."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[TARGET_BROWSERS]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[EXISTING_CSS_FRAMEWORK]</code></td>
                                <td class="var-desc">
                                    Specify the CSS framework or methodology currently used in the project, including any customizations or relevant configuration details.                                    <div class="var-example">For example: "Tailwind CSS with custom theme extensions for brand colors and typography."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[EXISTING_CSS_FRAMEWORK]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[USER_DEMOGRAPHICS]</code></td>
                                <td class="var-desc">
                                    Describe the primary users of the app, including characteristics like age range, accessibility needs, device preferences, and geographic location.                                    <div class="var-example">For example: "Users aged 25-45 with varying visual impairments, primarily accessing the app on mobile devices in North America and Europe."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[USER_DEMOGRAPHICS]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                                    <tr>
                                <td class="var-name"><code>[SYSTEM_PREFERENCE_MODE]</code></td>
                                <td class="var-desc">
                                    Indicate whether the implementation should respect the user&#039;s OS-level theme preference (light/dark mode) and whether an in-app override is needed.                                    <div class="var-example">For example: "Respect OS-level light/dark mode preference, with an optional in-app override toggle for user customization."</div>
                                </td>
                                <td class="var-input">
                                                                            <textarea
                                            class="customize-input"
                                            data-placeholder="[SYSTEM_PREFERENCE_MODE]"
                                            placeholder="Enter your value here..."
                                            rows="3"></textarea>
                                                                    </td>
                            </tr>
                                            </tbody>
                </table>

                <button class="copy-customized-btn flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                        <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                    </svg>
                    <span class="copy-customized-text">Customise the prompt now</span>
                </button>
            </div>
        
        <!-- Full Prompt Code Header -->
                    <div class="prompt-code-header">
                <span class="prompt-code-title">
                    Step 2: Copy the Prompt
                </span>
                <div class="prompt-code-buttons">
                    <!-- Reset: Only visible when unlocked -->
                    <button class="prompt-header-btn prompt-header-reset btn-when-unlocked" onclick="resetPrompt()" style="display: none;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
                            <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
                        </svg>
                        <span>Reset</span>
                    </button>
                    <!-- Copy Full Prompt -->
                    <button class="prompt-header-btn prompt-header-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                            <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                            <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
                        </svg>
                        <span>Copy Full Prompt</span>
                    </button>
                </div>
            </div>
        

        <!-- Prompt Content -->
        <div class="prompt-box prompt-gated-wrapper">
            <!-- Gated: Blurred content -->
            <div class="prompt-gated-content">
                <div class="prompt-header-visible">OBJECTIVE</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PERSONA</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">CONSTRAINTS</div><div class="prompt-header-visible subheader">Accessibility and usability requirements</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Compatibility requirements</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">Scope boundaries (What This Is NOT)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">PROCESS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div><div class="locked-line" style="width: 95%;"></div><div class="locked-line" style="width: 70%;"></div><div class="locked-line" style="width: 83%;"></div><div class="locked-line" style="width: 85%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">INPUTS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">OUTPUT SPECIFICATION</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">1) Accessibility Audit Framework</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">2) Phased Build Plan (A–E)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">3) Color Mapping Table (Mandatory)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">4) Testing Checklist (Tools + Steps)</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible subheader">5) Troubleshooting Playbook</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div><div class="locked-line" style="width: 80%;"></div></div></div><div class="locked-section-icon">🔒</div></div><div class="prompt-header-visible">QUALITY CHECKS</div><div class="locked-section"><div class="locked-section-bg"><div class="locked-section-lines"><div class="locked-line" style="width: 85%;"></div><div class="locked-line" style="width: 78%;"></div><div class="locked-line" style="width: 92%;"></div><div class="locked-line" style="width: 75%;"></div><div class="locked-line" style="width: 88%;"></div><div class="locked-line" style="width: 72%;"></div></div></div><div class="locked-section-icon">🔒</div></div>            </div>
            <!-- Unlocked: Full content (hidden by default) -->
            <div class="prompt-content-full" id="premium-prompt-content" style="display: none;">
                ## OBJECTIVE
Design and document an accessibility-led light/dark theme implementation for a frontend app that:
- Meets WCAG 2.1 contrast and interaction requirements in both themes
- Honors OS-level theme choice and (optionally) an in-app override
- Aligns with an existing brand palette and current styling stack
- Avoids past dark-mode readability failures through a repeatable audit + validation workflow

## PERSONA
Act as an accessibility-first frontend architect with a background in UX. You rely on rigorous contrast math, practical user testing, and defensive engineering. Your writing should be candid, implementation-focused, and protective of users with low vision and motion sensitivity.

## CONSTRAINTS
### Accessibility and usability requirements
- Ensure minimum contrast ratios:
  - Body/normal text: 4.5:1 or higher (both themes)
  - Large text (18pt+ or 14pt+ bold): 3:1 or higher
- Visible focus indicators for interactive elements must reach 3:1 contrast against adjacent colors.
- Theme switching animations must respect `prefers-reduced-motion`.
- Do not use pure black backgrounds in dark theme (avoid `#000000`); pick near-black alternatives to reduce glare.
- Validate using real accessibility tooling (not only a contrast calculator).

### Compatibility requirements
- Include a graceful fallback for environments that do not support CSS custom properties.
- Use a theme approach that can integrate with the existing styling method/framework.

### Scope boundaries (What This Is NOT)
- Not a full product rebrand or visual identity redesign.
- Not a replacement for legal counsel; it is an engineering implementation aligned with WCAG 2.1 guidance.
- Not a generic “invert colors” approach; brand colors must be adapted and verified.

## PROCESS
1. **Pre-analysis confirmation (must do this first):** Briefly restate what you’re going to build, list the key constraints you will enforce, and call out any missing inputs you need.
2. **Audit-first foundation:** Provide an accessibility audit framework that treats WCAG 2.1 compliance as the baseline for all decisions.
3. **Phased implementation plan (deliver in the phases below):**
   - Phase A: Theme token architecture using CSS variables (and fallback strategy)
   - Phase B: Contrast verification for typography across sizes/weights
   - Phase C: Theme toggle with persistence (localStorage) and safe defaults
   - Phase D: Mode transitions that respect motion preferences
   - Phase E: OS preference support with `prefers-color-scheme` (plus user override if requested)
4. **Brand palette adaptation:** Explain why direct inversion fails and describe how to adjust luminance/saturation to preserve brand character while meeting ratios. Include the numeric relationship: relative luminance → contrast ratio, and how that influences color selection.
5. **Validation &amp; iteration:** Provide repeatable testing steps (automated + manual + assistive tech checks).
6. **Edge-case handling:** If any input is missing/ambiguous, make minimal safe assumptions, clearly label them, and provide 1–2 alternative paths. If critical inputs are absent, ask targeted questions before finalizing code.

## INPUTS
- **Brand color palette:** [BRAND_COLOR_PALETTE]
- **Browser support requirements:** [TARGET_BROWSERS]
- **Current styling approach/framework:** [EXISTING_CSS_FRAMEWORK]
- **User base + accessibility considerations:** [USER_DEMOGRAPHICS]
- **Theme preference behavior:** [SYSTEM_PREFERENCE_MODE]

## OUTPUT SPECIFICATION
Deliver a single cohesive implementation guide with these sections (use markdown headings), and include code blocks with inline comments explaining accessibility choices.

### 1) Accessibility Audit Framework
Include:
- {Audit Steps} mapping to WCAG 2.1-relevant checks for color/contrast, focus visibility, motion, and theme switching behavior
- {Common Failure Patterns} specific to dark themes

### 2) Phased Build Plan (A–E)
For each phase, provide:
- {Goal}
- {Implementation Code} (HTML/CSS/JS as needed)
- {Testing Procedure} (what to check, how to measure it)
- {Fallback Strategy} (including non–CSS-variable environments where applicable)

### 3) Color Mapping Table (Mandatory)
Provide a table with columns:
- {Token Name}
- {Light Theme Color}
- {Dark Theme Color}
- {Usage Notes}
- {Contrast Pairs Tested}
- {Contrast Ratio Results}

### 4) Testing Checklist (Tools + Steps)
Include:
- Specific tool names and what each verifies (contrast, focus order, computed styles, automated scans)
- {Manual Test Script} for keyboard-only, reduced-motion, and low-vision readability review
- {Definition Of Done} that gates release

### 5) Troubleshooting Playbook
List common dark-mode defects and fixes, such as:
- Washed-out text, “halation” on near-black, invisible focus rings, link states blending into body text, disabled-state ambiguity, and theme flash on load
For each, provide:
- {Symptom}
- {Likely Cause}
- {Fix}
- {How To Re-test}

## QUALITY CHECKS
Before finishing, verify and explicitly confirm:
- Contrast thresholds met for normal and large text in both themes (with ratios shown).
- Focus indicators reach 3:1 against adjacent colors and are consistently visible.
- `prefers-reduced-motion` is respected (transitions disabled or minimized appropriately).
- Theme selection works with {SYSTEM_PREFERENCE_MODE} and persists without causing a flash of incorrect theme.
- A usable fallback exists when CSS custom properties aren’t available (and the limitations are stated).            </div>
        </div>


    </div>

    <!-- CTA Row - Full width buttons -->
    <div class="prompt-cta-row">
        <button class="prompt-cta-btn prompt-cta-copy flowpast-copy-prompt-btn" onclick="handlePromptCopy()">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
                <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" />
                <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" />
            </svg>
            <span class="cta-copy-text">Copy Full Prompt</span>
        </button>
    </div>
</div>

<style>
    /* Gated prompt states */
    .prompt-gated-wrapper {
        position: relative;
    }

    /* When unlocked - show full content, hide gated */
    body.flowpast-unlocked .prompt-gated-wrapper .prompt-gated-content {
        display: none;
    }

    body.flowpast-unlocked .prompt-gated-wrapper .prompt-content-full {
        display: block !important;
    }

    /* Show/hide elements based on unlock state */
    body.flowpast-unlocked .btn-when-unlocked {
        display: inline-flex !important;
    }

    .prompt-viewer-wrapper {
        scroll-margin-top: 250px;
    }

    /* ========================================
   PROMPT VIEWER - MAIN WRAPPER
   ======================================== */
    .prompt-viewer-wrapper {
        margin: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ========================================
   PROMPT BOX CONTAINER
   ======================================== */
    .prompt-comparison-row {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    /* ========================================
   HEADER WITH BUTTONS
   ======================================== */
    .prompt-row-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .prompt-row-icon {
        font-size: 20px;
    }

    .prompt-row-title {
        font-weight: 600;
        font-size: 22px;
        color: #fff !important;
        text-decoration: underline
    }

    .prompt-header-buttons {
        margin-left: auto;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Header buttons */
    .prompt-header-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-header-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-header-copy:hover {
        background: #2a2a2a;
    }

    .prompt-header-copy.copied {
        background: #2e7d32;
    }

    .prompt-header-copy-green {
        background: #04AA6D !important;
        color: #fff !important;
    }

    .prompt-header-copy-green:hover {
        background: #039860 !important;
    }

    .prompt-header-copy-green.copied {
        background: #2e7d32 !important;
    }

    .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-header-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-1px);
    }

    /* ========================================
   PROMPT CONTENT - FULL (NO SCROLL)
   ======================================== */
    .prompt-box {
        background: #ffffff;
    }

    .prompt-content-full {
        padding: 24px;
        margin: 0;
        color: #202124;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.7;
        white-space: pre-wrap;
        word-wrap: break-word;
        /* No scroll - show full content */
        max-height: none;
        overflow: visible;
    }

    /* Highlighted variable in prompt */
    .prompt-variable {
        background: #fff3cd;
        color: #1967d2;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ffc107;
    }

    .prompt-variable-filled {
        background: #d4edda;
        color: #155724;
        font-weight: 700;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #28a745;
    }

    /* ========================================
   GATED CONTENT (NO ACCESS)
   ======================================== */
    .prompt-gated-content {
        padding: 24px;
        background: #ffffff;
        font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
        font-size: 13px;
        line-height: 1.8;
        max-height: none;
        overflow: visible;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        cursor: default;
    }

    /* ## headers - larger, black */
    .prompt-header-visible {
        color: #202124;
        font-weight: 600;
        margin: 5px 0 0px 0;
        font-size: 20px;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* ### headers - smaller, black */
    .prompt-header-visible.subheader {
        color: #202124;
        font-weight: 600;
        margin: 5px 0;
        font-size: 18px;
    }

    .prompt-header-visible:first-child {
        margin-top: 0;
    }

    /* ========================================
   LOCKED SECTION BLOCK
   ======================================== */
    .locked-section {
        position: relative;
        margin: 4px 0 8px 0;
        border-radius: 6px;
        overflow: hidden;
        background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .locked-section-bg {
        position: relative;
    }

    .locked-section-lines {
        padding: 8px 12px;
        position: relative;
    }

    .locked-line {
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 3px;
        margin-bottom: 4px;
        margin-left: 12px;
    }

    .locked-line:last-child {
        margin-bottom: 0;
    }

    .locked-section-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        font-size: 24px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }

    /* Subheader locked sections - slightly indented */
    /*  .prompt-header-visible.subheader+.locked-section {
        margin-left: 16px;
    } */

    /* ========================================
   COMPATIBILITY BADGES
   ======================================== */
    .prompt-compatibility {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
    }

    .compat-label {
        font-size: 13px;
        color: #5f6368;
        font-weight: 500;
    }

    .compat-badge {
        padding: 4px 10px;
        background: #e8f0fe;
        color: #1967d2;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }

    /* ========================================
   CTA ROW - FULL WIDTH BUTTONS
   ======================================== */
    .prompt-cta-row {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }

    .prompt-cta-btn {
        flex: 1;
        min-width: 200px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 24px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        border: none;
    }

    .prompt-cta-copy {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-copy:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-copy.copied {
        background: #2e7d32;
    }

    .prompt-cta-reset {
        background: #3a3a3a;
        color: #fff;
    }

    .prompt-cta-reset:hover {
        background: #2a2a2a;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .prompt-cta-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
    }

    .prompt-cta-access:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    /* ========================================
    CUSTOMIZE YOUR PROMPT SECTION
    ======================================== */
    .prompt-customize-section {
        padding: 24px;
        border-bottom: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .customize-title {
        margin: 0 0 8px 0;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
    }

    .customize-subtitle {
        margin: 0 0 20px 0;
        font-size: 14px;
        color: #5f6368;
    }

    .customize-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .customize-table th {
        text-align: left;
        padding: 12px;
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        font-size: 13px;
        font-weight: 600;
        color: #202124;
    }

    .customize-table td {
        padding: 12px;
        border: 1px solid #e0e0e0;
        vertical-align: top;
    }

    .customize-table .var-name {
        width: 25%;
        background: #f8f9fa;
    }

    .customize-table .var-name code {
        background: #fff3cd;
        color: #1967d2;
        border: 1px solid #ffc107;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        word-break: break-all;
        font-weight: 600;
    }

    .customize-table .var-desc {
        width: 35%;
        font-size: 13px;
        color: #5f6368;
        line-height: 1.5;
    }

    .customize-table .var-example {
        margin-top: 8px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #dadce0;
        font-size: 12px;
        color: #5f6368;
        font-style: italic;
        border-radius: 0 4px 4px 0;
    }

    .customize-table .var-input {
        width: 40%;
    }

    .customize-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #dadce0;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .customize-input:focus {
        outline: none;
        border-color: rgb(5, 152, 98);
        box-shadow: 0 0 0 3px rgba(5, 152, 98, 0.1);
    }

    .customize-input::placeholder {
        color: #9aa0a6;
        font-style: italic;
    }

    .copy-customized-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: rgb(5, 152, 98);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .copy-customized-btn:hover {
        background: rgb(4, 130, 83);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(5, 152, 98, 0.3);
    }

    .copy-customized-btn.copied {
        background: #2e7d32;
    }

    /* ========================================
    FULL PROMPT CODE HEADER
    ======================================== */
    .prompt-code-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        color: #fff !important;
        background: #141414;
        border-bottom: 1px solid #e0e0e0;
    }

    .prompt-code-title {
        font-size: 22px;
        font-weight: 600;
        text-decoration: underline;

    }

    .prompt-code-buttons {
        display: flex;
        gap: 8px;
    }

    .prompt-code-buttons .prompt-header-btn {
        padding: 8px 14px;
        font-size: 13px;
        background: #ffffff;
        color: #202124;
        border: 1px solid #dadce0;
    }

    .prompt-code-buttons .prompt-header-access {
        background: rgb(5, 152, 98);
        color: #fff !important;
        border-color: rgb(5, 152, 98);
    }

    .prompt-code-buttons .prompt-header-btn.prompt-header-access:hover {
        background: rgb(4, 130, 83) !important;
        border-color: rgb(4, 130, 83);
        color: #fff !important;
    }

    .prompt-code-buttons .prompt-header-btn:hover {
        background: #f1f3f4;
    }

    .prompt-code-buttons .prompt-header-copy.copied {
        background: #d4edda;
        color: #155724;
        border-color: #28a745;
    }

    .prompt-header-reset {
        background: #ffffff;
        color: #202124;
    }

    /* ========================================
   RESPONSIVE
   ======================================== */
    @media (max-width: 768px) {
        .prompt-row-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }

        .prompt-header-buttons {
            margin-left: 0;
            width: 100%;
        }

        .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }

        .prompt-cta-row {
            flex-direction: column;
        }

        .prompt-cta-btn {
            width: 100%;
        }

        /* Customize table responsive */
        .customize-table,
        .customize-table thead,
        .customize-table tbody,
        .customize-table tr,
        .customize-table th,
        .customize-table td {
            display: block;
        }

        .customize-table thead {
            display: none;
        }

        .customize-table tr {
            margin-bottom: 16px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
        }

        .customize-table td {
            width: 100% !important;
            border: none;
            border-bottom: 1px solid #e0e0e0;
        }

        .customize-table td:last-child {
            border-bottom: none;
        }

        .customize-table .var-name {
            background: #f1f3f4;
            font-weight: 600;
        }

        .prompt-code-header {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }

        .prompt-code-buttons {
            width: 100%;
        }

        .prompt-code-buttons .prompt-header-btn {
            flex: 1;
            justify-content: center;
        }
    }
</style>

<script>
    function handlePromptCopy() {
        // Check if unlocked via cookie
        if (typeof window.flowpastIsUnlocked === 'function' && !window.flowpastIsUnlocked()) {
            // Show email popup
            if (typeof window.flowpastShowEmailPopup === 'function') {
                window.flowpastShowEmailPopup('prompt');
            }
            return;
        }

        // Copy the customized prompt (with filled variables)
        const customizedPrompt = getCustomizedPrompt();
        const copyButtons = document.querySelectorAll('.prompt-header-copy, .prompt-header-copy-green, .prompt-cta-copy, .copy-customized-btn');

        navigator.clipboard.writeText(customizedPrompt).then(() => {
            copyButtons.forEach(btn => {
                btn.classList.add('copied');
                const textSpan = btn.querySelector('span');
                if (textSpan) textSpan.textContent = 'Copied!';
            });

            setTimeout(() => {
                copyButtons.forEach(btn => {
                    btn.classList.remove('copied');
                    const textSpan = btn.querySelector('span');
                    if (textSpan) textSpan.textContent = 'Copy Full Prompt';
                });
            }, 2000);
        }).catch(err => {
            console.error('Failed to copy:', err);
        });
    }

    // Store original prompt for customization
    const originalPrompt = "## OBJECTIVE\r\nDesign and document an accessibility-led light\/dark theme implementation for a frontend app that:\r\n- Meets WCAG 2.1 contrast and interaction requirements in both themes\r\n- Honors OS-level theme choice and (optionally) an in-app override\r\n- Aligns with an existing brand palette and current styling stack\r\n- Avoids past dark-mode readability failures through a repeatable audit + validation workflow\r\n\r\n## PERSONA\r\nAct as an accessibility-first frontend architect with a background in UX. You rely on rigorous contrast math, practical user testing, and defensive engineering. Your writing should be candid, implementation-focused, and protective of users with low vision and motion sensitivity.\r\n\r\n## CONSTRAINTS\r\n### Accessibility and usability requirements\r\n- Ensure minimum contrast ratios:\r\n  - Body\/normal text: 4.5:1 or higher (both themes)\r\n  - Large text (18pt+ or 14pt+ bold): 3:1 or higher\r\n- Visible focus indicators for interactive elements must reach 3:1 contrast against adjacent colors.\r\n- Theme switching animations must respect `prefers-reduced-motion`.\r\n- Do not use pure black backgrounds in dark theme (avoid `#000000`); pick near-black alternatives to reduce glare.\r\n- Validate using real accessibility tooling (not only a contrast calculator).\r\n\r\n### Compatibility requirements\r\n- Include a graceful fallback for environments that do not support CSS custom properties.\r\n- Use a theme approach that can integrate with the existing styling method\/framework.\r\n\r\n### Scope boundaries (What This Is NOT)\r\n- Not a full product rebrand or visual identity redesign.\r\n- Not a replacement for legal counsel; it is an engineering implementation aligned with WCAG 2.1 guidance.\r\n- Not a generic \u201cinvert colors\u201d approach; brand colors must be adapted and verified.\r\n\r\n## PROCESS\r\n1. **Pre-analysis confirmation (must do this first):** Briefly restate what you\u2019re going to build, list the key constraints you will enforce, and call out any missing inputs you need.\r\n2. **Audit-first foundation:** Provide an accessibility audit framework that treats WCAG 2.1 compliance as the baseline for all decisions.\r\n3. **Phased implementation plan (deliver in the phases below):**\r\n   - Phase A: Theme token architecture using CSS variables (and fallback strategy)\r\n   - Phase B: Contrast verification for typography across sizes\/weights\r\n   - Phase C: Theme toggle with persistence (localStorage) and safe defaults\r\n   - Phase D: Mode transitions that respect motion preferences\r\n   - Phase E: OS preference support with `prefers-color-scheme` (plus user override if requested)\r\n4. **Brand palette adaptation:** Explain why direct inversion fails and describe how to adjust luminance\/saturation to preserve brand character while meeting ratios. Include the numeric relationship: relative luminance \u2192 contrast ratio, and how that influences color selection.\r\n5. **Validation & iteration:** Provide repeatable testing steps (automated + manual + assistive tech checks).\r\n6. **Edge-case handling:** If any input is missing\/ambiguous, make minimal safe assumptions, clearly label them, and provide 1\u20132 alternative paths. If critical inputs are absent, ask targeted questions before finalizing code.\r\n\r\n## INPUTS\r\n- **Brand color palette:** [BRAND_COLOR_PALETTE]\r\n- **Browser support requirements:** [TARGET_BROWSERS]\r\n- **Current styling approach\/framework:** [EXISTING_CSS_FRAMEWORK]\r\n- **User base + accessibility considerations:** [USER_DEMOGRAPHICS]\r\n- **Theme preference behavior:** [SYSTEM_PREFERENCE_MODE]\r\n\r\n## OUTPUT SPECIFICATION\r\nDeliver a single cohesive implementation guide with these sections (use markdown headings), and include code blocks with inline comments explaining accessibility choices.\r\n\r\n### 1) Accessibility Audit Framework\r\nInclude:\r\n- {Audit Steps} mapping to WCAG 2.1-relevant checks for color\/contrast, focus visibility, motion, and theme switching behavior\r\n- {Common Failure Patterns} specific to dark themes\r\n\r\n### 2) Phased Build Plan (A\u2013E)\r\nFor each phase, provide:\r\n- {Goal}\r\n- {Implementation Code} (HTML\/CSS\/JS as needed)\r\n- {Testing Procedure} (what to check, how to measure it)\r\n- {Fallback Strategy} (including non\u2013CSS-variable environments where applicable)\r\n\r\n### 3) Color Mapping Table (Mandatory)\r\nProvide a table with columns:\r\n- {Token Name}\r\n- {Light Theme Color}\r\n- {Dark Theme Color}\r\n- {Usage Notes}\r\n- {Contrast Pairs Tested}\r\n- {Contrast Ratio Results}\r\n\r\n### 4) Testing Checklist (Tools + Steps)\r\nInclude:\r\n- Specific tool names and what each verifies (contrast, focus order, computed styles, automated scans)\r\n- {Manual Test Script} for keyboard-only, reduced-motion, and low-vision readability review\r\n- {Definition Of Done} that gates release\r\n\r\n### 5) Troubleshooting Playbook\r\nList common dark-mode defects and fixes, such as:\r\n- Washed-out text, \u201chalation\u201d on near-black, invisible focus rings, link states blending into body text, disabled-state ambiguity, and theme flash on load\r\nFor each, provide:\r\n- {Symptom}\r\n- {Likely Cause}\r\n- {Fix}\r\n- {How To Re-test}\r\n\r\n## QUALITY CHECKS\r\nBefore finishing, verify and explicitly confirm:\r\n- Contrast thresholds met for normal and large text in both themes (with ratios shown).\r\n- Focus indicators reach 3:1 against adjacent colors and are consistently visible.\r\n- `prefers-reduced-motion` is respected (transitions disabled or minimized appropriately).\r\n- Theme selection works with {SYSTEM_PREFERENCE_MODE} and persists without causing a flash of incorrect theme.\r\n- A usable fallback exists when CSS custom properties aren\u2019t available (and the limitations are stated).";
    const variables = ["[BRAND_COLOR_PALETTE]","[TARGET_BROWSERS]","[EXISTING_CSS_FRAMEWORK]","[USER_DEMOGRAPHICS]","[SYSTEM_PREFERENCE_MODE]"];
    // Initial render with highlighted variables
    document.addEventListener('DOMContentLoaded', function() {
        renderPromptWithHighlights();
    });

    // Live update prompt as user types
    document.querySelectorAll('.customize-input').forEach(input => {
        input.addEventListener('input', renderPromptWithHighlights);
    });

    function renderPromptWithHighlights() {
        const promptContent = document.getElementById('premium-prompt-content');
        if (!promptContent) return;

        let updatedPrompt = originalPrompt;
        let filledVariables = {};

        // Collect filled values
        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                filledVariables[placeholder] = value;
            }
        });

        // Replace filled variables and highlight remaining
        let htmlContent = escapeHtml(updatedPrompt);

        variables.forEach(placeholder => {
            const escapedPlaceholder = escapeHtml(placeholder);
            const regex = new RegExp(escapeRegex(escapedPlaceholder), 'g');

            if (filledVariables[placeholder]) {
                // Show filled value with green highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable-filled">' + escapeHtml(filledVariables[placeholder]) + '</span>'
                );
            } else {
                // Show original placeholder with yellow highlight
                htmlContent = htmlContent.replace(regex,
                    '<span class="prompt-variable">' + escapedPlaceholder + '</span>'
                );
            }
        });

        promptContent.innerHTML = htmlContent;
    }

    function escapeRegex(string) {
        return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    }

    function escapeHtml(text) {
        const div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function resetPrompt() {
        // Clear all input fields
        document.querySelectorAll('.customize-input').forEach(input => {
            input.value = '';
        });

        // Re-render with original placeholders highlighted
        renderPromptWithHighlights();

        // Visual feedback
        const resetBtns = document.querySelectorAll('.prompt-header-reset, .prompt-cta-reset');
        resetBtns.forEach(btn => {
            const originalText = btn.querySelector('span').textContent;
            btn.querySelector('span').textContent = 'Reset!';
            setTimeout(() => {
                btn.querySelector('span').textContent = originalText;
            }, 1000);
        });
    }


    function getCustomizedPrompt() {
        let updatedPrompt = originalPrompt;

        document.querySelectorAll('.customize-input').forEach(input => {
            const placeholder = input.dataset.placeholder;
            const value = input.value.trim();

            if (value) {
                const regex = new RegExp(escapeRegex(placeholder), 'g');
                updatedPrompt = updatedPrompt.replace(regex, value);
            }
        });

        return updatedPrompt;
    }
</script>

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>Bring 6–10 real UI surfaces, not just brand colors.</strong> Collect your current background, surface, border, and text colors from production (or Figma) and paste them in before running the prompt. If you only provide a “primary blue,” the output will be theoretical. Add context like, “Card background: #121417, Page background: #0E1012, Body text: #C9D1D9.”</li>


<li><strong>Force component-level examples.</strong> After the first run, ask: “Now apply this to buttons, inputs, links, and toasts with default/hover/active/disabled/focus states.” You’ll get token usage rules that survive real interactions, instead of a pretty palette table.</li>


<li><strong>Ask for contrast math callouts where it matters.</strong> Honestly, the quickest way to catch bad guidance is to make the model show its work. Follow up with: “For each text-on-surface pairing, list the intended contrast ratio target and what would fail if it drops below it.”</li>


<li><strong>Iterate on focus indicators early.</strong> Many teams under-design focus rings and then scramble during accessibility review. After the first output, try asking: “Give me 3 focus ring options that meet 3:1 against adjacent colors, including one that works on both primary and neutral surfaces.” Then choose one and standardize it.</li>


<li><strong>Combine it with your PR workflow.</strong> Once you have the spec, paste your team’s theming approach (CSS variables, Tailwind config, CSS-in-JS tokens, etc.) and ask: “Convert the spec into a PR checklist and a definition-of-done for theme changes.” This turns the document into enforcement, which is where accessibility wins are usually lost.</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>Once your theme spec is locked, these prompts help you keep quality high during reviews and documentation.</p>



<p>If you also need a reliable way to evaluate changes before they ship, use <a href="https://flowpast.com/prompts/run-pull-request-reviews-with-this-ai-prompt/">Run Pull Request Reviews with this AI Prompt</a>. It pairs well here because theme work tends to touch many components, and PR-level checks are where contrast regressions and missing focus states can slip in.</p>



<p>When your product includes user-generated feedback or ratings UI, accessibility issues often show up in dense, text-heavy blocks (especially in dark theme). <a href="https://flowpast.com/prompts/design-a-trustworthy-reviews-system-with-this-ai-prompt/">Design a Trustworthy Reviews System with this AI Prompt</a> is useful for defining display rules, edge cases, and trust signals that must remain readable in both themes.</p>



<p>For teams publishing review content (or displaying it inside the app), clarity and tone matter, but so does scannability on different surfaces. <a href="https://flowpast.com/prompts/write-a-trust-building-review-faq-block-with-this-ai-prompt/">Write a Trust-Building Review FAQ Block with this AI Prompt</a> helps you generate structured FAQ content that you can then validate against your new tokens, spacing, and focus styles.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/run-pull-request-reviews-with-this-ai-prompt/">Run Pull Request Reviews with this AI Prompt</a>: Catch regressions and missing checks.</li>


<li><a href="https://flowpast.com/prompts/design-a-trustworthy-reviews-system-with-this-ai-prompt/">Design a Trustworthy Reviews System with this AI Prompt</a>: Build readable, credible review UI.</li>


<li><a href="https://flowpast.com/prompts/write-a-trust-building-review-faq-block-with-this-ai-prompt/">Write a Trust-Building Review FAQ Block with this AI Prompt</a>: Generate FAQ blocks that feel credible.</li>

<li><a href="https://flowpast.com/prompts/write-balanced-reviews-with-this-ai-prompt/">Write Balanced Reviews with this AI Prompt</a>: Balanced copy for review pages.</li>


<li><a href="https://flowpast.com/prompts/write-skeptic-proof-affiliate-reviews-with-this-ai-prompt/">Write Skeptic-Proof Affiliate Reviews with this AI Prompt</a>: Reduce hype, increase reader trust.</li>

</ul>
<!-- /wp:post-content -->
</div>

<div class="faq-section">
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading">Common Questions</h2>
<!-- /wp:heading -->

<div class="faq-item">
<span class="question">Which roles benefit most from this light dark theme specs AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>Frontend Engineers</strong> use this to turn fuzzy “make dark mode accessible” requests into tokens, state rules, and fallback logic they can implement without constant rework. <strong>Design System Leads</strong> lean on it to standardize contrast targets, focus indicators, and motion behavior so components behave consistently in both themes. <strong>UX/UI Designers</strong> benefit because it adapts brand palettes into usable surface/text combinations, instead of producing an attractive but failing mock. <strong>QA or Accessibility Specialists</strong> get a repeatable validation workflow that goes beyond a single contrast check and catches interaction issues.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this light dark theme specs AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>SaaS products</strong> get immediate value because dashboards often rely on dense tables, muted borders, and many states; dark mode failures there usually mean unreadable metadata and invisible focus rings. <strong>Fintech and healthcare apps</strong> benefit because low-vision readability and keyboard navigation are not “nice to have,” and audits tend to scrutinize contrast, focus, and motion more aggressively. <strong>E-commerce brands</strong> use it to keep product pages and checkout flows readable at night, especially for price, discounts, and error states that must stand out. <strong>Media and content platforms</strong> apply it to long-form reading experiences, where near-black backgrounds, link colors, and selection states make or break comfort.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for WCAG light/dark theme specs produce weak results?</span>
<!-- wp:paragraph -->
<p class="answer">A typical prompt like &#8220;<em>Make me a light and dark theme that meets WCAG</em>&#8221; fails because it: lacks concrete contrast thresholds (4.5:1 body text, 3:1 large text, and 3:1 focus indicators), provides no token structure to apply across components, ignores OS-level preference and reduced-motion requirements, produces generic color suggestions instead of brand-adapted and verified pairings, and skips real-tool validation so teams ship “math-approved” colors that still fail in practice.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Can I customize this light dark theme specs prompt for my specific situation?</span>
<!-- wp:paragraph -->
<p class="answer">Yes, customize it by feeding in your current palette (primary, neutrals, semantic colors), your styling stack (CSS variables, Tailwind, CSS-in-JS, etc.), and a short list of your most problematic components (tables, inputs, charts, modals). If you support an in-app theme override, state how it should behave alongside the OS preference, including persistence rules. Also mention any known failures, like “focus ring disappears on primary button in dark mode” or “disabled text fails contrast.” Follow up with: “Rewrite the spec as implementation steps for my stack, and include a test checklist for PR review.”</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this light dark theme specs prompt?</span>
<!-- wp:paragraph -->
<p class="answer">The biggest mistake is providing only brand colors and no real surfaces or text colors; instead of “Primary: #3B82F6,” include “Dark surface: #111318, Body text: #D6D9E0, Border: #2A2F3A.” Another common error is forgetting interaction states, so you get tokens that work for default but fail on hover/active/disabled; ask explicitly for state-by-state mappings for buttons, inputs, and links. Teams also skip the focus indicator requirement; don’t accept “add an outline” without ensuring it hits 3:1 against adjacent colors across surfaces. Finally, people omit reduced-motion behavior, which leads to theme-switch animations that feel slick but violate prefers-reduced-motion users’ expectations.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Who should NOT use this light dark theme specs prompt?</span>
<!-- wp:paragraph -->
<p class="answer">This prompt isn’t ideal for teams looking for a quick color-swap template with no audit or validation work, because it’s deliberately strict and process-heavy. It’s also a poor fit if you’re doing a full rebrand right now, since it assumes an existing palette that needs adaptation, not reinvention. And if you cannot change tokens or component styles (for example, you’re locked into a third-party UI you can’t override), you’ll get a good spec that you can’t implement. In those cases, start by choosing a more flexible UI base or scoping to a smaller set of screens first.</p>
<!-- /wp:paragraph -->
</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this light dark theme specs AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Frontend Engineers use this to turn fuzzy “make dark mode accessible” requests into tokens, state rules, and fallback logic they can implement without constant rework. Design System Leads lean on it to standardize contrast targets, focus indicators, and motion behavior so components behave consistently in both themes. UX/UI Designers benefit because it adapts brand palettes into usable surface/text combinations, instead of producing an attractive but failing mock. QA or Accessibility Specialists get a repeatable validation workflow that goes beyond a single contrast check and catches interaction issues."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this light dark theme specs AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SaaS products get immediate value because dashboards often rely on dense tables, muted borders, and many states; dark mode failures there usually mean unreadable metadata and invisible focus rings. Fintech and healthcare apps benefit because low-vision readability and keyboard navigation are not “nice to have,” and audits tend to scrutinize contrast, focus, and motion more aggressively. E-commerce brands use it to keep product pages and checkout flows readable at night, especially for price, discounts, and error states that must stand out. Media and content platforms apply it to long-form reading experiences, where near-black backgrounds, link colors, and selection states make or break comfort."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for WCAG light/dark theme specs produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like \"Make me a light and dark theme that meets WCAG\" fails because it: lacks concrete contrast thresholds (4.5:1 body text, 3:1 large text, and 3:1 focus indicators), provides no token structure to apply across components, ignores OS-level preference and reduced-motion requirements, produces generic color suggestions instead of brand-adapted and verified pairings, and skips real-tool validation so teams ship “math-approved” colors that still fail in practice."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this light dark theme specs prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes, customize it by feeding in your current palette (primary, neutrals, semantic colors), your styling stack (CSS variables, Tailwind, CSS-in-JS, etc.), and a short list of your most problematic components (tables, inputs, charts, modals). If you support an in-app theme override, state how it should behave alongside the OS preference, including persistence rules. Also mention any known failures, like “focus ring disappears on primary button in dark mode” or “disabled text fails contrast.” Follow up with: “Rewrite the spec as implementation steps for my stack, and include a test checklist for PR review.”"
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this light dark theme specs prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is providing only brand colors and no real surfaces or text colors; instead of “Primary: #3B82F6,” include “Dark surface: #111318, Body text: #D6D9E0, Border: #2A2F3A.” Another common error is forgetting interaction states, so you get tokens that work for default but fail on hover/active/disabled; ask explicitly for state-by-state mappings for buttons, inputs, and links. Teams also skip the focus indicator requirement; don’t accept “add an outline” without ensuring it hits 3:1 against adjacent colors across surfaces. Finally, people omit reduced-motion behavior, which leads to theme-switch animations that feel slick but violate prefers-reduced-motion users’ expectations."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this light dark theme specs prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for teams looking for a quick color-swap template with no audit or validation work, because it’s deliberately strict and process-heavy. It’s also a poor fit if you’re doing a full rebrand right now, since it assumes an existing palette that needs adaptation, not reinvention. And if you cannot change tokens or component styles (for example, you’re locked into a third-party UI you can’t override), you’ll get a good spec that you can’t implement. In those cases, start by choosing a more flexible UI base or scoping to a smaller set of screens first."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">
<!-- wp:paragraph -->
<p>Accessible theming is not about prettier colors; it’s about predictable readability and interaction in every state. Paste this prompt into your model, run the workflow, and walk away with light/dark theme specs your team can actually implement and verify.</p>
<!-- /wp:paragraph -->
</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5001432.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Build an E-commerce Security Action Plan AI Prompt</title>
		<link>https://flowpast.com/prompts/build-an-e-commerce-security-action-plan-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:40:34 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5003032</guid>

					<description><![CDATA[Payment data risks growing - a ready-to-use AI Prompt that builds an e-commerce security assessment with compliance, integration hardening, and roadmap. Thousands of ready-to-use AI prompts for all models.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: e-commerce security action plan -->

<div class="hook-introduction">

<p>Your store is collecting names, addresses, and card-related payment data every day, but security usually gets handled in scraps. A plugin gets added. A contractor gets admin access. Then one day you realize nobody owns the “what could go wrong” list, let alone a plan to fix it.</p>



<p>This <strong>e-commerce security action plan</strong> is built for <strong>e-commerce operations managers</strong> who need a prioritized hardening backlog without slowing checkout, <strong>agency leads</strong> inheriting messy client stacks with too many integrations, and <strong>founders</strong> who need a practical security assessment that aligns with real compliance obligations. The output is an implementation-ready assessment: threat mapping, environment-specific controls, integration risk callouts, and a sequenced roadmap your team can actually execute.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It restates your platform context, region, and integration footprint to confirm assumptions before recommending controls.</li>
          <li>It maps likely e-commerce attack paths (ATO, payment abuse, API exploitation, plugin supply-chain risk) and ties each path to the places your stack can break.</li>
          <li>It produces environment-specific hardening actions that fit your hosting limits, not generic “turn on every enterprise feature” advice.</li>
          <li>It evaluates each planned third-party integration as a risk junction, then suggests concrete mitigations (scopes, keys, webhooks, logging, least privilege).</li>
          <li>It balances security with UX and conversion by calling out friction points (auth, checkout, bot controls) and offering lower-friction alternatives.</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>You are adding or changing payment providers, fraud tooling, shipping apps, analytics tags, or CRM connections and want to avoid surprise risk.</li>
          <li>A compliance request landed (PCI-related questions, GDPR/UK GDPR expectations, breach response readiness) and you need a realistic plan fast.</li>
          <li>You have “too many admins” or unclear access practices, and offboarding or contractor access is starting to feel unsafe.</li>
          <li>There’s been a near-miss: odd login spikes, card testing, suspicious refunds, credential stuffing, or weird API traffic you can’t explain.</li>
          <li>You are scaling from scrappy to steady and need a security baseline that can be maintained by a small-to-mid e-commerce team.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A tailored threat map with 6–10 prioritized attack paths linked to your stack and integrations.</li>
           <li>A control checklist split into technical controls and procedural controls, written so tasks can be assigned to owners.</li>
           <li>A prioritized roadmap (Now / Next / Later) with rationale, effort level, and expected risk reduction.</li>
           <li>A set of integration-specific hardening notes for each planned integration (API keys, permissions, data flows, webhook verification).</li>
           <li>A short clarifying-question list when your inputs are missing, so you can refine the plan in one more pass.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: E-commerce Security Assessment + Hardening Roadmap</h2>


<!-- Prompt file not found: /home/flowpast/htdocs/flowpast.com/wp-content/data/prompts_scraped/5003240/prompt-2026.txt -->

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<ul class="wp-block-list">

<li><strong>Write your “stack inventory” first.</strong> Before you run the prompt, list your storefront platform, hosting, payment flow (redirect vs on-site), and every integration that touches customer data. If you’re unsure, paste your plugin/app list and ask: “Group these by risk: payments, auth, analytics, fulfillment, marketing, admin.”</li>


<li><strong>Be specific about the host environment constraints.</strong> The prompt is designed to align recommendations to the capabilities and limits of your hosting platform, so give it real boundaries. Follow-up example: “Assume we cannot install kernel agents and we have no SIEM; propose lightweight logging and alerting options that still catch account takeover and card testing.”</li>


<li><strong>Spell out your region and what “compliance” means to you.</strong> “We sell globally” is vague; “We’re US-based, 40% EU customers, and we store order history for 3 years” is useful. A good add-on prompt: “List the top 5 compliance-driven controls we can implement this month without legal review, and what evidence we should save.”</li>


<li><strong>Force prioritization after the first pass.</strong> Ask the model to rank items by impact and effort so the plan becomes executable, not aspirational. Try: “Now rewrite the roadmap as a 2-week sprint plan for a team of 3 (dev, ops, support), and make option 2 more aggressive and option 4 more conservative.”</li>


<li><strong>Stress-test the integration junctions.</strong> Most real incidents in e-commerce show up where systems connect: webhooks, admin apps, API tokens, analytics scripts, and vendor dashboards. Follow-up example: “For each integration, list the exact data elements exchanged, worst-case abuse scenario, and one control that detects it (not just prevents it).” Honestly, detection is where small teams usually underinvest.</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>Once you’ve outlined your security action plan, these prompts help you document decisions, train the team, and communicate the “why” behind the controls.</p>



<p>If you also need to get internal buy-in, <a href="https://flowpast.com/prompts/create-essential-topic-takeaways-with-this-ai-prompt/">Create Essential Topic Takeaways with this AI Prompt</a> is useful for turning your hardening backlog into a one-page summary that leadership will actually read. It’s a clean way to explain what changes now, what changes later, and the risk you’re reducing in plain language.</p>



<p>When onboarding new staff or contractors, <a href="https://flowpast.com/prompts/build-a-teachable-concept-map-with-this-ai-prompt/">Build a Teachable Concept Map with this AI Prompt</a> helps you map your security model (access, data flows, payment boundaries, incident response) into a simple learning path. That matters because procedural controls fail when nobody understands the system they’re trying to protect.</p>



<p>For teams doing training in a more interactive way, <a href="https://flowpast.com/prompts/ai-prompt-to-teach-business-concepts-as-socratic-dialogue/">AI Prompt to Teach Business Concepts as Socratic Dialogue</a> can turn “security rules” into a guided Q&amp;A session. Use it to walk through scenarios like credential stuffing, compromised API keys, or a shady plugin update, then capture the decisions your team should make.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/create-essential-topic-takeaways-with-this-ai-prompt/">Create Essential Topic Takeaways with this AI Prompt</a>: One-page summary for stakeholder buy-in.</li>


<li><a href="https://flowpast.com/prompts/build-a-teachable-concept-map-with-this-ai-prompt/">Build a Teachable Concept Map with this AI Prompt</a>: Train teams on security data flows.</li>


<li><a href="https://flowpast.com/prompts/ai-prompt-to-teach-business-concepts-as-socratic-dialogue/">AI Prompt to Teach Business Concepts as Socratic Dialogue</a>: Scenario-based security decision training.</li>

<li><a href="https://flowpast.com/prompts/build-a-topic-concept-map-with-this-ai-prompt/">Build a Topic Concept Map with this AI Prompt</a>: Visualize policy, access, and controls.</li>

<li><a href="https://flowpast.com/prompts/master-any-topic-faster-with-this-ai-prompt/">Master Any Topic Faster with this AI Prompt</a>: Ramp up on PCI, ATO, and fraud.</li>
<!-- /wp:post-content -->
</ul>
<!-- /wp:list -->
</div>

<div class="faq-section">
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading">Common Questions</h2>
<!-- /wp:heading -->

<div class="faq-item">
<span class="question">Which roles benefit most from this e-commerce security action plan AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>E-commerce Operations Managers</strong> use this to turn scattered security “to-dos” into a prioritized roadmap that doesn’t break checkout. <strong>Security Leads at small companies</strong> rely on it to rapidly threat-map real e-commerce attack paths and translate them into implementable controls. <strong>CTOs or Lead Developers</strong> get value because the output separates configuration, code, and infrastructure tasks, so work can be scheduled and owned. <strong>Agency Owners</strong> apply it when inheriting client stores with risky plugin stacks and unclear access governance.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this e-commerce security action plan AI prompt?</span>
<!-- wp:paragraph -->
<p class="answer"><strong>Direct-to-consumer (DTC) brands</strong> use this to reduce account takeover, fraud refund loops, and third-party script risk without tanking conversion. It’s especially helpful when marketing keeps adding tags and tools that touch customer data. <strong>Subscription e-commerce</strong> teams apply it to protect recurring billing flows, customer portals, and “update payment method” journeys that attract attackers. <strong>Digital goods and online marketplaces</strong> leverage it to harden anti-abuse controls (bot defense, rate limits, identity checks) where fraudsters target instant fulfillment. <strong>Retailers modernizing legacy commerce</strong> find it useful when they’re stitching together ERP, CRM, and shipping systems and need safer integration patterns.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for building an e-commerce security action plan produce weak results?</span>
<!-- wp:paragraph -->
<p class="answer">A typical prompt like “Write me a security plan for my online store” fails because it: lacks your hosting platform constraints, so it recommends tools you can’t deploy; provides no threat mapping, so you get generic checklists instead of likely attack paths; ignores your region and compliance realities, so guidance becomes a messy global summary; skips integration junctions, where real breaches often happen; and produces vague “best practices” rather than prioritized tasks with owners and sequencing.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Can I customize this e-commerce security action plan prompt for my specific situation?</span>
<!-- wp:paragraph -->
<p class="answer">Yes. The prompt is designed to adapt to your HOSTING_PLATFORM, REGION_COUNTRY, and PLANNED_INTEGRATIONS so recommendations match what you can actually implement. If the first output feels too generic, rerun it with tighter details such as “Shopify + 12 apps,” “AWS ECS behind CloudFront,” or “EU customers with UK operations,” plus the exact vendors you’re integrating. A strong follow-up is: “Rewrite the roadmap for our team capacity (2 devs, no dedicated security), and flag anything that could add checkout friction with alternatives.”</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this e-commerce security action plan prompt?</span>
<!-- wp:paragraph -->
<p class="answer">The biggest mistake is leaving HOSTING_PLATFORM too vague — instead of “cloud hosting,” say “Shopify (hosted) with custom theme” or “WooCommerce on managed WordPress hosting.” Another common error is flattening PLANNED_INTEGRATIONS into “some apps,” rather than listing specifics like “Klaviyo, Recharge, ShipStation, GA4 via GTM, Zendesk,” which prevents integration-by-integration risk controls. People also misstate REGION_COUNTRY as “global,” when “US-based selling to EU customers” changes what data handling and retention recommendations look like. Finally, teams forget to mention UX constraints (for example, “no CAPTCHA at checkout”), so the plan can accidentally hurt conversion unless you clarify that boundary.</p>
<!-- /wp:paragraph -->
</div>

<div class="faq-item">
<span class="question">Who should NOT use this e-commerce security action plan prompt?</span>
<!-- wp:paragraph -->
<p class="answer">This prompt isn’t ideal for one-off projects where you will not revisit the plan after your stack changes, because integrations and risk shift constantly. It’s also not a substitute for a formal audit if you need certified compliance validation or penetration testing evidence for a partner. And if you have zero clarity on your platform, integrations, or data flows, you’ll get assumptions you must correct. In that case, start by inventorying your stack and access model, then rerun the prompt with those specifics.</p>
<!-- /wp:paragraph -->
</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this e-commerce security action plan AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "E-commerce Operations Managers use this to turn scattered security “to-dos” into a prioritized roadmap that doesn’t break checkout. Security Leads at small companies rely on it to rapidly threat-map real e-commerce attack paths and translate them into implementable controls. CTOs or Lead Developers get value because the output separates configuration, code, and infrastructure tasks, so work can be scheduled and owned. Agency Owners apply it when inheriting client stores with risky plugin stacks and unclear access governance."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this e-commerce security action plan AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Direct-to-consumer (DTC) brands use this to reduce account takeover, fraud refund loops, and third-party script risk without tanking conversion. It’s especially helpful when marketing keeps adding tags and tools that touch customer data. Subscription e-commerce teams apply it to protect recurring billing flows, customer portals, and “update payment method” journeys that attract attackers. Digital goods and online marketplaces leverage it to harden anti-abuse controls (bot defense, rate limits, identity checks) where fraudsters target instant fulfillment. Retailers modernizing legacy commerce find it useful when they’re stitching together ERP, CRM, and shipping systems and need safer integration patterns."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for building an e-commerce security action plan produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like “Write me a security plan for my online store” fails because it: lacks your hosting platform constraints, so it recommends tools you can’t deploy; provides no threat mapping, so you get generic checklists instead of likely attack paths; ignores your region and compliance realities, so guidance becomes a messy global summary; skips integration junctions, where real breaches often happen; and produces vague “best practices” rather than prioritized tasks with owners and sequencing."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this e-commerce security action plan for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. The prompt is designed to adapt to your HOSTING_PLATFORM, REGION_COUNTRY, and PLANNED_INTEGRATIONS so recommendations match what you can actually implement. If the first output feels too generic, rerun it with tighter details such as “Shopify + 12 apps,” “AWS ECS behind CloudFront,” or “EU customers with UK operations,” plus the exact vendors you’re integrating. A strong follow-up is: “Rewrite the roadmap for our team capacity (2 devs, no dedicated security), and flag anything that could add checkout friction with alternatives.”"
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this e-commerce security action plan prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving HOSTING_PLATFORM too vague — instead of “cloud hosting,” say “Shopify (hosted) with custom theme” or “WooCommerce on managed WordPress hosting.” Another common error is flattening PLANNED_INTEGRATIONS into “some apps,” rather than listing specifics like “Klaviyo, Recharge, ShipStation, GA4 via GTM, Zendesk,” which prevents integration-by-integration risk controls. People also misstate REGION_COUNTRY as “global,” when “US-based selling to EU customers” changes what data handling and retention recommendations look like. Finally, teams forget to mention UX constraints (for example, “no CAPTCHA at checkout”), so the plan can accidentally hurt conversion unless you clarify that boundary."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this e-commerce security action plan prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for one-off projects where you will not revisit the plan after your stack changes, because integrations and risk shift constantly. It’s also not a substitute for a formal audit if you need certified compliance validation or penetration testing evidence for a partner. And if you have zero clarity on your platform, integrations, or data flows, you’ll get assumptions you must correct. In that case, start by inventorying your stack and access model, then rerun the prompt with those specifics."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">
<!-- wp:paragraph -->
<p>Security gets easier when you stop treating it like a random checklist and start treating it like a roadmap. Paste this prompt into your AI tool, run it against your current stack, and turn the output into the next set of fixes you ship.</p>
<!-- /wp:paragraph -->
</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5003032.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Build an E-commerce Security Architecture with this AI Prompt</title>
		<link>https://flowpast.com/prompts/build-an-e-commerce-security-architecture-with-this-ai-prompt/</link>
		
		<dc:creator><![CDATA[Lisa Granqvist]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 02:39:27 +0000</pubDate>
				<category><![CDATA[Prompts]]></category>
		<guid isPermaLink="false">https://flowpast.com/?p=5003031</guid>

					<description><![CDATA[Integrations create hidden holes - the ultimate AI Prompt that builds a platform-specific security architecture with an action plan and checklist. Discover more AI prompts for marketing, sales, and ops.]]></description>
										<content:encoded><![CDATA[<!-- FOCUS_KEYWORD: e-commerce security architecture -->

<div class="hook-introduction">

<p>Your e-commerce stack probably isn’t “one platform.” It’s a platform plus a payment flow, a handful of apps, tracking scripts, fulfillment tools, and admin accounts spread across a team. That’s where security breaks: in the seams, not the homepage.</p>



<p>This <strong>e-commerce security architecture</strong> is built for <strong>e-commerce operators</strong> who keep adding integrations and want to stop creating new attack paths, <strong>growth marketers</strong> who rely on third-party pixels and tools but still need a safe data flow, and <strong>consultants</strong> who must hand clients a clear security plan that’s practical, not theoretical. The output is a platform-tailored architecture with prioritized risks, implementable controls (configs and workflows), tradeoffs, and a customized checklist plus incident response planning.</p>

</div>

<div class="what-and-when-section">

<h2 class="wp-block-heading">What Does This AI Prompt Do and When to Use It?</h2>



<table class="solution-results-table three-column" role="presentation" aria-label="What this prompt does, when to use it, and what you get">
 <thead>
    <tr>
      <th scope="col">What This Prompt Does</th>
      <th scope="col">When to Use This Prompt</th>
      <th scope="col">What You&#8217;ll Get</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <ul class="automation-list">
          <li>It restates your environment first, then identifies the top likely attack surfaces across infrastructure, application layers, and vendor connections.</li>
          <li>It models realistic attack paths tied to hosting environment, region, and third-party integrations, focusing on how compromises typically unfold.</li>
          <li>It translates risks into actionable controls with concrete settings and workflows, not generic “best practices.”</li>
          <li>It adds “what to do, why it matters, and what goes wrong if skipped” for every measure so the plan is executable by a team.</li>
          <li>It includes prevention plus incident response planning, and it addresses technical failures alongside human-driven compromise (phishing, credential reuse, admin error).</li>
       </ul>
      </td>
      <td>
        <ul class="results-list">
          <li>You’re adding new integrations (reviews, subscriptions, loyalty, analytics, fulfillment) and you need to understand the new entry points you just created.</li>
          <li>A payment or account incident scared the team, and you want an architecture that reduces risk without derailing growth work.</li>
          <li>You’re migrating regions or changing hosting patterns and need to rethink data flows, permissions, and monitoring in a specific context.</li>
          <li>Partners keep requesting access (agency logins, support vendors, contractors), and your admin surface area is getting out of control.</li>
          <li>You’re scaling order volume and automation, and manual, periodic security routines are no longer reliable enough.</li>
        </ul>
      </td>
       <td>
         <ul class="deliverables-list">
           <li>A prioritized list of the top 5 attack surfaces with environment-specific notes on why they’re likely.</li>
           <li>A set of concrete control recommendations where each item includes “do this,” “why,” and “if skipped” failure modes.</li>
           <li>A lightweight cost–benefit view for each control (time/effort/cost versus risk reduction) to support decision-making.</li>
           <li>An incident response outline customized to your stack, including what to monitor and how to react when something looks wrong.</li>
           <li>A customized security checklist you can operationalize, with an emphasis on automation and continuous controls.</li>
         </ul>
       </td>
    </tr>
  </tbody>
</table>

</div>

<div class="prompt-display-section">

<h2 class="wp-block-heading">The Full AI Prompt: Platform-Tailored E-commerce Security Architecture Builder</h2>


<!-- Prompt file not found: /home/flowpast/htdocs/flowpast.com/wp-content/data/prompts_scraped/5003239/prompt-2026.txt -->

</div>

<div class="pro-tips-section">

<h2 class="wp-block-heading">Pro Tips for Better AI Prompt Results</h2>



<p>This prompt is unusually strict (in a good way). It’s designed to force specificity: environment, region, integrations, and how humans actually make mistakes. If you feed it vague context, you’ll still get a plan, but it will not be as sharp as it can be.</p>



<ul class="wp-block-list">

<li><strong>Describe your “seams,” not just your store.</strong> List the tools that touch customer data, admin access, or order workflows. Include things like helpdesk systems, fulfillment portals, tag managers, subscription apps, data connectors, and any middleware. Follow-up prompt: “Map the data flow between these integrations and point out the riskiest trust boundaries.”</li>


<li><strong>Force it to name the likely attack path.</strong> Don’t accept generic risk statements like “phishing is a threat.” Ask for a concrete chain, such as “contractor Gmail compromised → reused password → admin login → app token created → data exfiltration.” Follow-up prompt: “Give me three plausible intrusion chains for my setup and the earliest detection point for each.”</li>


<li><strong>Make tradeoffs explicit before you socialize the plan.</strong> Security recommendations die in meetings when effort isn’t acknowledged. After the first run, ask: “Rewrite the control list as a phased rollout: Week 1 quick wins, Month 1 foundation, Quarter 1 maturity.”</li>


<li><strong>Iterate by tightening the checklist into operations.</strong> The first checklist is usually too broad. After it generates the list, try asking: “Now convert the checklist into continuous controls and alerts. For each item, tell me what can be automated, what needs human review, and how often.”</li>


<li><strong>Pair it with your customer comms plan.</strong> Incidents become marketing problems fast, especially if customers notice before you do. Once you have the incident response outline, use a messaging prompt to prepare calm, consistent replies; for example, <a href="https://flowpast.com/prompts/write-social-media-comment-replies-with-this-ai-prompt/">Write Social Media Comment Replies with this AI Prompt</a> can help you draft responses that don’t overshare but still build trust.</li>

</ul>

</div>

<div class="related-prompts-section">

<h2 class="wp-block-heading">Related Prompts</h2>



<p>Once your security architecture is clear, these prompts help you communicate proof, handle public feedback, and keep campaigns moving without improvising.</p>



<p>If you also need credibility assets after tightening security, <a href="https://flowpast.com/prompts/testimonial-led-social-proof-plan-ai-prompt/">Testimonial-Led Social Proof Plan AI Prompt</a> helps you shape customer evidence into a structured plan. This is useful when you want to reinforce trust post-incident, or when you’re proactively improving perception while you implement controls behind the scenes.</p>



<p>When you’re turning real customer language into narratives that feel human (and not like compliance copy), <a href="https://flowpast.com/prompts/turn-testimonials-into-influencer-stories-ai-prompt/">Turn Testimonials Into Influencer Stories AI Prompt</a> can bridge the gap. It pairs well if your security upgrades affect policies, returns, shipping, or account experiences and you need reassuring stories that still sound authentic.</p>



<p>If your team runs paid campaigns while security work is in progress, <a href="https://flowpast.com/prompts/write-social-ad-copy-with-this-ai-prompt/">Write Social Ad Copy with this AI Prompt</a> can keep performance creative flowing without last-minute scramble. It’s especially handy if you must adjust offers or messaging because you changed checkout steps, authentication, or fraud controls.</p>


<br>


<p>Quick reference:</p>



<ul class="wp-block-list">

<li><a href="https://flowpast.com/prompts/turn-testimonials-into-influencer-stories-ai-prompt/">Turn Testimonials Into Influencer Stories AI Prompt</a>: Transform testimonials into story-driven content.</li>


<li><a href="https://flowpast.com/prompts/testimonial-led-social-proof-plan-ai-prompt/">Testimonial-Led Social Proof Plan AI Prompt</a>: Build a structured social proof plan.</li>


<li><a href="https://flowpast.com/prompts/write-social-media-comment-replies-with-this-ai-prompt/">Write Social Media Comment Replies with this AI Prompt</a>: Draft calm, on-brand public replies.</li>


<li><a href="https://flowpast.com/prompts/create-20-social-post-ideas-from-a-question-wheel-ai-prompt/">Create 20 Social Post Ideas from a Question Wheel AI Prompt</a>: Generate post ideas from customer questions.</li>


<li><a href="https://flowpast.com/prompts/write-social-ad-copy-with-this-ai-prompt/">Write Social Ad Copy with this AI Prompt</a>: Produce ad variants for offers and campaigns.</li>

</ul>

</div>

<div class="faq-section">

<h2 class="wp-block-heading">Common Questions</h2>


<div class="faq-item">
<span class="question">Which roles benefit most from this e-commerce security architecture AI prompt?</span>

<p class="answer"><strong>E-commerce Directors</strong> use this to turn a messy plugin-and-vendor reality into a prioritized security plan they can actually fund and schedule. <strong>Revenue Operations Managers</strong> find it valuable because it forces clarity around integrations, permissions, and the workflows that quietly leak risk (tokens, shared logins, admin sprawl). <strong>Security Engineers</strong> use it to pressure-test the stack with realistic attack paths and convert findings into implementable controls with “why” and “what breaks if skipped.” <strong>Consultants</strong> leverage it to deliver a tailored architecture, checklist, and incident response outline without writing a generic report clients ignore.</p>

</div>

<div class="faq-item">
<span class="question">Which industries get the most value from this e-commerce security architecture AI prompt?</span>

<p class="answer"><strong>Direct-to-consumer brands</strong> get value because their growth stack often includes dozens of third-party tools touching customer data, and one weak integration can become the entry point. <strong>Subscription commerce</strong> teams benefit since billing retries, account portals, and subscription apps expand the attack surface beyond a one-time checkout. <strong>Marketplace sellers building standalone stores</strong> use it when they move from platform-contained risk to running their own integrations, admin accounts, and data flows. <strong>High-volume promotional retailers</strong> find it helpful because spikes in traffic and campaign tooling make monitoring, abuse prevention, and incident readiness much more than a quarterly task.</p>

</div>

<div class="faq-item">
<span class="question">Why do basic AI prompts for building an e-commerce security architecture produce weak results?</span>

<p class="answer">A typical prompt like &#8220;<em>Write me a security plan for my online store</em>&#8221; fails because it: lacks environment and region specificity, so it can’t tie risks to how your hosting and access are really configured; provides no realistic attack-path modeling, which leads to generic lists instead of defensible priorities; ignores integration touchpoints, where tokens, webhooks, and vendor access often create the easiest entry routes; produces abstract advice instead of actionable configurations and workflows; and misses incident response planning, so you’re left with prevention talk but no plan for detection and containment when something goes sideways.</p>

</div>

<div class="faq-item">
<span class="question">Can I customize this e-commerce security architecture prompt for my specific situation?</span>

<p class="answer">Yes, and you should. The prompt is designed to adapt based on the hosting environment, region, and the exact third-party integrations in your stack, so your best “customization” is to provide those details explicitly in your chat before you run it. Add operational constraints too: team size, who has admin access, and which parts are handled by agencies or contractors. Follow-up prompt to refine: “Re-rank the controls for a two-person team, prioritize automation, and call out anything that is likely to break analytics or conversion if implemented incorrectly.”</p>

</div>

<div class="faq-item">
<span class="question">What are the most common mistakes when using this e-commerce security architecture prompt?</span>

<p class="answer">The biggest mistake is leaving the environment vague — instead of “we’re on the cloud,” say “Shopify storefront with third-party apps, GA4 via tag manager, helpdesk integration, and a fulfillment portal with shared accounts.” Another common error is listing integrations without describing permissions or data flow; “Klaviyo connected” is weaker than “Klaviyo has customer email + purchase events, API key stored in a shared password manager.” People also skip the human element: “Team uses SSO” is less useful than “Two agencies have admin access, contractors rotate monthly, and MFA isn’t enforced everywhere.” Finally, teams forget incident reality; don’t just ask for prevention, ask for detection signals and the first 60 minutes of response steps.</p>

</div>

<div class="faq-item">
<span class="question">Who should NOT use this e-commerce security architecture prompt?</span>

<p class="answer">This prompt isn’t ideal for teams looking for formal compliance certification or audit sign-off, because it explicitly does not replace a formal assessment. It’s also a poor fit if you want a one-page template with no iteration; the value comes from tailoring to your environment and revising tradeoffs with your constraints. And if you’re expecting guaranteed breach prevention, frankly, that’s not realistic. In those cases, use it as a starting architecture, then engage a qualified professional to validate and implement high-impact changes.</p>

</div>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Which roles benefit most from this e-commerce security architecture AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "E-commerce Directors use this to turn a messy plugin-and-vendor reality into a prioritized security plan they can actually fund and schedule. Revenue Operations Managers find it valuable because it forces clarity around integrations, permissions, and the workflows that quietly leak risk (tokens, shared logins, admin sprawl). Security Engineers use it to pressure-test the stack with realistic attack paths and convert findings into implementable controls with “why” and “what breaks if skipped.” Consultants leverage it to deliver a tailored architecture, checklist, and incident response outline without writing a generic report clients ignore."
      }
    },
    {
      "@type": "Question",
      "name": "Which industries get the most value from this e-commerce security architecture AI prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Direct-to-consumer brands get value because their growth stack often includes dozens of third-party tools touching customer data, and one weak integration can become the entry point. Subscription commerce teams benefit since billing retries, account portals, and subscription apps expand the attack surface beyond a one-time checkout. Marketplace sellers building standalone stores use it when they move from platform-contained risk to running their own integrations, admin accounts, and data flows. High-volume promotional retailers find it helpful because spikes in traffic and campaign tooling make monitoring, abuse prevention, and incident readiness much more than a quarterly task."
      }
    },
    {
      "@type": "Question",
      "name": "Why do basic AI prompts for building an e-commerce security architecture produce weak results?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A typical prompt like \"Write me a security plan for my online store\" fails because it: lacks environment and region specificity, so it can’t tie risks to how your hosting and access are really configured; provides no realistic attack-path modeling, which leads to generic lists instead of defensible priorities; ignores integration touchpoints, where tokens, webhooks, and vendor access often create the easiest entry routes; produces abstract advice instead of actionable configurations and workflows; and misses incident response planning, so you’re left with prevention talk but no plan for detection and containment when something goes sideways."
      }
    },
    {
      "@type": "Question",
      "name": "Can I customize this e-commerce security architecture prompt for my specific situation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes, and you should. The prompt is designed to adapt based on the hosting environment, region, and the exact third-party integrations in your stack, so your best “customization” is to provide those details explicitly in your chat before you run it. Add operational constraints too: team size, who has admin access, and which parts are handled by agencies or contractors. Follow-up prompt to refine: “Re-rank the controls for a two-person team, prioritize automation, and call out anything that is likely to break analytics or conversion if implemented incorrectly.”"
      }
    },
    {
      "@type": "Question",
      "name": "What are the most common mistakes when using this e-commerce security architecture prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The biggest mistake is leaving the environment vague — instead of “we’re on the cloud,” say “Shopify storefront with third-party apps, GA4 via tag manager, helpdesk integration, and a fulfillment portal with shared accounts.” Another common error is listing integrations without describing permissions or data flow; “Klaviyo connected” is weaker than “Klaviyo has customer email + purchase events, API key stored in a shared password manager.” People also skip the human element: “Team uses SSO” is less useful than “Two agencies have admin access, contractors rotate monthly, and MFA isn’t enforced everywhere.” Finally, teams forget incident reality; don’t just ask for prevention, ask for detection signals and the first 60 minutes of response steps."
      }
    },
    {
      "@type": "Question",
      "name": "Who should NOT use this e-commerce security architecture prompt?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "This prompt isn’t ideal for teams looking for formal compliance certification or audit sign-off, because it explicitly does not replace a formal assessment. It’s also a poor fit if you want a one-page template with no iteration; the value comes from tailoring to your environment and revising tradeoffs with your constraints. And if you’re expecting guaranteed breach prevention, frankly, that’s not realistic. In those cases, use it as a starting architecture, then engage a qualified professional to validate and implement high-impact changes."
      }
    }
  ]
}
</script>
</div>

<div class="closing-section">

<p>Integrations and admin access don’t just add features. They add attack paths. Use this prompt to turn your current stack into a clear, environment-specific security architecture you can implement and maintain.</p>

</div>]]></content:encoded>
					
		
		
		<media:content url="https://flowpast.s3.eu-north-1.amazonaws.com/featured_blog_images/5003031.webp" medium="image"></media:content>
            	</item>
	</channel>
</rss>
