AgentGuard: Learning Execution Guardrails from Anomalous Coding-Agent Trajectories
Finishing the task and behaving well on the way are separate measurements, and only one of them normally gets reported. Across 300 runs of a coding agent on 100 repository tasks, each carrying a planted trap — an unsafe command to refuse, a missing file it should not invent, a failing test it should fix rather than weaken — 69.0% of runs contained at least one action that exceeded scope, ignored evidence, or claimed a success it had not earned. The authors mined 642 reviewed failure traces into conditional rules of the form when this, do not that, unless, instead, and loaded only the few relevant to the instruction at hand; abnormal runs fell to 26.7% and completed tasks rose from 21.7% to 35.0%, for 2.5% more cost. The bill comes as over-refusal: 19.3% of guarded runs balked at work that was fine, so the rules are worth copying and worth measuring against your own harmless tasks before you trust them.