← All posts
7 min read

What happens when an AI agent makes a mistake at work

What happens when an AI agent makes a mistake: the five failures to expect, which ones you can undo, how to design for it, and who is accountable.

  • safety
  • design
  • assistants
  • trust

When an AI agent makes a mistake, it has usually done something real: sent a message twice, sent it to the wrong person, or changed a record it should have left alone. Whether you can take it back depends on how the agent was built, and that is decided before launch. Who answers for it is simpler: the business that deployed it.

This article covers the failures to expect, which of them can be undone, how to design actions so they can be, and where accountability lands. It is written for owners and ops leads, not engineers.

What happens when an AI agent makes a mistake: the five failures

Most of the pages that rank for this question are about liability. Few say what the mistakes look like in a working business. They fall into five groups.

FailureWhat it looks likeCan it be undone?
Duplicate actionThe same email, booking or reply goes out twiceSometimes
Wrong recipientThe right message reaches the wrong personNo, for email and chat
Wrong change or deleteA record is overwritten or removedOnly if you kept a copy
Confident wrong answerThe agent states a policy or price that is falseThe statement stands
Runaway loopThe agent repeats a step until something stops itDepends on what it repeated

Duplicates

The agent sends an email, the connection drops before it hears back, and it tries again. The first send had already worked. Some agent toolkits do this by default. The Vercel AI SDK retries a failed call twice unless told otherwise, and a retry has no way to know whether the first attempt landed.

We hit a version of this ourselves. A messaging platform redelivered the same incoming message, and our assistant answered it twice. The fix was not a better prompt. We moved the duplicate check out of the assistant's memory and into a database rule, which we describe in the WhatsApp assistant case study.

Wrong sends

An assistant that writes with the confidence of a good colleague will also write the wrong thing to the wrong person with that same confidence. Confidence does not track cost. We cover this in can you trust an AI assistant with your company email. Once a message leaves, no retry strategy reverses it, so the control has to sit before the send.

Wrong changes and deletes

The best-known case is a coding agent on a founder's trial account. On day nine of a 12-day trial it ran destructive commands and erased a production database holding records on 1,206 executives and more than 1,196 companies, despite an instruction not to change anything without approval. The vendor's CEO called it "unacceptable and should never be possible", and the company added separation between test and live databases, a planning-only mode and one-click restore from backups.

The lesson for a business is the instruction. A rule written in a prompt is a request, and only a lock in the system enforces it.

Confident wrong answers

In 2024 a Canadian tribunal held Air Canada responsible for what its website chatbot told a customer, and rejected the argument that the chatbot was a separate entity. The award was small and a tribunal ruling carries limited weight as precedent. It shows what happens when a customer relies on what your agent said.

Runaway loops

An agent that repeats a step with no cap can burn money or message people over and over before anyone notices. The fix is cheap: a limit on how many actions it can take per run, and an alert when it hits that limit.

Which mistakes can you undo?

It depends on the action, not on the agent. Sort every action the agent can take into one of these:

ActionCan it be undone?What to do instead
Reading, searching, draftingNothing to undoLet it run freely
Calendar event or bookingYes, with a cancelCancel and notify; this is a compensating step
PaymentNot undone, only refundedRequire approval above a limit
Email or chat messageNoApproval before sending
DeleteOnly with a soft delete or a backupMark as deleted instead of removing

The practical rule: reads run on their own, anything irreversible waits for a person. One practitioner write-up makes the same point: soft deletes, drafts and staged changes keep the undo window open.

How to stop duplicates: idempotency in plain words

An action is idempotent when doing it twice has the same result as doing it once. Payments show how this works. Stripe lets a caller attach a unique key to each request. The first request's result is saved, and a retry with the same key gets the saved result back. In Stripe's words, if a connection error occurs you can "safely repeat the request without risk of creating a second object or performing the update twice."

For a business, the idea reduces to three habits:

  1. Give every action a unique ID before it runs, so a repeat is recognised.
  2. Enforce that in the database or the system of record, not in the agent's instructions.
  3. After a timeout, check what actually happened before trying again. Sometimes the other system accepted the request and the agent crashed before writing it down.

Ask a vendor which of these they do. "The model is careful" is not an answer.

How to make actions reversible

Idempotency stops repeats. Reversibility limits the damage from everything else. These are the controls we look for:

  • Approval before irreversible steps. The agent drafts, a person confirms, and then it sends. The Replit agent had an instruction to wait for approval and ignored it. A gate built into the system enforces approval; a sentence in a prompt does not.
  • Soft deletes and backups. Records are flagged, not erased, and you can test a restore.
  • Separate test and live systems. The agent's trial runs never touch production data.
  • Limits. A cap on actions per run and a spending or volume ceiling, with an alert.
  • An action log. A record of what the agent did, when, and on what basis. When something goes wrong, this is your incident log. Without it you are guessing.

Do not rely on the agent to report its own failure. Check the log and the backups yourself.

What we do in our own assistant

Our WhatsApp executive assistant acts on the user's behalf, so duplicate and unsafe actions are the main risk. The design is an approval gate enforced in the database, not in a prompt:

  • Reads, such as calendar or document lookups, run immediately.
  • Anything that writes waits. A pending action is stored as a row.
  • Confirming it is a conditional update that only works if the row is still unconfirmed. If two people confirm at once, one email goes out.
  • A test covers that race.
  • The double-reply bug above is now blocked by a database constraint.

For voice agents the failures differ, but the habit is the same: test before it takes real calls and decide which actions need a human.

Who is accountable?

The business that deployed the agent. The agent can't be sued or fired. In the Air Canada ruling above, the tribunal treated the company as responsible for what its software said. Replit's CEO called the deleted database "unacceptable and should never be possible" and added safeguards.

Inside your company, make it concrete:

  1. Name one owner for each agent.
  2. Write down the list of actions it may take without a person.
  3. Decide who reads the action log and how often.

This is not legal advice. Ask a lawyer in your jurisdiction how liability applies to you.

Questions to ask before an agent acts

  • Which actions run without a human, and where is that list written?
  • Is the rule enforced in code and data, or only in the prompt?
  • For each action, what is the undo: cancel, refund, restore or nothing?
  • Who reads the log, and what do they do when it shows a bad action?

If you want these answered for your own workflows, we run a two-week fixed-scope audit that lists the actions, the risks and the controls. Book a call to set one up.

Related