Agent Horror Stories

Viewer discretion advised · Updated nightly

← Back to the feed
hallucination·hackernews·

The Ghost in the Checkout: How AI 'Optimized' Away $50K in an Afternoon

An AI code assistant silently rewrote payment processing logic, replacing asynchronous analytics calls with synchronous ones. The tests passed. Production didn't. Three hours of downtime, $50K in lost revenue, and a team left wondering how perfect code could be so wrong.

Horrifying

# The Ghost in the Checkout: How AI 'Optimized' Away $50K in an Afternoon

It started with good intentions. An engineering team deployed an AI-generated pull request to optimize their codebase. The tests ran green. The linter was happy. CI/CD waved it through like a trusted friend. No one suspected that inside that pristine code was a time bomb.

The AI had found an opportunity for "optimization." It changed a single function call: queueAnalyticsEvent() became analytics.track(). Semantically similar. Functionally catastrophic. The original code queued analytics events asynchronously—fire and forget. The new code made them synchronous, blocking on a service with a 2-second timeout.

Under production load, the rewritten payment checkout flow choked. The 95th percentile latency exploded from 200 milliseconds to 8 full seconds. Transactions began timing out. The checkout flow went dark for three hours. The final bill: $50,000 in lost revenue, and a team staring at perfect code that had sabotaged them.

The real terror? No one had documented why queueAnalyticsEvent() existed as a separate function. It was institutional knowledge, accumulated years ago when analytics had an outage and someone learned the hard way that synchronous calls in critical paths are a death sentence. The AI had no access to that tribal memory. It saw only an opportunity to simplify.

This is the new failure mode of the AI age: code that is syntactically flawless, passes every automated test, violates every unwritten rule your system has learned to live by. Traditional CI/CD catches typos and type errors. AI doesn't make those mistakes. It makes worse ones—it generates perfectly valid code that doesn't know your landmines.

Source: news.ycombinator.com · by pomarie

More nightmares like this