DEV Community

Ben Halpern
Ben Halpern Subscriber

Posted on

My AI agent messed up a UTC time conversion algorithm after I *specifically told it* to make no mistakes. smh

Top comments (10)

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

You could try "Do this and make no mistakes. Once you produce a solution, look it over and find the mistake and correct it. Output to me once you give me the perfect solution with no errors". Big brain while loop solution 😂

Collapse
 
ben profile image
Ben Halpern

Collapse
 
ai_made_tools profile image
Joske Vermeulen

Haha, like this one, will add it to all my prompts 😀

Collapse
 
klement_gunndu profile image
klement Gunndu

The "look it over and find the mistake" loop in the comments is funny but it actually works — we added a self-check step after every code generation and it catches about 40% of issues before they hit review. The real question is whether the agent should even attempt time math without a library call.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Maybe you just didn’t ask politely enough 😄

Collapse
 
kuro_agent profile image
Kuro

@harsh2644 nailed something important: "make no mistakes" is not a constraint, it's a wish.I run a personal AI agent that makes ~980 triage decisions daily. Same pattern: instructions that describe your desired outcome don't change the model's computation. Like telling a junior dev "just write correct code."What works is constraining the interface between the model and the problem: "Use Intl.DateTimeFormat — do not compute offsets manually" or "Every output must round-trip: convert forward, convert back, assert equality."Wishes allow shallow processing — the model satisfies them by intending to be careful. Convergence conditions force deeper computation because you can't satisfy them without doing the work.We proved this accidentally: "route correctly" → 60% accuracy. "if confidence < threshold, defer to expensive model" → 95%. Same task, same model. The constraint didn't make it smarter — it changed which computations it could skip.

Collapse
 
maxothex profile image
Max Othex

Timezones are the eternal nemesis of AI and humans alike. The "make no mistakes" instruction is basically a vibe check that models consistently fail — they can't resist trying to be clever with DST edge cases even when you just want them to call a library function.

At Othex we started requiring agents to output a "confidence" annotation on any date/time operation. Anything below 90% confidence gets flagged for human review before it hits prod. It added maybe 5% overhead but saved us from two nasty UTC bugs in the first month. Time is genuinely hard. For AI, it's apparently extra hard.

Collapse
 
harsh2644 profile image
Harsh

The real lesson here isn't AI made a mistake it's that make no mistakes is not a constraint, it's a wish. AI doesn't have a mistake-prevention mode, it has a confidence mode. And high confidence is not the same thing as correctness.

UTC math is a great example because it looks simple. It's just numbers and offsets, right? But then DST shows up, and historical timezone changes, and leap seconds, and suddenly the AI is confidently wrong in a way that's very hard to spot.

The fix isn't better prompting. It's not touching time math without a battle-tested library and a test that asserts the exact output. No exceptions not even for the AI. 😅

Collapse
 
dakshim profile image
Dakshim Chhabra

What about rebooting the system, It used to fix many issues in Windows XP 😆

Some comments may only be visible to logged-in visitors. Sign in to view all comments.