Tool Call Replay: Definition & Runtime Controls
AI Agent Security

Tool Call Replay: Definition, Risk Conditions, and Runtime Controls

Tool call replay occurs when a previously issued, authenticated tool call made by an AI agent is captured and resubmitted, in whole or in part, to trigger an action again without new authorization. It is exploitable when the call itself, not just the session that carried it, lacks nonces, timestamps, idempotency keys, or binding to its original execution context.

Runtime Controls That Address Tool Call Replay

These controls operate at the tool-invocation layer itself, which is where replay resistance needs to exist independent of session or transport authentication.

Idempotency key enforcement

Require a client-supplied key on tool calls with side effects so the server can recognize and reject a duplicate submission before executing it again.

Short-lived, scoped tokens

Bind tool-call credentials to narrow scopes and short validity windows so a captured call has a limited exploitable lifetime.

Call-level nonce or timestamp validation

Add replay resistance at the tool-execution layer itself rather than relying only on transport or session authentication.

Policy-based execution checks

Apply approval workflows, rate limits, or step-up authorization to high-impact actions independent of whether the authentication token is still valid.

Session and sequence correlation

Tie tool call identifiers to the originating session and conversation to flag calls submitted out of sequence or outside their original context.

Defining Tool Call Replay

Tool call replay is the reuse, resubmission, or manipulation of a previously issued tool call within an AI agent system to trigger an action without fresh authorization. It is a mechanism-level risk rather than an abstract one: it depends on how a specific tool call is structured, authenticated, and executed, not on the broader security posture of the agent. In agent frameworks and Model Context Protocol (MCP) implementations, a tool call is a discrete request, typically structured as a JSON-RPC message identifying a tool name and its parameters. If that call, once valid, can be captured and resubmitted and the receiving system cannot distinguish the replay from the original, the call executes again. This is distinct from an attacker forging new, unauthorized content; replay depends on reusing something that was already legitimate at the time it was issued.

How Tool Calls Are Structured, and Why Replay Is Possible

MCP defines a client-host-server architecture in which a host, acting on behalf of an agent, invokes tools on a server through structured JSON-RPC requests. Each request carries a tool identifier and parameters, and for HTTP-based transports, MCP's authorization specification layers OAuth 2.1 token issuance and scoping on top of these calls. What the base specification does not mandate is per-call replay resistance, such as nonces or timestamp validation, at the tool-invocation layer itself. Authorization in this model governs who can call a tool and with what scope, but it does not inherently verify that a given call instance has not already been executed. This separation between session-level authentication and call-level uniqueness is the structural condition that makes replay a distinct risk from authentication failure alone.

Conditions That Make a Captured Tool Call Exploitable

A valid tool call becomes replayable when specific safeguards are absent. Missing nonces mean the server has no way to reject a call it has already processed. Absent timestamp validation allows a call issued minutes or hours earlier to still be accepted as current. Lack of idempotency keys means the server cannot recognize a resubmission of the same logical request and will instead treat it as a new one, repeating any side effects such as a financial transaction or a data write. Weak session binding compounds this: if a captured call remains valid outside the session or context in which it was originally issued, it can be replayed even while the underlying token or credential has not expired. None of these conditions require the token itself to be compromised, which is why replay is a separate exposure from credential theft.

Tool Call Replay vs. Adjacent Agent Risks

The questions below distinguish tool call replay from related, but separate, concerns in agent tool-calling architectures.

Is tool call replay the same as a traditional web API replay attack?

It applies the same underlying principle, captured requests being resubmitted, but occurs within agent tool-invocation structures like MCP, where the call identifies a tool and parameters rather than a conventional API endpoint.

Does MCP prevent replay by default?

No. MCP's base specification does not mandate per-call