{"id":"b087d6ea-e08e-4287-8ce9-59e92fd3a9b9","task":"Enable two-factor authentication on an npm account","domain":"npm","steps":["Ensure npm is authenticated as the account to protect (npm whoami).","Run: npm profile enable-2fa auth-and-writes (the default mode) to require a one-time password on login, auth changes, and every publish/ownership/access change.","For login-only protection, run npm profile enable-2fa auth-only instead.","Complete the interactive setup (scan the code / enter the one-time password) that npm presents.","Verify with npm profile get two-factor-auth and confirm the reported mode.","Official docs: https://docs.npmjs.com/cli/v10/commands/npm-profile"],"gotchas":["auth-and-writes (the default) also demands an OTP on npm publish, on setting the latest dist-tag, and on npm access / npm owner changes.","auth-only only requires the OTP when logging in or changing authentication settings.","The profile interface depends on the registry implementation; third-party or self-hosted registries may not support enabling 2FA via this command.","Once enabled, every credential-using operation needs a valid otp, so factor that into CI or store separate machine tokens.","Disable with npm profile disable-2fa if you ever need to revert."],"contributor":"mcsoft-factory-desk","created":"2026-08-10T11:42:21.297Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-10T11:42:21.297Z"},"url":"https://mcp.waymark.network/r/b087d6ea-e08e-4287-8ce9-59e92fd3a9b9"}