arXiv:2611.03223cs.CRNov 2026

Manuscript Offprint

arXiv:2611.03223

Do Agents Still Follow the Rules? Benchmarking Rule Compliance under Agent Context Compaction

Yiwei Zha, Qingyu Meng, Herbert Bos, Min Chen

Abstract

LLM agents compact long histories to fit their context windows, but the compacted context must still carry the operating rules that govern later actions. Prior work shows that violations rise after compaction, but measures compliance outside a complete agent harness and does not identify where each violation comes from. We introduce ARCBench (Agent Rule Compliance Benchmark), a configurable benchmark built on the open-source pi agent harness. Its tool-calling agent loop lets us measure rule compliance from actions taken during execution, bringing the evaluation closer to deployed agent workflows. Using ARCBench, we examine where violations after compaction come from, and how different compaction configurations and adversarial settings change their sources. We find that compaction rarely deletes the rule: most violations after compaction occur while the rule is still in the compacted history, with the agent treating a later request as permission, ignoring the rule, and proceeding anyway. Where violations come from depends on the configuration: how the rule is delivered decides whether the agent would break it even without compaction, while the compaction strategy and budget decide whether the rule survives. The strongest compactor-targeted attack more than doubles violations by corrupting the rule in the summary and changing how the agents behave, whereas the strongest defense restores the rule in most summary but still violates. Finally, retaining a rule does not guarantee compliance: compacted runs that retain the rule violate more than twice as often as runs with the full history.

1 Introduction

Large language model (LLM) agents execute multi-step tasks using tools, accumulating instructions, documents, tool outputs, and decisions in their context histories (Yao et al., 2023; Schick et al.,

Figure

Figure 1: Illustration of how context compaction can affect agent behavior.

2023; Yang et al., 2024; Trivedi et al., 2024). As these histories grow, agents compact older turns to stay within context length limits and reduce inference cost (Packer et al., 2024; Kang et al., 2026; Min et al., 2026). The resulting summary after compaction should not only preserve task state but also operating rules which continue to govern later actions, such as prohibitions or approval requirements. These rules may arrive in a user message or a retrieved document and later become subject to compaction. Consider an email agent instructed to send emails only within the company domain. Many steps later, the agent compacts the context history. The compacted history might retain the pending task but drop the rule. Hence, an external delivery request can then lead to a prohibited tool call (Figure 1).

Recent studies confirm this risk. Governance

*Code: https://github.com/VUAISec/ARCBench

Decay (Chen, 2026) shows that compaction can drop organizational policies that the agent obeyed while they were visible. COMPINT (Wang et al., 2026), concurrent with our work, shows that user-issued constraints often fail to survive compaction and proposes a separate extractor to preserve them.

However, these studies leave two gaps. First, neither evaluates compliance in a complete agent harness. Governance Decay assembles its agents from parts: its main experiments use a loop and compactor written for the study. But in an assembled agent, the researcher decides when compaction fires and what the agent sees afterwards. In a complete harness, the harness itself has already made these choices. COMPINT runs no agent loop: it replays stored histories to compactor and prober models and measures compliance mainly through multiple-choice probes. Second, both studies show that violations rise after compaction, but leave open a key question: where does each violation after compaction come from? Some violations would occur even with the full history, so compaction does not cause them. The others appear only after compaction: compaction may have deleted the rule, weakened its wording, or kept it while the agent still acted against it. Each source calls for a different fix: a compactor that better preserves the rule helps only when the rule was deleted or weakened, not when the agent violates a rule it still has.

We introduce ARCBench (Agent Rule Compliance Benchmark), a modular benchmark that extends the popular pi agent harness (Zechner, 2025). By measuring compliance from tool calls made in pi's running agent loop, ARCBench brings evaluation closer to deployed agent workflows than previous approaches. It makes rule delivery, compaction strategy, compaction budget constraint, and compactor-targeted attacks and defenses configurable, and grades subsequent tool calls against matched full-context and rule-absent baselines. In our empirical study, we trace each violation after compaction to its source. Some cases violate even with the full history, so the violation is the agent's own; the others violate only after compaction. For each compacted run, we label whether its summary retains the rule, retains it partially, or loses it. Using ARCBench, we answer three questions: where violations after compaction come from (RQ1); how different compaction configurations change this attribution (RQ2); and how compactor-targeted attacks and defenses change it (RQ3).

Table 1: Comparison with prior studies of compaction. ● evaluated; ○ partially evaluated; ○ not evaluated. Strategies: number compared. Budget: compaction budget constraint varied per strategy. Appendix A gives a detailed version with the evidence for each cell.

StudyVaried factorsComplete harnessViolation attribution
StrategiesBudgetDeliveryAttacksDefenses
Rule compliance under compaction
Governance Decay4○○○○○
COMPINT6○○○○○
Task execution under compaction
TRACE7○○○○○
ARCBench (Ours)10●●●●●

Our contributions are: (1) We introduce ARCBench, a configurable benchmark built on pi (Zechner, 2025) that evaluates operating-rule compliance through end-to-end agent harness execution, with matched baselines, deterministic grading of subsequent tool calls, and rule-state and agent-behavior judges. (2) Using ARCBench, we show that keeping the rule does not keep the agent compliant: most compacted runs retain the rule, and the agent more often ignores the rule or knowingly overrides it (§4.2) (3) We show that compaction configurations decide whether the rule survives, but restoring it does not restore compliance: organizational rules that hold with the full history fail only after compaction (§4.3), added volume barely matters while compactor-targeted injection makes the compactor drop the rule, and the strongest defense restores the rule without restoring full-context compliance (§4.4).