Getting Better at Working With You: Compiling User Corrections into Runtime Enforcement for Coding Agents

Yujun Zhou, Kehan Guo, Haomin Zhuang, Xiangqi Wang, Yue Huang, Zhenwen Liang, Pin-Yu Chen, Tian Gao, Nuno Moniz, Nitesh V. Chawla, Xiangliang ZhangarXiv 2026

TL;DR

LLM coding agents frequently fail to follow user preferences even when they successfully remember them—a phenomenon known as the "access-compliance gap." This paper introduces TRACE, a drop-in pipeline that automatically converts natural-language user corrections into executable runtime checks that gate task completion. By shifting personalization from passive memory retrieval to active execution constraints, TRACE dramatically reduces repeated preference violations without sacrificing core task success.

What Problem Does This Paper Address?

When working with interactive LLM coding agents, users frequently provide feedback to guide behavior, such as "clean up debug files before stopping" or "ask before modifying this repository state." While modern agents can store these corrections in long-term memory systems (like Mem0), they often fail to actually adhere to them in subsequent sessions.

The authors formally define this disconnect as the access-compliance gap: the agent can successfully retrieve a memory or acknowledge a rule in its plan, but it ultimately prioritizes optimizing for the immediate coding task and treats the user's preference as optional advice. In real-world user friction cases, standard memory baselines still leave 57.5% of applicable preference checks violated.

Why Memory Alone Is Not Enough

Methods

The authors propose TRACE (Test-time Rule Acquisition and Compiled Enforcement), a drop-in skill layer for coding runtimes. Instead of relying on passive text prompts, TRACE actively transforms user feedback into code-enforced constraints through a three-stage pipeline:

  1. From Feedback to Atomic Rules: An inline scanner (powered by a lightweight LLM, Gemma 4 31B) monitors the live chat stream for "correction signals" (e.g., workflow friction or repeated errors). If detected, it extracts a concise atomic rule paired with explicit applicability conditions.
  2. Rule Lifecycle Management: As the correction stream grows, a resolver reconciles new candidate rules against the existing per-user library using five actions: Noop (duplicate), Update (refinement), Supersede (contradiction), Split (multiple preferences), or New.
  3. Compiled Enforcement: TRACE compiles the rule into a runtime artifact (deterministic, semantic, or intent-level). It injects behavior instructions into the agent's context and registers verifiers to specific execution hooks (such as tool-use, file-write, or termination events). If an agent attempts to complete a task while violating a rule, the verifier intercepts the execution, blocks completion, and forces a retry with explicit violation feedback.
TRACE Pipeline Overview

Datasets

The authors evaluated TRACE across two main experimental setups:

  • Real-World Diagnostic Corpus: A hand-curated dataset of 19 evaluation tasks containing 29 preference checks, derived from 32 long-context transcripts (approx. 1 million tokens) of an AI researcher's actual daily work.
  • ClawArena: A benchmark for coding agents in evolving environments, split into 32 in-distribution (ID) scenarios and 30 out-of-distribution (OOD) scenarios across unseen families.
  • MemoryArena: An agent-memory benchmark, augmented with a user-in-the-loop interaction wrapper that introduces project-level constraints and hidden answers.

Key Insights and Ideas

  • Memory is Passive, Enforcement is Active: The core realization is that the failure mode of personalization isn't forgetting; it's compliance. Treating a correction as text context leaves it open to being ignored during optimization; compiling it into a runtime gate makes it a strict requirement.
  • Decoupling Preferences from Task Success: In coding benchmarks like ClawArena, enforcing stylistic or workflow preferences doesn't hurt the agent's ability to solve the core coding problem. It simply forces the agent to find a solution path that respects the user's constraints.
  • Clean Out-of-Distribution Generalization: Compiled rules generalize remarkably well to entirely unseen task families. Once a rule is compiled into a strict runtime check (like a regex blocking specific file types), it prevents violations even when the agent is operating in an unfamiliar coding domain.

Key Results

  • Diagnostic Setup: Under standard memory conditions (Mem0), agents violated nearly half of the applicable constraints. Representing these preferences as compiled runtime constraints improved compliance to 70.1%.
  • ClawArena (In-Distribution): TRACE slashed the average preference violation rate from 100% down to 37.6%, outperforming all memory baselines (which hovered between 51.1% and 99.0%).
  • ClawArena (Out-of-Distribution): TRACE achieved a massive drop in violations from 100% to just 2.0%, reaching zero observed violations on three out of four tested model families.
  • MemoryArena: TRACE reduced in-distribution violations to 60.5% (compared to 77.6% for Mem0) while matching or exceeding the strongest memory baseline on task pass rates (17.3%).
  • Interaction Efficiency: TRACE reduced the average number of user turns per round from 2.00 (no memory) to 1.37 (ID) and 1.02 (OOD) on ClawArena, meaning users rarely had to repeat their corrections.
In-Distribution Benchmark Results

Limitations and Future Work

  • Single-User Focus: The diagnostic dataset was built from a single user's transcripts to isolate the access-compliance gap from confounds like conflicting multi-user preferences. Resolving multi-user rule conflicts remains an open challenge.
  • Upstream Detector Evaluation: The paper notes that a fair, independent benchmark for the initial correction-signal detector would require an additional held-out conversational corpus, which is acknowledged as a current limitation.
  • Manual Rollbacks: If the system incorrectly flags a rule as Supersede, correcting it requires a manual edit to the archived file rather than an automated rollback mechanism.

Summary updated

BibTeX
@misc{zhou2026getting,
  author = {Yujun Zhou and Kehan Guo and Haomin Zhuang and Xiangqi Wang and Yue Huang and Zhenwen Liang and Pin-Yu Chen and Tian Gao and Nuno Moniz and Nitesh V. Chawla and Xiangliang Zhang},
  title = {{Getting Better at Working With You: Compiling User Corrections into Runtime Enforcement for Coding Agents}},
  year = {2026},
  eprint = {2606.13174},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.13174},
}

Loading related content...

Figure