# What is Replay Attack Protection? Also called Anti-Replay, Replay Prevention. Replay attack protection is the set of measures that stop a valid captured request from being accepted a second time. A signature proves a message is authentic but says nothing about whether it is fresh, so protocols add timestamps, single use values, or sequence tracking to ensure each request is honored only once. The threat is subtle because nothing is forged. An attacker who records a legitimately signed request and sends it again is delivering a message that passes every authenticity check. If the operation has an effect, such as transferring value, granting access, or triggering a job, replaying it repeats that effect without the attacker ever knowing the secret. The most common defense is a signed timestamp plus a narrow acceptance window. The receiver rejects anything older than a few minutes, which limits an attacker to a brief opportunity and requires reasonably synchronized clocks on both sides. Clock drift is a frequent operational cause of otherwise inexplicable verification failures. Closing the remaining window requires state. A nonce, meaning a number used once, is generated per request and recorded by the receiver, which refuses any repeat within the retention period. Counters and sequence numbers achieve the same result for ordered channels. Both require storage sized to the acceptance window rather than forever. Replay protection is closely related to but distinct from safe retries. Legitimate clients do resend requests after network failures, and the receiver should treat that as a duplicate to be absorbed rather than an attack. Deduplicating on an event or request identifier serves both purposes at once, which is why the two mechanisms are often built together. ## Key points - Signatures prove authenticity but not freshness - Signed timestamps plus a short acceptance window - Nonces or sequence numbers close the remaining gap - Requires synchronized clocks and bounded storage - Overlaps with duplicate suppression for honest retries ## In practice An internal API signs each request with a timestamp and a random nonce. The receiver rejects requests whose timestamp is more than two minutes old, then checks the nonce against a cache holding the last five minutes of values. A request captured on a compromised network and replayed twenty minutes later fails the timestamp check; one replayed immediately fails the nonce check. ## Related terms - [HMAC Signature](/en/glossary/hmac-signature) - [Idempotency](/en/glossary/idempotency) - [Webhook](/en/glossary/webhook) - [API](/en/glossary/api) - [Rate Limiting](/en/glossary/rate-limiting) [Back to the AI Glossary](/en/glossary)