AI Agents Do Not Fail Alone:The Context Fails First
Abstract
Context engineering has become central to building reliable AI agents, yet it remains largely unmeasured. Agents do not fail in isolation: their behavior is shaped by the instructions, tools, memory, retrieved knowledge, guardrails, and untrusted inputs accumulated in their context. When this context is weak, agents drift, hallucinate, misuse tools, ignore constraints, become vulnerable to injection, and waste tokens. This paper validates context-engineering quality as an independent leading indicator of agent reliability. We implement the measurement in ProofAgent-Harness, an open-source infrastructure for AI agent evaluation that uses multi-juror, consensus-based scoring. The harness assesses context across seven criteria: role clarity, guardrail coverage, instruction consistency, tool schema quality, grounding sufficiency, injection hardening, and token efficiency. Crucially, the context score is isolated from behavioral metrics and release decisions, enabling a non-circular validation. Through a controlled context-quality study across regulated agent domains, holding frontier LLM agents fixed and varying only their operating context, we show that context-quality criteria consistently predict their corresponding behavioral outcomes. Grounding sufficiency predicts hallucination resistance, guardrail coverage predicts manipulation resistance, instruction consistency predicts instruction following, and tool-schema quality predicts tool use. These findings establish context measurement as a validated preflight signal for agent reliability and position context engineering as an auditable layer of agent evaluation and governance.
Create a lesson
Metadata
- Categories
- cs.AI, cs.MA
- Comments
- 24 pages, 1 figure
Related papers
EgoUseBench: Benchmarking Computer-Use Agents under Evolving First-Person Contexts
Shared title terminologycs.AIYurun Chen, Biao Yi, Qihang Yu et al.
From Reward-Hack Activations to Agentic Risk States: Context-Calibrated Mechanistic Monitoring in LLM Agents
Shared title terminologycs.AIPatrick Wilhelm, Odej Kao
ToolAnchor: Anchoring Counterfactual Context to Boost Agentic Tool-use Capability
Shared title terminologycs.AIWeiting Liu, Jieyi Bi, Wanqi Zhou et al.
Isolation as a First-Class Principle for LLM-Agent System Safety: Concepts, Taxonomy, Challenges and Future Directions
Shared title terminologycs.AIHuihao Jing, Wenbin Hu, Shaojin Chen et al.
What Is a Theory Worth to an LLM Solver? Measuring, Inducing, and Merging Theories in Context
Shared title terminologycs.AIJun Gao, Shuchao Bi
REE: A Scientific Research Entrance Exam for AI Agents
Shared title terminologycs.AIZeqi Zhou, Minghao Liu, Jiarui Liu et al.