All writing

Essay

The Model Is Rarely the Problem: Why AI Agents in Ecommerce Fail on Stale Data

When an AI agent goes wrong in ecommerce, it’s rarely the model. It’s the stale stock, price and returns data underneath it. Here’s how a normal Friday flash sale goes wrong, the four checks I’d want before an agent touches anything irreversible, and how we built Keeyu around it.

Tahir Rauf6 min read

Most AI agent failures in ecommerce don’t come from bad models or hackers. They come from agents doing exactly what they’re told on stale data.

We spend a lot of energy on the dramatic risks. Which model hallucinates less. Whether someone can talk the agent into a 90% discount. Prompt injection, jailbreaks, rogue behaviour. Those risks are real, and worth guarding against.

But the failure I expect to see far more often is quieter. The agent reasons well, follows its rules and does what it was built to do. It’s just acting on a picture of the business that stopped being true hours ago.

Same agent, same rules, different data — fresh stock data stops the sale; a feed synced three hours ago keeps it going

A Normal Friday Flash Sale

Here’s how a normal Friday flash sale goes wrong.

The brand’s AI agent is doing everything right: answering customers, approving refunds, pushing price updates to every channel. Except the stock feed from the warehouse is 3 hours behind.

So the agent keeps selling a hoodie that sold out at lunch. Customers complain, and it refunds them instantly, like it’s meant to. Including a bunch of returns the warehouse never actually received. Meanwhile the marketplace listing still shows the old price, because that sync failed silently.

By the time anyone notices, the damage isn’t one bad order. It’s an afternoon of them:

  • Orders for stock that doesn’t exist, each one a disappointed customer and a cancellation to process.
  • Refunds paid out for parcels still sitting in a depot, or that never left the customer’s house.
  • A marketplace selling at the wrong price, with nothing in the logs to say so.

No rogue AI. Just an agent doing its job well on wrong data.

The Friday flash sale: the hoodie sells out at lunch, but the stock feed the agent sees is three hours behind, so it keeps selling all afternoon

Why Nobody Catches It

Every action the agent took was correct for the data it had. That’s what makes this failure so hard to see.

  • The logs look clean. Each decision follows the rules. Nothing errored. Audit any single action and it checks out.
  • Silent failures stay silent. A sync that fails without raising an alert looks exactly like a sync with nothing new to say. The agent can’t tell the difference.
  • The agent has no gut feel. A person on the support desk might stop and say, “Hang on, didn’t we sell out of those at lunch?” The agent only knows what the feed tells it. If the data doesn’t carry its own age, a three-hour-old number looks like now.
  • Speed multiplies the mistake. A person working off a stale spreadsheet makes a handful of bad calls before someone notices. An agent working off a stale feed makes them at machine speed, across every channel, all afternoon.

That last one is the real shift. Automation doesn’t create bad data. It removes the friction that used to stop bad data turning into bad decisions.

What I’d Want Before an Agent Touches Anything Irreversible

Answering a question on stale data is an annoyance. Sending money, changing a price or selling stock on stale data is a loss. Before an agent does anything you can’t take back, I’d want four things in place:

  • Fresh data, or no action. The stock and price it’s acting on should be fresh, not “last synced 3h ago”. Every number should carry its age, and every irreversible action should have a freshness limit. If the data is older than that, the agent waits or asks. It doesn’t guess.
  • Refunds checked against an actual warehouse receipt, not just a carrier scan. A carrier scan means a parcel is moving. A warehouse receipt means it arrived and someone checked it. Only one of those should release money.
  • Hard limits on how much it can refund or reprice in an hour. Caps on refund value, price changes and discounts. When bad data gets through (and eventually it will), it does bounded damage instead of an afternoon of it.
  • A human in the loop when the numbers look weird. A spike in refunds, a price moving further than it ever has, stock going negative. Those are signals to pause and ask someone, not to carry on faster.

None of this makes the agent less capable. It’s what makes it safe to let the agent do more.

Four checks before anything irreversible: fresh data, a real warehouse receipt, hourly limits, and a human when the numbers look weird

Keep the Plumbing Separate From the Agents

This is how we built Keeyu.

The data pipeline is kept completely separate from the agents. It’s deterministic, boring and reliable, and it does the exact same thing every single time. Same input, same output. No judgement calls.

The agents only ever act on top of that. So they start from data you can trust, instead of guessing on whatever got synced last.

That split matters for three reasons:

  1. You can test the pipeline like normal software. Deterministic code can be replayed, tested and audited. A model’s reasoning can’t, so keep the part that has to be exactly right out of the model’s hands.
  2. When something goes wrong, you know where to look. Was the data wrong, or was the decision wrong? With the two tangled together, every incident becomes a guessing game. Kept apart, it’s usually obvious which one it was.
  3. The agents get to be good at what they’re good at. Working out why an order is stuck, deciding who needs to know, writing the message. They don’t also have to be part-time data engineers.

On top of that, teams approve every workflow, and every action an agent takes is transparent and reversible. We don’t automate chaos. We make the inputs trustworthy first, then let the agents work.

Keep the plumbing separate from the agents: a deterministic data pipeline prepares trusted, timestamped data, and the agents act only on top of it

The Honest Read

When an agent does something dumb in production, the instinct is to blame the model. Swap it, tune the prompt, add another layer of instructions. Most of the time, that’s debugging the wrong layer.

The better first question is a boring one: what was this agent looking at, and how old was it?

If you can’t answer that in one click, your agents aren’t ready to touch money, prices or stock. Fix the plumbing first. The intelligence on top is the easier part.

The model is rarely the problem. The plumbing underneath it is.

More ideas