Agents and bugs

In my (limited) experience AI agents seem to check for errors by trial and error rather than logic.
Recently I was presented with a ‘solution’ simply because JS code had run a small number of times without error…
Similarly working with Swift it compiles therefore it works OK.
Recently SWE-2 failed to spot a logic problem that was obvious to (even) me at first sight.
Am I using the wrong tool or should I accept that eternal vigilance is the price of error free code?
Happy to provide detail if anyone is interested but I suspect it is a wider issue.

Welcome back @rogereve :slight_smile:

Eternal vigilance is the key. We are going to be fast reaching a point (maybe we already reached it) where we won’t have time to review the code an agent generates. All we can do is ensure that the acceptance criteria / CI tests / etc. are thorough enough that logic issues get caught because the output is wrong for a set of known inputs.

Basically…focus on evals, evals, evals, and more evals! :p_mario:

Yeah, this is the right framing — and the evals point lands even harder because of the exact trap rogereve described.

The agent isn’t really checking logic, it’s checking for smoke. Code runs a few times without throwing, so it reports back like the job’s done. “It compiles, therefore it works” is the same bug in a different costume.

The one thing I’d add: the evals have to assert on actual outputs for known inputs, not just “did it run.” A green CI run that only checks exit codes will happily bless wrong logic. Writing the expected output down first — even just in the prompt, before the agent touches anything — has saved me more than once. It’s the closest thing to a seatbelt we’ve got right now.