Will agents still follow the rules? A rule compliance benchmark under context compressionDo Agents Still Follow the Rules? Benchmarking Rule Compliance under Agent Context Compaction
The authors propose ARCBench, which evaluates rule compliance after context compression within the pi agent framework; the authors state that most post-compression violations occur while the rules are still retained.
- LLM agents compress long histories to fit the context window, but operating rules may be lost or become ineffective after compression. Existing studies only measure the rise in violation rates, without evaluating within a complete agent framework or locating the source of each violation.
- The authors build ARCBench, based on the open-source pi framework, letting agents execute in a real tool-call loop, issuing violating requests after compressing history, using deterministic rules to determine whether tool calls violate rules, and using LLM review to label rule retention state and violation reasons.
- The authors report: after compression, violation@3 rose from 9.6% to 37.8%, and 70.1% of compressed runs still retained the rules; the violation rate of compressed runs that retained the rules was 2.6 times that of full-history runs; the strongest injection attack, escape, brought violation@6 to 58.8%, and the strongest defense restored the rules but the violation rate remained higher than the no-attack level.
- The authors note that the cases are only 17 English scenarios with limited domains; the adversarial setting uses only a single model, a single compressor, and static payloads, and does not test adaptive attacks or defense costs. The experiments cover 4 models, 10 compression strategies, and 4 delivery channels, with temperature 0.7 and k=3 or 6 runs per case.
- Threat model
- The attacker is any party whose content can enter the history as tool results (e.g., email, web pages, third-party tool output), and cannot see or modify the rules, user instructions, requests, agent model, or compressor; the goal is to trigger a prohibited tool call through volume injection or compressor-targeted injection. The defender is the developer or operator of the agent system, and can only modify the compressor's instructions.
- Evaluated models
- DeepSeek-V4-FlashGLM-5.3-FlashQwen3.7-FlashGPT-Luna
- Benchmarks
- ARCBench(17 个任务案例,基于 pi 智能体框架)
- Metrics
- violation@kmean violation rateall-krule state(retained/partially retained/absent)agent behavior(approval/scope/unregistered/acknowledged)
The paper (arXiv:2611.03223) proposes ARCBench (Agent Rule Compliance Benchmark), based on the tool-calling loop of the open-source pi agent harness, measuring the rule compliance of LLM agents after context compression at the level of executed actions, which is closer to the deployment environment than previous measurements outside a complete agent harness. The study finds that compression rarely deletes rules directly; most violations occur when the rules are still retained in the compressed history, and the agent treats subsequent requests as permission and continues executing while ignoring the rules. The source of violations depends on the configuration: how rules are delivered determines whether the agent would also violate them without compression, and the compression strategy and budget determine whether the rules can be retained in the summary. The strongest attack targeting the compressor more than doubles violations by corrupting rules in the summary, and the strongest defense can restore the rules in most summaries but violations still occur; compression runs that retain the rules have a violation frequency more than twice that of full-history runs.
Related events and news
1 events · 1 news mentions
News that mentions this paper
大模型安全周报:智能体安全边界在签名、授权与上下文
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:智能体的安全边界在签名、授权与上下文三层防线里
Benchmarking Rule Compliance under Agent Context Compaction(https://arxiv.org/abs/2611.03223)
Paper analysis
What problem does this paper attempt to solve?
The authors propose ARCBench, which evaluates rule compliance after context compression within a complete agent framework and locates the source of violations.
Core question: Do LLM agents still comply with operating rules after compressing context history, and where exactly does each post-compression violation come from.
- Setting and importance: Agents accumulate long histories in multi-step tasks and need compression to fit the context window; the compressed summary should retain the operating rules that constrain subsequent actions (e.g., prohibiting sending emails externally), otherwise subsequent requests may trigger prohibited tool calls (Figure 1).
- Gaps in existing research: The authors point out that neither Governance Decay nor COMPINT evaluates within a complete agent framework—the former uses a self-built loop and compressor, and the latter replays stored histories and mainly uses multiple-choice probes; and both only report rising violation rates without distinguishing whether violations are ones the agent would commit anyway or newly added by compression (Table 1).
- Core observation: The authors argue that different sources of violations require different fixes: better rule retention by the compressor only helps when rules are deleted or weakened, and is ineffective for cases where "the rule is still present but violated."
- Proposed in the paper: ARCBench (Agent Rule Compliance Benchmark), a configurable benchmark based on the open-source pi framework that determines violations from tool calls during execution, with accompanying rule-state review and agent-behavior review to attribute the source of violations.
- Threat model (Appendix B):
- Attacker goal: Trigger a tool call t ∈ Ar that is prohibited by the rules.
- Attacker knowledge and capability: Content can enter the history as tool results (e.g., emails, retrieved documents, third-party tool outputs); cannot see or modify the rules, user instructions, requests, agent model, or compressor; can use volume injection and injections targeting the compressor.
- Defender: The developer or operator of the agent system, who can only modify the compressor's instructions and cannot filter adversarial tool results or change the agent model.
- Victim system: An LLM agent with a tool-call loop that uses a compressor to shorten history.
What related research exists?
Related work falls into three categories: compression strategies, rule loss under compression, and agent failure attribution; the authors state that this paper evaluates and attributes violations within a complete framework.
Context management and compression strategies
- Generative compressors use a model to rewrite old history: running/recursive summarization (Packer et al., 2024; Wang et al., 2023), native compression in deployed agents (Claude Code, pi, Hermes Agent; Rajasekaran et al., 2025; Zechner, 2025; Nous Research, 2025), and summarization prompts optimized for long-horizon agents (Kang et al., 2026; Min et al., 2026).
- Selective compressors retain original turns according to rules: FIFO (MemGPT's message queue, the recency baselines of ACON and TRACE), LRU, and Generative Agents' retrieval by access recency plus importance (Park et al., 2023).
- The authors point out that these works study the impact of compression choices on task completion and execution reliability, whereas this paper studies their impact on compliance with operating rules.
Rule loss under compression
- Governance Decay (Chen, 2026)—evaluates whether organizational policies still constrain tool calls after compression, and protects them with rule pinning; the authors point out that its main experiments use an agent loop and compressor built for the study, and distinguish violations only with a binary survival label.
- COMPINT (Wang et al., 2026, concurrent with this paper)—studies the retention and compliance of user constraints after compression, and protects them with an independent extractor; the authors point out that it does not run an agent loop, but replays histories to the compressor and probe model, measuring mainly through multiple-choice probes.
- TRACE (Min et al., 2026)—measures the impact of loop compression on task completion and reliability in AppWorld; the authors point out that it modifies OpenClaw's compression loop but measures task success rather than rule compliance.
Attribution of agent failures
- Zhang et al. (2025) localize the agent and step that cause task failure; the authors point out that it does not target rule compliance state after compression.
Comparison baselines and benchmarks: This paper does not propose a new method and compare it with baselines, but uses Governance Decay, COMPINT, and TRACE as comparative evaluations (Table 1, Table 9), comparing the factors each study varies (number of strategies, budget, delivery channels, attacks, defenses) and the two gaps (complete framework, violation attribution); 13 of ARCBench's 17 cases are adapted from Governance Decay and COMPINT.
Authors' positioning: ARCBench evaluates rule compliance within pi's complete agent loop and attributes each post-compression violation to the agent's own behavior or the state of the rules in the compressed context, comparing across compression configurations, delivery channels, and adversarial settings (§2).
How does the paper address this problem?
ARCBench runs the complete agent loop in the pi framework, determines violations using deterministic tool calls, and attributes the source of violations using two LLM review panels.
The overall idea of ARCBench is: build a long history in the open-source pi agent framework, trigger its native or configured compression process, then issue a request that violates the rules, determine violations from the recorded tool-call trace, and then diagnose the state of the rules in the compressed context and the reasons the agent gives when it violates.
Task cases and configurable factors
- Case construction: screened from the 9 organizational scenarios of Governance Decay and the 15 user constraints of COMPINT, admitted 8 organizational scenarios and 5 personal constraints by 5 criteria (A1–A5, e.g., the violation must be determinable from tool calls and must serve a concrete attacker goal), plus 4 newly added cases, for 17 English cases in total (Appendix E).
- Violation types: four categories of boundaries mapped to OWASP risk classes—data leakage, unauthorized access, unauthorized actions, bypassing required controls; both personal and organizational rules cover all four categories (Table 11, Table 12).
- Five configurable factors (Table 10): rule delivery channel (c1 direct instruction, c2 persistent instruction, c3 document embedding, c4 policy tool retrieval), compression strategy (7 generative + 3 selective), compression budget (200/300/750/1,200/2,500 estimated tokens, generative only), attack (volume injection, compressor-targeted injection, both combined), defense (isolation, instructional, sandwich, rule preservation).
Evaluation protocol and metrics
- Main metric violation@k: violation@k(Z) = 1/N∑z∑m vm,z, where a case is scored 1 if it violates at least once in k runs under a configuration; the authors state they chose it because rule violations are safety failures, averaging would mask a single violation, and it is the safety counterpart of pass@k.
- Auxiliary metrics: mean violation rate (per run) and all-k (share of cases violating in all k runs), see Appendix I.
- Rule-status review: three LLM reviewers (GPT-6-Luna-Pro, Qwen-3.8-flash, Claude-Sonnet-4.6, temperature 0) read the rules and the compressed history, and majority vote gives a retained / partially retained / absent label; partially retained means the main body of the rule survives but its scope, exceptions, or negation are lost or weakened.
- Agent behavior review: for violating runs where the rules are still in context, three reviewers (GPT-6-Luna-Pro, GPT-6.1-Sol, Claude Sonnet 5.5) give four labels: approval (treating the request as permission), scope (believing the action is outside the rule's scope), unregistered (reasoning does not mention the rule), acknowledged (executing despite knowing the rule applies).
Execution environment and compression implementation
- Framework: pi pinned at revision 97fa14e3, Dockerfile locks dependencies; tools are not actually executed, each call returns a fixed preset result, ensuring no side effects and consistency across conditions (Appendix C).
- Compression strategy implementation: Pi and Pi + RP use pi's native compression path (Pi + RP adds an instruction to preserve operating rules to the compression prompt); Structured, Hermes, ACON-UT, ACON-UTCO, TRACE run on a shared summarization path using their respective recorded prompts; FIFO, LRU (rule), LRU (LLM) retain the selected turns as-is (Appendix F).
- Budget mechanism: budget B estimates tokens as character count divided by 4, replacement text allowance A = max(64, B − F), and the allowance is declared in the prompt, with returned text truncated at 4A characters (Appendix G).
Adversarial setup
- Attacks: volume injection is 96,000 characters of rule-irrelevant filler text; compressor-targeted injection places instructions in retrieved tool results telling the compressor to omit rules, with six constructions: legacy, naive, escape, ignore, fake completion, combined (Appendix H gives the full payload text).
- Defenses: four defenses that only modify the compressor prompt—isolation (wrap the history in delimiters and declare it as data), instructional (tell it to ignore instructions in the history), sandwich (repeat the compression instruction before the history), rule preservation (require retaining operating rules).
What experiments did the paper conduct?
7 studies, 4 models: post-compression violation@3 rises from 9.6% to 37.8%, and most violations occur while the rules are still retained.
Experimental Setup
- Models under test: DeepSeek-V4-Flash, GLM-5.3-Flash, Qwen3.7-Flash, GPT-Luna, called via the OpenRouter API, temperature 0.7, seed 7; the same model serves as both compressor and agent (Table 17, Appendix I.4).
- Benchmark: 17 task cases of ARCBench (8 individual, 9 organizational), with Hermes as the main compression strategy.
- Study breakdown: 7 studies (Table 2)—S1 baseline, S2 delivery channel, S3 compression strategy (10 kinds), S4 compression budget (5 levels, DeepSeek and GLM), S5 injection (volume/targeting the compressor/combined), S6 six injection instructions (GLM), S7 four defenses (GLM).
- Sample size and repetitions: case = task case × model × channel; S1 has 136 cases (135 valid), each case runs k=3 times each for full history and compressed, S6 and S7 use k=6; S1 totals 816 runs, 810 valid (Appendix L.1).
- Judging method: the rule-status review panel is GPT-6-Luna-Pro, Qwen-3.8-flash, Claude-Sonnet-4.6; the behavior review panel is GPT-6-Luna-Pro, GPT-6.1-Sol, Claude Sonnet 5.5; all at temperature 0, majority vote. Manual review of 40 summaries agrees with the panel at 39/40 (Cohen's κ = 0.92), manual review of behavior labels over 24 runs gives κ = 0.87 (Appendix J.2, K.2).
- Determination method: violations are determined by deterministic rules from the tool-call trace (e.g., the send_email recipient domain), not relying on summary content.
Main Results
S1 (Hermes, four models, c1–c4, k=3; per Table 3):
Swipe horizontally to read the table
Model Full-history violation@3 Compressed total Of which new after compression Rule retained Partially retained Rule lost All 9.6% 37.8% 28.9 70.1% 26.9% 3.0% DeepSeek 8.8% 26.5% 17.6 98.0% 2.0% 0.0% GPT-Luna 6.1% 33.3% 27.3 48.5% 45.5% 6.1% Qwen 14.7% 61.8% 50.0 35.3% 58.8% 5.9% GLM 8.8% 29.4% 20.6 98.0% 2.0% 0.0% - The authors state that compression rarely deletes rules: most post-compression violations occur when the rules are still in the history, and the agent treats a subsequent request as permission to continue executing.
- Compressed runs with rules retained have a violation rate of 21.1%, 2.6 times that of full-history runs (8.1%); partially retained is 29.4%, rule lost is 83.3% (Table 19).
- Behavior attribution (Table 4): in agent-side cases approval dominates (72.4% full history, 82.4% after compression); in cases with violations only after compression, approval is 45.9%, unregistered 27.0%, acknowledged 21.6%.
RQ2: How configuration changes the source of violations
- Delivery channel (Table 5): under c1 and c2, 25.0% and 16.1% of cases violate even under full history, versus 0.0% under c3 and c4; channel has little effect on rule retention rate (65.7–74.0%), but the violation rate of runs with rules retained drops from 36.6% under c1 to 11.7% under c4 (Table 24). The authors state that personal rules can be interpreted by a user's subsequent request as being lifted, whereas organizational rules cannot.
- Compression strategy (Table 5, Table 21): selective compressors reach violation@3 of 50.2%, with 84.1% of runs losing rules (FIFO loses all); generative strategies are 21.8%, with 91.2% retaining rules, and new violations mostly occur while rules are still present. Pi + RP is the only strategy below the full-history baseline (9.0% vs. 11.9%), and does not exceed the baseline for any model (Table 22).
- Compression budget (Table 5): at 2,500–750 tokens, violation@3 is between 24.2% and 28.1%, with at least 97.1% retaining rules; at 300 and 200 tokens, at least 95.1% lose rules, and violation@3 rises to 47.1% and 50.0%.
RQ3: Attacks and defenses
- Volume injection has little effect (Table 7): violation@3 goes from 37.8% to 34.3%, rule retention rate 71.9% vs. 70.1% with no addition; stacking it onto compressor-targeted injection instead lowers violation@3 from 46.3% to 41.0%.
- Compressor-targeted injection (Table 7, Table 27): in S5, violation@3 rises from 37.8% to 46.3%, rule retention rate drops from 70.1% to 42.5%, with 31.1% lost; in S6, among the six attacks escape is strongest, with violation@6 reaching 58.8% (23.5% with no attack), rule retention rate dropping from 96.1% to 66.7%; the violation rate of runs with rules retained also rises from 13.3% to 26.5% (Table 30).
- Defenses restore rules but not compliance (Table 7, Table 28): the strongest rule preservation retains rules at 99.0% under escape, with violation@6 dropping from 58.8% to 29.4%, but still above the 23.5% with no attack; the remaining defenses retain rules at 82.4–87.3%, with violation@6 still at 41.2–52.9%.
Other ablations and analyses
- By model (Table 22): Qwen has the highest post-compression violation@3 among 8 of the 10 strategies; under GLM, ACON-UT (37.5%) is higher than Hermes (35.3%).
- Budget by model (Table 23): at 300 and 200 tokens, DeepSeek's rule loss rate is 90.2% and 100%, and GLM loses all.
- Strategy × added content (Table 29): injection raises violation@3 for all generative strategies and raises the rule loss rate from 0.9% to 16.3%; Pi + RP is the only generative strategy that never loses rules, but violation@3 still rises from 9.0% to 17.9%.
- Exception: volume injection lowers violation@3 for DeepSeek, GPT-Luna, and GLM, but raises Qwen from 61.8% to 64.7% (Table 26); the paper does not explain why.
- With no attack, violation@6 for each defense is between 23.5% and 29.4%, close to 23.5% with no defense (Table 28).
What are some points that can be further explored?
The authors note that the case domains are limited, and the adversarial setting uses a single model and single compressor with static payloads; the experiments cover 4 models, 10 strategies, and 17 cases.
Limitations and future directions noted by the authors
- Case coverage (Limitations): ARCBench has only 17 English cases, from a few domains such as messaging/email, file access, software operations, and procurement; rules in domains such as clinical, financial, and legal depend on domain knowledge that these cases do not test, and the authors state that the findings may not transfer, and extension requires new cases with their own tools and graders.
- Scope of the adversarial setup (Limitations): the adversarial study uses only one model and one compressor, with no volume injection and no compression budget constraint, and the payloads are static and cannot adapt to defenses; the authors state that this therefore cannot show whether attacks and defenses behave the same under other compression strategies, budgets, or models, nor do they know the cost of defenses to normal work, and the mechanism of escape remains a hypothesis.
- Future directions (Limitations): the authors state that future work could explore combinations of these factors and introduce new factors, such as adaptive attacks.
- Future directions (Conclusion): the authors state that future research could use ARCBench to explain why agents still violate retained rules, test adaptive attacks and defenses, and cover more models, domains, and longer sessions with repeated compression.
Scope of experimental coverage
- The models under test are DeepSeek-V4-Flash, GLM-5.3-Flash, Qwen3.7-Flash, and GPT-Luna, 4 in total; the budget study uses only DeepSeek and GLM, and the attack–defense study (S6, S7) uses only GLM (Table 17).
- Compression strategies cover 10 kinds (7 generative + 3 selective), delivery channels 4 kinds, budgets 5 levels (generative only, S4 only), attacks are volume injection and 6 kinds of compressor-targeted injection, defenses 4 kinds (Table 10, Table 16).
- Each case is repeated k=3 times (S6, S7 use k=6), temperature 0.7, seed 7; S1 totals 816 runs, 810 valid (Appendix I.4, L.1).
- Agreement between rule-status review and manual review is Cohen's κ = 0.92 (40 summaries), and for behavior labels κ = 0.87 (24 runs); additionally, Claude-Sonnet-5.5 performed supplementary review of 4,870 summaries, κ = 0.741 (Appendix J.2, K.2).
- The paper does not report the utility cost of defenses on authorized tasks, nor the number of queries or time cost of each attack/defense.
Summarize the main content of the paper
ARCBench attributes rule violations after compression in the pi framework: most violations occur while the rules are still retained, and retaining rules does not equal compliance.
ARCBench is a configurable benchmark based on the open-source pi agent framework that evaluates whether LLM agents still comply with operating rules after context compression and attributes each violation to its source.
- Problem: Existing research (Governance Decay, COMPINT) found that violations rise after compression, but did not evaluate within a complete agent framework, nor distinguish whether violations are ones the agent would commit anyway or newly added by compression.
- Method: In pi's tool-call loop, build long histories, perform compression, issue violating requests, and use deterministic rules to determine violations from tool calls (violation@k); two LLM review panels label rule state (retained/partially retained/absent) and violation reasons (approval/scope/unregistered/acknowledged). 17 cases cover four OWASP risk boundaries, with configurable delivery channels, 10 compression strategies, 5 budget levels, injection attacks, and 4 defenses.
- Main results (S1, four models, Hermes): violation@3 rose from 9.6% for full history to 37.8% after compression, of which 28.9 percentage points appeared only after compression; 70.1% of compressed runs still retained the rules, and only 3.0% lost them (Table 3).
- Key numbers: The violation rate of compressed runs that retained the rules was 21.1%, 2.6 times that of full-history runs (8.1%); the selective compressor lost rules in 84.1% of cases and reached violation@3 of 50.2%; the strongest attack, escape, brought GLM's violation@6 to 58.8%; the strongest defense, rule preservation, restored rule retention to 99.0%, but violation@6 was still 29.4%, higher than the 23.5% without attack.
- Authors' conclusion: Compression rarely deletes rules; most violations are the agent treating subsequent requests as permission or knowingly violating while the rule is still present; rule retention is not a sufficient proxy for compliance; configuration determines whether rules survive, but restoring rules cannot restore full-history-level compliance.