Use this skill when an operator or customer cannot enter a tenant-backed application and asks for a password reset, recovery link, passkey replacement, or direct admin login. It applies to products where a central identity service creates a separate tenant-local browser session, often through a signed handoff.
Before touching credentials, write down which layer owns each identity:
Do not tell the user that a bot connection means they are logged into the web admin. Do not infer that an account has a password because the user calls the problem a “password reset.” Inspect the live schema and routes first. A passkey record is not a password record.
Prefer, in order:
If the system has no password schema or route, say so plainly. A durable fallback is a feature addition, not a database “reset.”
When a password fallback is appropriate, keep it at the central identity boundary and preserve the ordinary signed handoff into the tenant. Never re-enable a legacy tenant-local password for a tenant whose central identity is authoritative.
Require all of the following:
HttpOnly, Secure, SameSite=Lax or stricter as the flow permits);Keep an existing passkey valid unless the user separately asks to revoke it. Adding a fallback, replacing a passkey, and revoking an old factor are separate operations.
A password login page should have a stable non-secret URL and:
The signed central account type remains authoritative. Do not derive product admin from a legacy local tenant role, a configured password, or a stale cookie.
Generate the password into a permission-restricted temporary file. Compute the hash locally. Inject only the exact account ID and hash through the app's approved secret environment path. For PM2-managed services, update the environment deterministically, restart only the target process with updated env, then save PM2 state.
Deliver the plaintext privately to the verified user—prefer a protected direct message rather than a group. After accepted delivery, delete plaintext and temporary hash staging. Do not print secret values while verifying configuration; report only configured/unconfigured markers.
Rotating the fallback means generating a new password and replacing the stored hash. Prefer an application/operator endpoint or a managed secret store when one exists; environment-backed configuration is appropriate only for narrowly scoped operator fallback, not general customer passwords.
A static HTML file containing a short-lived handoff token is fragile:
If a bridge is unavoidable, verify the public URL before sending, deliver it privately, state its exact expiry, make it single-use, remove it afterward, and label it temporary. Never call it a password reset or durable recovery.
Do not stop at unit tests or a PM2 online row. Verify the public path:
200 and identifies the intended admin surface;401 and sets no session cookie;200, the expected account type, and a secure central cookie;When the user reports a failed recovery URL, reproduce that exact public URL first, explain the failure briefly, and replace it with a verified durable path rather than another unverified bearer file.
references/caduceus-passkey-admin-password-fallback.md — Caduceus central/passkey/tenant-handoff implementation pattern and the static-recovery failure lesson.