A one-time passcode, or OTP, is a code that is valid for a single login or transaction. It is often sent by text message or email, or generated by an authenticator app, and is used as a second step to confirm that the person signing in is who they claim to be.
It adds protection beyond a password, because a stolen password alone is not enough to get in. OTPs are also used to confirm sign-ups, password resets and payments.
They are not foolproof. A code sent by email or text can be exposed if that account is compromised, and attackers can trick people or automated systems into revealing a code that arrives in a mailbox or message. This matters more as AI agents read inboxes and act on a user's behalf, because a code visible to the agent may be exposed through manipulation. Codes generated by an app or hardware key are generally harder to intercept than ones sent by message.
To reduce risk, use app-based or hardware methods where possible, never share a code with anyone who contacts you, and limit what automated tools can read and do.