mlsanityData to 7 Oct 2026

AgentGuard: Learning Execution Guardrails from Anomalous Coding-Agent Trajectories

arXiv 2609.16287 ↗First posted 14 Sep 2026cs.SEcited by 0

On the map: LLM agents and tool use → Software engineering coding agents

also in 1 more
Abstract (arXiv)

AI coding agents increasingly rely on execution harnesses to interact with repositories and external tools. However, task success does not guarantee reliable execution. Agents may still modify unrelated files, rewrite tests, issue unsafe commands, or ignore failed validations, motivating behavioral guardrails for reliable execution. We present AgentGuard, an instruction-level guardrail framework that learns conditional execution constraints from anomalous trajectories of coding agents. Rather than relying on manually specified safety rules, AgentGuard automatically extracts recurring execution failure patterns, generalizes them into instruction-level behavioral constraints, and organizes them as a lightweight guardrail skill that dynamically activates only the rules relevant to the current instruction. This design enables behavioral guidance while minimizing unnecessary restrictions on normal execution. We evaluate AgentGuard using 642 documented failure traces collected from real coding-agent executions across 382 repository tasks. Guardrails are learned from 461 traces covering 282 tasks and evaluated on a disjoint set of 100 tasks. Using Claude Code with Claude Haiku 4.5 as the underlying coding agent, we compare the baseline agent with the same agent augmented by AgentGuard. Experimental results show that AgentGuard reduces the Abnormal Execution Rate from 69.0% to 26.7% and increases the Successful Task Completion Rate from 21.7% to 35.0%. These results demonstrate that execution guardrails learned from historical failures can substantially improve the reliability of AI coding agents while highlighting the remaining challenge of balancing safety and task completion.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. First posted on arXiv 14 Sep 2026.

Builds on

No reference list yet.

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026ClayBuddy: A Framework, Evaluation, & Mitigation of Coding Agent Failures
  2. 2026SpecGuard: Proving a Task Is Broken Before the Agent Cheats
  3. 2026Teaching Agents to Code Reliably
  4. 2026ProcCtrlBench: Evaluating Process-Level Defects and Control Preservation in LLM Coding Agents
  5. 2026AgentRx: Diagnosing AI Agent Failures from Execution Trajectories
  6. 2026ABTest: Behavior-Driven Testing for AI Coding Agents
  7. 2026XAI for Coding Agent Failures: Transforming Raw Execution Traces into Actionable Insights
  8. 2026Guardrails Beat Guidance: A Large-Scale Study of Rules, Skills, and Persistent Configuration for Coding Agents