Answer: Rotate the JWT secret in stages: generate a new secret and prepend it to the `session.jwt_secret` array, roll the deployment, then after `ttl_hours` plus a margin remove the old secret and roll again. Status: Confirmed Entry: tool/claude-code/admin-and-enterprise/rotate-jwt-secret Revision: 3 Digest: sha256:45e66ceb2543bffc (changes whenever the content changes) Timeline: Created: 2026-11-13T12:08:28Z Last changed: 2026-11-20T12:18:35Z (session end timing: — → ttl_hours) Last verified: 2026-11-20T12:18:35Z Next check: 2026-11-21T12:18:35Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of rotation step 1 | Generate a new secret. Prepend it to the `session.jwt_secret` array. | [1] | 2026-11-20 rotation step 2 | Roll the deployment. New tokens sign with the new secret; old tokens still verify. | [1] | 2026-11-20 rotation step 3 | After `ttl_hours` plus a margin, remove the old secret and roll again. | [1] | 2026-11-20 session end timing | ttl_hours | [1] | 2026-11-20 Sources: [1] Anthropic. "Claude apps gateway deployment and operations". https://code.claude.com/docs/en/claude-apps-gateway-deploy.md Role: primary. Accessed: 2026-11-20T12:18:35Z Quote: "Generate a new secret. Prepend it to the `session.jwt_secret` array." (Supports: rotation step 1) Quote: "Roll the deployment. New tokens sign with the new secret; old tokens still verify." (Supports: rotation step 2) Quote: "After `ttl_hours` plus a margin, remove the old secret and roll again." (Supports: rotation step 3) Quote: "their session ends within `ttl_hours`." (Supports: session end timing) Published: 2026-11-20T03:01:05Z Snapshot SHA-256: 3a870086a04bbb73920b2d92ea008ab10ca7bdf926ac44e1a602ca76fc32fda3 (captured 2026-11-20T12:18:38Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:18:35Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:18:35Z Last attempt: 2026-11-20T12:18:35Z Notes and limitations: Extracted automatically from a single official source (section "JWT secret rotation"). Related: https://latestn.com/tool/claude-code/admin-and-enterprise/self-hosted-availability-enablement Which Claude Code plans support self-hosted environments and how do I enable them? https://latestn.com/tool/claude-code/admin-and-enterprise/self-hosted-environment-prerequisites What are the prerequisites for setting up a self-hosted environment in Claude Code? https://latestn.com/tool/claude-code/admin-and-enterprise/self-hosted-limitations What are the limitations of Claude Code self-hosted environments? https://latestn.com/tool/claude-code/admin-and-enterprise/restrict-parent-settings-locks How do I restrict parent settings for Claude Code using locks? https://latestn.com/tool/claude-code/admin-and-enterprise/restrict-plugin-marketplaces How do I restrict which plugin marketplaces users can install in Claude Code? https://latestn.com/tool/claude-code/admin-and-enterprise/roll-out-gateway-for-org How do I roll out an LLM gateway for my organization in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:18:35Z | changed | session end timing: — → ttl_hours | [1] 2026-11-20T12:18:35Z | changed | rotation step 3: — → After `ttl_hours` plus a margin, remove the old secret and roll again. | [1] 2026-11-20T12:18:35Z | changed | rotation step 2: — → Roll the deployment. New tokens sign with the new secret; old tokens still verify. | [1] 2026-11-20T12:18:35Z | changed | rotation step 1: — → Generate a new secret. Prepend it to the `session.jwt_secret` array. | [1] 2026-11-20T12:18:35Z | changed | Session invalidation timing: within `ttl_hours` → — | [1] 2026-11-20T12:18:35Z | changed | Step 3: After `ttl_hours` plus a margin, remove the old secret and roll again → — | [1] 2026-11-20T12:18:35Z | changed | Step 2: Roll the deployment → — | [1] 2026-11-20T12:18:35Z | changed | Step 1: Prepend it to the `session.jwt_secret` array → — | [1] 2026-11-17T12:23:08Z | changed | Session invalidation timing: — → within `ttl_hours` | [1] 2026-11-17T12:23:08Z | changed | Step 3: — → After `ttl_hours` plus a margin, remove the old secret and roll again | [1] 2026-11-17T12:23:08Z | changed | Step 2: — → Roll the deployment | [1] 2026-11-17T12:23:08Z | changed | Step 1: — → Prepend it to the `session.jwt_secret` array | [1] 2026-11-17T12:23:08Z | changed | session end window: `ttl_hours` → — | [1] 2026-11-17T12:23:08Z | changed | rotation step 3: After `ttl_hours` plus a margin, remove the old secret and roll again. → — | [1] 2026-11-17T12:23:08Z | changed | rotation step 2: Roll the deployment. New tokens sign with the new secret; old tokens still verify. → — | [1] 2026-11-17T12:23:08Z | changed | rotation step 1: Generate a new secret. Prepend it to the `session.jwt_secret` array. → — | [1] 2026-11-13T12:08:28Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/admin-and-enterprise/rotate-jwt-secret/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/rotate-jwt-secret POST: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/rotate-jwt-secret with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/rotate-jwt-secret?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I rotate the JWT secret for a Claude apps gateway? Revision 3, last verified 2026-11-20T12:18:35Z. https://latestn.com/tool/claude-code/admin-and-enterprise/rotate-jwt-secret (accessed 2026-11-21T10:03:38Z). @misc{LatestN_tool_claude_code_admin_and_enterprise_rotate_jwt_secret_r3, title = {How do I rotate the JWT secret for a Claude apps gateway?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/admin-and-enterprise/rotate-jwt-secret}}, note = {Revision 3; digest sha256:45e66ceb2543bffc; last verified 2026-11-20T12:18:35Z; accessed 2026-11-21T10:03:38Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/admin-and-enterprise/rotate-jwt-secret