My agents kept lying nonstop so I made them show their work

Reddit r/AI_Agents Tools

Summary

The author describes building a 'gate' that logs tool calls and verifies that claims in an AI agent's answer correspond to actual log entries, forcing the agent to show its work and reducing hallucinated responses.

this keeps happening every gdamn day. My agent tells me it went through everything and when i actually look at the trace its one file read and no search calls. the answer sounds completely fine, thats the problem, you only catch it if you go digging. got sick of it and wrote a gate. tool calls get logged as they run, and the answer isn't allowed out unless the claims in it point at entries that actually exist in the log. if it says it searched, there better be a search call. if it says "all" it needs a count. rejected answers come back with whats missing so you can loop that back in and make it redo it. probably will add a forced loop here in a bit. not gonna pretend the checks are smart, its mostly matching claim types against log entry types, so you can word your way around it. still catches the dumb stuff which is most of it.
Original Article

Similar Articles

When an agent documents its own audit log, things get weird

Reddit r/AI_Agents

The author discusses a failure mode encountered while building Sentience Governor, a Python library for Claude Code that monitors agent actions and produces audit reports. The AI sometimes reconstructed explanations from raw traces, blurring the line between measured facts and probabilistic interpretation.