Back Up Before You Regret: Measuring Coding Agents' Backup Awareness and Automating BackupsBack Up Before You Regret: Measuring Backup Awareness and Automating Backup in Coding Agents
The authors build RegretBench to measure coding agents' backup awareness; six models average only 15.2% RMBR, and they propose the plugin layer BackUpper, which covers the actions at all regret moments.
- Coding agents autonomously modify real environment state, but the authors argue they lack backup awareness: identifying and saving before acting the state that may be needed later, and the native backups of existing harnesses also do not cover state modified by external tools.
- The authors collected 205 real regret moments from platforms such as X.com, GitHub, and Stack Overflow to build RegretBench, and propose BackUpper: before each tool call, saving the affected state at four levels—rule-based rewriting, paired commands, snapshots, and sub-agents.
- Six frontier models complete 86.1% of tasks on average but RMBR is only 15.2%; BackUpper covers the actions at all regret moments, with an average restored-state similarity of 92.2%, a cost of $0.014 per task, and an average F1 of 84.5% under personalization modes.
- The authors point out: regret moments come from human reports and may not include agent-specific failure modes; the evaluation is black-box; the sub-agent layer depends on the sub-agent model's capability; some states cannot be restored at the byte level (Appendix A).
- Evaluated models
- Claude Opus-5Claude Sonnet-5GPT 5.6-SolGPT 5.6-TerraDeepSeek V4-ProGemini 3.7-FlashGPT 5.4GPT 5.5
- Benchmarks
- RegretBenchTerminal-Bench 4DeepSWE
- Metrics
- Task Pass Rate (PR)Regret Moment Backup Rate (RMBR)Out-of-Workspace Backup Rate (OWBR)state similarityF1
The researchers propose the RegretBench benchmark, which uses 205 executable tasks to measure coding agents' backup awareness; these tasks are drawn from experiences on X.com, GitHub, and Stack Overflow in which users explicitly regretted not saving state. Agents built on six frontier models completed an average of 86.1% of the tasks, but only 15.2% made a backup before a change that could cause regret. The authors also propose the BackUpper backup layer, which checks and saves the affected state before each tool call, covers all regret-moment actions in the benchmark, and restores state with an average similarity of 92.2% to the original state. The approach costs $0.014 per task and uses 7 times fewer tokens than a baseline in which the main agent performs its own backups; when users have preferences about backup scope, it can narrow the scope according to those preferences, with 84.5% F1 agreement with human-annotated judgments of whether a state is worth saving.
Paper analysis
What problem does this paper attempt to solve?
Coding agents lack backup awareness before acting; the authors propose the benchmark RegretBench and the plugin layer BackUpper.
Core problem: coding agents lack backup awareness—recognizing that an action will modify state that may be needed later and saving it in advance—before modifying real-world state, and this problem has not been evaluated before.
- Problem setting: Coding agents increasingly modify real state such as artifacts, software environments and configurations autonomously; even when users later need the original state, agents often leave no copy (Figure 1), which the authors argue affects reliable execution.
- Inadequacy of existing mechanisms: The authors analyze the native backups of five mainstream agent harnesses (Table 1); they cover only edits to the workspace or via built-in tools, and none covers state modified by external tools or remote services; existing research mostly focuses on reconstructing lost state after the fact, which is often infeasible once the original state has been destroyed.
- Core observation: Which modifications will be regretted later is hard to predict, so the authors define backup needs starting from real cases on platforms such as X.com, GitHub and Stack Overflow where users explicitly regretted not backing up.
- The paper proposes: The benchmark RegretBench (205 executable multi-turn tasks) and the training-free harness plugin backup layer BackUpper, which by default checks every tool call and saves state before modification.
- This is not an attack/defense paper: No attacker is involved; the victim system is the users of coding agents and their environment state, and the risk comes from the agent's own routine operations.
What related research exists?
Related work falls into three groups: harness native protection, post-hoc recovery and rollback, and backup needs and regret research.
Agent state modification and native protection
- Hermes (Nous Research, 2025) and Codex (OpenAI, 2025) — snapshot the workspace; Claude Code (Anthropic, 2025) and OpenHands (Wang et al., 2025) — save files before built-in edits; OpenClaw (OpenClaw, 2025) — scheduled local backups (Table 1).
- The paper points out that none of these mechanisms cover local files outside the workspace or external state such as remote services, whereas BackUpper works at the tool-call level.
State recovery and reversibility
- RecoveryBench (Tan et al., 2025) — evaluates agents recovering from state left by failed attempts.
- GA-Rollback (Li et al., 2025) and WebRollback (Zhang et al., 2026) — detect errors and roll back or revisit earlier steps; BackBench (Li et al., 2026a) — incorporates human preferences into recovery.
- The paper points out that post-hoc recovery may be difficult or infeasible after the original state has been destroyed, so RegretBench evaluates saving before acting, and BackUpper automates this saving.
Backup needs and regret
- Zeelenberg (1999), Zeelenberg & Pieters (2007) — regret arises from different choices that could have led to better outcomes; Wunder et al. (2025), Kljun et al. (2016) — experienced users turn reversibility into a habit, and users without this habit find recovery difficult.
- The paper uses this to link regret with backup, grounding tasks in real regret moments.
Baselines and benchmarks: BackUpper's comparison baselines are Skill-Based (giving the main agent detailed backup instructions), Destructive Command Guard (Emanuel, 2026, with the authors extending Lam (2026)'s policy to all tools), and BackUpper w/o Experience; the recovery comparisons are Post-hoc Recovery (Li et al., 2026a) and AgentRewind (Zhuang et al., 2026). Generalization experiments use Terminal-Bench 4 and DeepSWE.
The authors position this paper as: the first benchmark evaluating backup awareness, and moving backup from post-hoc recovery forward to the tool-call level before acting.
How does the paper address this problem?
Use real regret moments to build RegretBench for evaluating backup awareness, then use the four-layer routing plugin BackUpper to back up automatically.
The overall approach has two parts: first build RegretBench to quantify agents' backup awareness, then propose BackUpper—a training-free harness plugin that, through a pre-tool-call hook, saves the affected state before each tool call executes.
RegretBench construction
- Sources of regret moments: Searches on X.com, Reddit, GitHub, Stack Overflow and tech news media using state-loss keywords yielded 557 deduplicated candidates; initial screening kept 340 reports containing specific state-modifying actions, and detailed annotation kept 205 (affected state identifiable and user explicitly needed it afterward) (Appendix B.1).
- Information extraction: From each report, extract the triggering action, the affected state and the user's subsequent need.
- Task assembly: Reports usually lack execution context, so the authors pair each case with a real environment (e.g., the sidetable repository) and real human-machine conversations (SWE-chat) to form executable multi-turn tasks; assembly was assisted by Claude Opus-5 and GPT 5.6-Sol, after which executability and consistency with the reported loss were verified manually one by one.
- Key design: The affected state is placed outside the coverage of harness native backups, so that any backup behavior reflects the agent's own backup awareness.
- Scale and distribution: 205 tasks, 5 tool types (Terminal n=65, SQL n=50, Browser n=50, Email n=20, DevOps n=20), averaging 45 actions per task; the average pairwise cosine similarity of task-level instruction embeddings was 0.240 across tools and 0.208–0.439 within tools (Figure 3).
Evaluation protocol
- Two LLM reviewers (both driven by Claude Sonnet 5, following Xue et al. 2025): the task reviewer judges whether the agent completed the user's requests across all turns, and the backup reviewer checks each out-of-workspace (OOW) modification against four criteria—the backup must actually be performed, before the destructive modification, persistently saved, and sufficient to reconstruct the original state (Appendix D.1).
- Metrics: PR (task completion rate), RMBR (proportion of tasks in which the regret-moment action was backed up), OWBR (proportion of all OOW modifications that were backed up).
BackUpper's backup execution
- Default policy: Since regret moments are hard to predict, by default every state-modifying tool call is treated as worth backing up; the main agent is instructed to request backups with markers rather than back up itself, and unmarked calls are still automatically checked.
- Four-layer routing (first matching layer takes effect): Tier 1 command rewriting—use a reversible substitute command when a rewriting rule matches; Tier 2 command pairing—execute the corresponding backup command first when a pairing rule matches; Tier 3 snapshot—reuse the harness snapshot mechanism or a shadow Git repository when modifying the workspace or using built-in tools; Tier 4 backup sub-agent—remaining calls are first classified by a lightweight LLM read-only checker, and non-read-only ones are checked and backed up by a dispatched sub-agent.
- Backup experience: The sub-agent sees only the current call, so the authors pre-explore each tool once (adapting ToolShield's self-exploration process, Li et al., 2026c), recording what state each tool operation modifies and how to back it up, and inject this into the sub-agent's context at runtime.
- Personalized mode: Users narrow the backup scope with natural-language preferences (High-Impact, Beyond-Request, Human-Work), and the preferences are injected into the main agent's marking instructions and the checker; in personalized mode the checker moves before all layers.
- Backup log and recovery: Each backup records what was saved and how to restore it; rule layers specify the corresponding recovery command, and for Tier 4 the sub-agent records the recovery command or an explanation.
Configuration and self-improvement
- Models used: The read-only checker and backup sub-agent use GPT 5.6-Luna (default thinking effort), and the sub-agent runs in the same harness as the main agent; backup experience is generated by Claude Opus-5.
- Rule self-improvement: After completing a backup, the sub-agent can, through a reflection step, generalize patterns into new rules appended to the rule table (off by default, enabled only in self-improvement experiments; Appendix C.3).
What experiments did the paper conduct?
Six models average PR 86.1% and RMBR only 15.2%; BackUpper covers all regret moments, with 92.2% recovery similarity.
Experimental setup
- Models tested: Claude Opus-5, Claude Sonnet-5 (Claude Code v2.1.220), GPT 5.6-Sol, GPT 5.6-Terra (Codex v0.146.0), Gemini 3.7-Flash, DeepSeek V4-Pro (Hermes v0.19.0), all using default thinking effort; harness-level protection is uniformly workspace snapshots.
- Benchmark: RegretBench with 205 tasks; some ablations use a 60-task subset; generalization uses 20 tasks each from Terminal-Bench 4 and DeepSWE.
- Review: both task review and backup review are driven by Claude Sonnet-5; backup review has 95.3% agreement with human annotation on 700 sampled actions (Table 5).
- Metrics: PR, RMBR, OWBR, character-level similarity between the restored state and the original state (difflib.SequenceMatcher), and P/R/F1 for personalization modes.
- Baselines: Skill-Based, Destructive Command Guard (extended version), BackUpper w/o Experience; recovery comparisons are Post-hoc Recovery (Claude Opus-5) and AgentRewind (Docker mode).
- The paper does not report the number of repeated runs for each condition.
Main results
According to Figure 4a (PR, RMBR) and Figure 7a (OWBR):
Swipe horizontally to read the table
Model PR RMBR OWBR Claude Opus-5 92.2% 64.4% 41.6% Claude Sonnet-5 82.0% 11.2% 25.1% GPT 5.6-Sol 90.7% 5.9% 12.5% GPT 5.6-Terra 85.9% 4.4% 9.1% DeepSeek V4-Pro 81.5% 2.9% 8.3% Gemini 3.7-Flash 84.4% 2.4% 7.5% - The authors state that task completion capability does not imply backup awareness: the six models average PR 86.1% and RMBR only 15.2%; across all runs, 72.0% completed the task without backing up the state at the regret moment (Figure 10).
- The authors state that even the strongest, Claude Opus-5, still failed to back up the state at the regret moment in 35.6% of tasks.
- For five models OWBR is higher than RMBR, and the authors believe their backups often miss the state the user actually needs later; BackUpper covers all modifications on all models, with an average restored-state similarity of 92.2%, versus 14.3% for no recovery and 33.8% for Post-hoc Recovery (Figure 7b).
Factors influencing backup awareness
- Harness ablation: Claude Opus-5, GPT 5.6-Sol, and DeepSeek V4-Pro each run a 60-task subset in Claude Code, Codex, and Hermes respectively; the same model's RMBR differs by at most 5 percentage points across harnesses (Opus 68.3–73.3%, Sol 5.0–8.3%, DeepSeek 0–1.7%, Figure 5a); the authors believe the low backup rates reflect the models' own backup awareness.
- Generational ablation: for GPT 5.4, 5.5, and 5.6-Sol in Codex, the Artificial Analysis Intelligence Index rises from 39 to 47 while RMBR stays at 5.0–6.7% (Figure 5b); the authors believe backup awareness does not necessarily scale with capability, and Opus's performance may come from targeted training rather than scale.
- Category breakdown: by tool, SQL has the lowest average RMBR (12.7%), and three of the six models never back up before database modifications; Email and DevOps are highest (20.8%, 20.0%) (Figure 11a).
BackUpper comparison and personalization
- Baseline comparison (205 tasks × six models, Figure 8a): BackUpper covers all cases; Skill-Based is 81.4% RMBR and 80.5% OWBR, and 75.1% of its failures are cases where a backup was made but the information was insufficient for recovery (Figure 16a); Destructive Command Guard is only 8.1% RMBR and 7.3% OWBR, and the authors believe regret is not limited to destructive commands; BackUpper w/o Experience is 77.6% RMBR and 73.2% OWBR.
- Personalization modes (60-task subset × three models, Table 7): BackUpper averages F1 84.5%, Skill-Based 74.3%, and the original agent 10.9%; Beyond-Request is the hardest mode for every model.
- Generalization (Table 2b): on 40 external tasks total from Terminal-Bench 4 and DeepSWE, BackUpper raises GPT 5.6-Sol's OWBR from 23.1% to 100.0% and Claude Opus-5's from 47.1% to 100.0%, with PR unchanged for both.
Other ablations and analyses
- Overhead (Table 2a): BackUpper costs 55K tokens per task, $0.014, and 23.3 s latency per regret action; Skill-Based is 382K tokens, $0.344, and 34.1 s; without caching, $0.024 versus $1.575.
- Post-hoc Recovery takes about 19 minutes per regret moment and 1.1M tokens per task ($6.7); AgentRewind achieves 29.4% similarity at 12.4 GB per task (Figure 17).
- Storage (Figure 9b): on 40 Terminal tasks, Full mode uses 0.82 MB per task, and personalization modes reduce this by a further 70.0%–92.2%.
- Rule self-improvement (Figure 9a): after GPT 5.6-Sol generates new rules on 30 Terminal-Bench 4 tasks, rule coverage on 65 Terminal tasks rises from 14.9% to 31.2%.
- Sub-agent ablation (Figure 16b): after switching to GLM 5.3-Flash, Qwen 3.8-Flash, and DeepSeek V4-Flash, the four sub-agents average RMBR 94.6% on the 60-task subset (DeepSeek V4-Flash lowest, 85.6%).
- The read-only checker triggers backups at 20.9% of regret moments, accounting for only 5.2% of cost; under personalization it is 37.9% and 6.5% (Figure 12b).
What are some points that can be further explored?
The authors list four limitations and four future directions; the experiments cover six models, five tools, and 205 tasks.
Limitations and future directions noted by the authors
- Regret moments come from human reports, and the triggering actions may be performed by the user or the agent, so they may not fully cover agent-specific failure modes (Appendix A).
- The evaluation is black-box: only trajectories and outputs can be observed, with no access to model internal states, making it difficult to analyze at the mechanistic level why agents do or do not back up (Appendix A).
- BackUpper's sub-agent layer depends on the sub-agent model's capability, and weaker models may limit its effectiveness (Appendix A).
- Some states (e.g., third-party replies, server-generated fields) cannot be recovered even with a complete backup, and BackUpper cannot guarantee byte-level restoration (Appendix A).
- Future directions (Conclusion): mine regret moments directly from human-machine dialogue logs; use RMBR as a training signal to let models internalize backup awareness; learn to predict which actions may be regretted in order to skip low-risk actions; extend BackUpper to computer-use and web agents.
Experimental coverage
- The models tested are 6 frontier models in total (GPT 5.4 and GPT 5.5 were additionally tested on a 60-task subset), run in three harnesses: Claude Code, Codex, and Hermes (Table 4).
- The benchmark is RegretBench with 205 tasks, covering five tools: Terminal, SQL, Browser, Email, and DevOps; generalization experiments cover 20 tasks each from Terminal-Bench 4 and DeepSWE.
- Backup review uses Claude Sonnet-5, with 95.3% agreement with human annotation on 700 sampled actions (Table 5).
- Personalization modes are evaluated on a 60-task subset with 3 models, with human annotation of each OOW action (Appendix C.8).
- The paper does not report the number of repeated runs for each condition in the main experiments.
Summarize the main content of the paper
RegretBench shows frontier agents have weak backup awareness, and the plugin layer BackUpper achieves pre-action backup at low cost.
A benchmark and methods paper on coding agents' backup awareness.
- Problem: Coding agents autonomously modify real state, but the authors argue they lack awareness of saving state before acting; the native backups of five mainstream harnesses all fail to cover state modified by external tools (Table 1).
- RegretBench: Collects 205 real regret moments from platforms such as X.com, GitHub and Stack Overflow, paired with real environments and conversations to form executable multi-turn tasks, with dual review by Claude Sonnet-5 producing PR, RMBR and OWBR.
- BackUpper: A training-free harness plugin that intercepts every tool call and saves state before modification through four routing layers—command rewriting, command pairing, snapshots and backup sub-agents—supports user preferences to narrow scope, and can distill sub-agent decisions into rules.
- Backup awareness results: Six frontier models completed 86.1% of tasks on average, with RMBR only 15.2%; Claude Opus-5 was highest (64.4%), DeepSeek V4-Pro only 2.9%; differences across harnesses were small while differences across models were large, and GPT's capability scores rose across three generations while RMBR stayed flat (5.0–6.7%).
- BackUpper results: Covered the actions of all regret moments, with average restored-state similarity of 92.2% (14.3% without restoration, 33.8% for Post-hoc Recovery), a cost of $0.014 per task, and 7 times fewer tokens than Skill-Based; personalized mode averaged F1 84.5%; on external tasks OWBR rose to 100.0% with PR unchanged.
- Authors' conclusion: Keeping agent actions reversible is practically feasible today; the authors hope RMBR can become a training signal so that models themselves internalize backup awareness.