AI Agents

AI agent duplicate actions: when one approval runs twice

One approved AI agent action can still run twice. What a new OpenAI MCP bug report shows, and how to make your agent's writes safe to repeat.

S

SelfAgentic Team

7 min read
Two identical square recesses side by side in a sunlit white wall.

A developer approved one write action for an AI agent over the weekend, and the test server recorded that write twice. According to the bug report on OpenAI's developer forum, the model's final answer still said the write had been called once.

If your agents post, update records or change ad budgets, plan for this: an approval says an action may run, and it says nothing about how many times it will run. AI agent duplicate actions come from retries, reconnects and bugs in the layers between the model and your tools, so you need two habits: make each write safe to repeat, and check what actually happened instead of trusting the agent's summary.

What the OpenAI MCP bug report shows

The report is about MCP, the Model Context Protocol. MCP is a common standard that lets an AI model call tools running on another server, such as "update this page title" or "read this sheet".

In the test, the developer offered the model a write tool that needed approval and a read tool that didn't. After the approval was sent, the response carried on with a read done through OpenAI's programmatic tool calling, where the model writes a small program that calls tools for it. The server log showed write, read, write. Both writes carried the same approval request ID and the same arguments.

The author is careful about what this proves. They ran three runs on 15 November (UTC) against a synthetic server with no real business data, say a shared root cause has not been established, and describe the result as a sample rather than a rate. When we read the thread, no one had replied.

It isn't the first report of its kind. In an earlier forum thread on duplicate tool calls, one developer wrote that "for create operations it results in duplicate entries created." A GitHub issue in OpenAI's Apps SDK examples describes "every tool call being executed twice", which the reporter traced to two MCP sessions opening at once. None of this is unique to one vendor, since any system that retries can repeat itself.

Why do AI agents repeat actions?

An agent run is a relay. The model decides to act, the platform sends the request, a tool server carries it out, and the result travels back. A repeat can start at any handoff:

  • A request times out after it actually succeeded, and something retries it.
  • A run pauses for approval, and the step is replayed when it resumes.
  • A client opens two connections to the same tool server.
  • The model never sees the first result and calls the tool again.

The agent's own report won't catch this. In the OpenAI case the model said "once" while the server counted two, so the tool server's log is the record to trust.

What makes a tool call idempotent?

An action is idempotent when doing it twice leaves things the same as doing it once. "Set the daily budget to ₹6,000" is idempotent: run it again and the budget is still ₹6,000. "Raise the daily budget by 20%" isn't. Publishing a post isn't either, while changing a page title to a fixed string usually is.

Payment APIs have a standard answer. Stripe's documentation on idempotent requests describes the pattern: the client attaches a unique key to a request, Stripe saves the result of the first request with that key, and retries with the same key get the saved response back. Stripe may prune keys once they are at least 24 hours old. Developers in the earlier forum thread landed on the same fix for agents. The model passes a request ID with each tool call, the server filters repeats, and the server returns the original result to a repeat. One developer found their agent got confused when it was told a call had been deduplicated, which is why returning the first result works better.

MCP does include an idempotentHint flag that a tool server can set. But the MCP specification says all tool annotations are hints, are not guaranteed to describe the tool faithfully, and should never drive tool use decisions when they come from untrusted servers. The flag tells you what a server claims, and it can't stop a repeat.

A worked example: one approval, two posts

Here's a hypothetical. Say a three-person team has an agent that prepares two things on Sunday night: a LinkedIn post for Monday and a request to raise a Meta Ads campaign's daily budget by 20%, from ₹5,000. The founder approves both from her phone at 8:40 on Monday.

Now suppose the approval step gets replayed somewhere in the chain. The post goes out twice. The budget goes from ₹5,000 to ₹6,000 and then to ₹7,200. The run summary reads "published 1 post, updated 1 budget", and the founder finds out when someone comments "double post?" under the second copy.

Four changes would have caught or contained it:

  1. Phrase the budget change as an absolute value: "set the daily budget to ₹6,000". A replay then changes nothing.
  2. Give every approved action a key, such as the approval ID, and have the layer that executes tools refuse a second run with the same key, returning the first result.
  3. Read back from the platform after the run. Count posts published in the last hour and fetch the current budget instead of trusting the summary.
  4. Cap outward actions per agent per hour, so a loop can't publish ten times before anyone looks.

FAQ

Can an approved AI agent action run twice?

Yes. The OpenAI report describes exactly that, and the earlier threads show tool calls running twice in other setups. An approval controls whether an action may run, and stopping it from running twice needs a separate check where the tool is executed.

What is an idempotent tool call?

It's a call that leaves the same result whether it runs once or several times, like setting a value rather than adding to it. Writes that create things, such as posts, emails or records, usually need a unique key to be safe to retry.

Does MCP prevent duplicate tool calls?

No. MCP lets a server mark a tool with idempotentHint, but the specification treats that as a hint the client shouldn't rely on from untrusted servers. Deduplication has to be built into the server or the platform that runs the calls.

How do I check whether my agent posted twice?

Check the destination, not the agent's summary. Look at the platform itself, or a tool log that records each call, and compare the count with what the run says it did.

How to prevent AI agent duplicate actions before your next unattended run

Start by sorting your agents' writes into two groups: actions that are safe to repeat, and actions that create something new. The second group (posts, emails, new records, money moves) needs approval, a key checked at execution, and a read-back.

Then ask your platform, or yourself if you built the stack, three questions. What happens when a call times out after it succeeded? Is the approval ID checked when the action executes, or only when it's granted? Where can I see every tool call a run made?

In SelfAgentic, publishing actions wait in an Approvals inbox (we wrote earlier about which agent actions should need approval), each agent has hourly and daily action limits, and every run records which tools were called. Those features don't make a third-party tool idempotent. They do limit how far a repeat can spread and give you a record to compare against what the agent reported. If you chain agents into a workflow, add a final step that compares the reported result with what the destination shows.

Deduplication has costs. Keys need storage and an expiry, and a guard keyed only on the arguments will block legitimate repeats, like the same weekly reminder posted every Monday. Key on the approval or request ID instead. When an API you call doesn't accept a key, the guard has to sit on your side of the call.

One duplicate post deserves more of your attention than a hundred clean runs, because it means a guard is missing somewhere. If you want a team of agents that works inside your tools and checks with you before anything goes out, you can start with SelfAgentic.

Keep reading

Ready to build your AI team?

See how a team of agents handles real work, and checks with you before anything goes out.

Free to start. No credit card required.