LLM agents can change their own future behavior, raising a basic control question of which self-generated changes should be allowed to persist. We formulate this as admission control for self-modification. The agent may propose changes to its operating instructions, while an external runtime gate controls persistence. We implement this principle as a model-agnostic self-healing harness that runs a Detect, Notice, Heal, Validate loop around an otherwise unmodified agent. The agent authors candidate behavioral rules in an external workspace, where they receive provisional execution authority during evaluation and acquire persistent cross-episode authority only after measured improvement on the triggering failure without regression beyond a fixed margin on protected cases. Replay provides matched evidence when available, forward trials provide a weaker fallback, and a corpus-level guard re-tests the accumulated active rule set. Across 16 matched Baseline and Harness runs spanning AppWorld, Terminal-Bench, and τ2-Bench, the gate rejected 383 replay-decided proposals. Of these, 211 (55%) improved their triggering failure while degrading a case that previously worked. This shows that locally beneficial self-modifications can introduce collateral regressions often enough to materially affect gate decisions, providing direct empirical motivation for external admission control. Task-completion score is higher under the Harness in all 16 pairs, with two paired bootstrap intervals excluding zero, while repeated-trial reliability is higher in 12 pairs, tied in 4, and lower in none. Because adaptation modifies the policy-inducing context while leaving model weights fixed, admitted changes remain inspectable, reversible, and compatible with closed-weight models.
Figures & tables
Figure 1: Harness control boundary. After each turn, trace-level evaluation detects a stall or regression and escalates when needed ( Detect ); the finding is written to the external workspace ( Notice ); the agent retrieves it and authors a candidate rule ( Heal ); and the candidate remains provisional until replay or forward-trial evidence supports promotion without regression ( Validate ). A per-turn barrier closes the loop before the next turn, while the pull model keeps workspace contents outside the conversation unless explicitly retrieved.
Task-completion score sˉ
pass@1
passk
Benchmark
Model
n
B
H
CI 95 / p
B
H
B
H
AppWorld
gpt-terra
166
0.701
0.723
[+0.006,+0.040] / .01
0.018
0.054
0.000
0.000
gpt-luna
168
0.658
0.662
[-0.01,+0.02] / .54
0.000
0.006
0.000
0.000
claude-haiku-4.5
168
0.566
0.590
[-0.06,+0.10] / .58
0.000
0.143
0.000
0.143
claude-sonnet-5
166
0.714
0.727
[-0.005,+0.032] / .17
0.030
0.048
0.006
0.012
Terminal-Bench
gpt-terra
10
0.450
0.525
[-0.13,+0.33] / .65
0.444
0.556
0.333
0.444
Table 1: Headline results for matched Baseline (B) and Harness (H) runs. sˉ denotes task-completion score. CI 95 and p are the paired task-level bootstrap interval and two-sided p -value for H − B in sˉ . Bold H entries indicate numerical Harness leads, while bold CI 95 / p entries indicate intervals excluding zero. All remaining differences are directional. Rates are computed over the task-trials present in both arms, so the denominator behind pass@1 and passk can differ within a row.
Figure 2: Per-task trial outcomes on Terminal-Bench with terra ; filled cells denote successful trials. Under the Harness, build-cython-ext and regex-log become consistently successful after intermittent Baseline performance, while configure-git-webserver improves from zero to four successes. Overall, four tasks succeed on all four trials under the Harness versus three under Baseline.
Decision basis
Count
Share
Verdict
task_completion
200
48%
Promote (420)
tool_correctness
73
17%
outcome_correct
73
17%
coherence
58
14%
argument_correctness
15
4%
Protected-case regression
211
55%
Retire (383)
Table 2: Replay-based gate decisions, pooled over the runs in which replay resolved the verdict; Terminal-Bench contributes none, since replay is unavailable there. Promotions are grouped by the metric that improved beyond the admission margin. Among retirements, 55% improved the triggering failure but regressed protected behavior.
Benchmark
Model
Replay %
R/F
Δsˉ
Δpassk
AppWorld
terra
87%
104/15
+0.022
+0.000
luna
90%
189/21
+0.004
+0.000
haiku-4.5
84%
168/32
+0.024
+0.143
sonnet-5
86%
93/15
+0.013
+0.006
Terminal-Bench
terra
0%
0/206
+0.075
+0.111
luna
0%
0/324
+0.025
+0.100
Table 3: Validation path by run. Replay % is the share of validation activity resolved by replay rather than forward trial, and R/F reports the corresponding replay and forward event counts. These are per validation event and do not correspond one-to-one with the rule counts of Table 10 . Terminal-Bench does not support replay and therefore has structural 0% rows. Variation in replay availability is observational rather than a controlled ablation. Bold indicates replay shares above 80% .
Benchmark
Model
Q1
Q2
Q3
Q4
Rules
slope ( p )
AppWorld
terra
+.031
+.001
+.040
+.018
10 → 47
+.03 (.86)
luna
+.017
+.009
+.006
-.016
13 → 70
-.27 (.02)
Term-Bench
terra
+.250
+.500
-.125
-.125
7 → 7
-74.2 (.09)
τ2 airline
luna
-.010
-.010
+.063
+.012
11 → 81
+1.23 (.26)
τ2 retail
luna
-.003
+.029
-.025
+.047
36 → 195
+.20 (.67)
Table 4: Learning dynamics for the five configurations with quartile-resolved telemetry. Q1–Q4 report paired Δsˉ over execution quartiles; Rules gives the mean active-rule count in Q1 and Q4. Slope is per task in units of 10−3 , with permutation p -values from 5,000 shuffles.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Symbol
Meaning
π
the (fixed) agent policy wrapped
s=(x1,..,xT)
a session (one task trial); its traces
xi
the i -th trace (one agent turn)
E
trace-level evaluation service
mj(x)
metric j on trace x ; ∅ if pending
M0
{mout} : verifier outcome (tier 0)
Appendix
Table 5: Complete notation. Where a default and a study value differ, the study value is given in Table 6 .
Symbol / knob
Meaning
Default
Study
Trigger and trajectory gate
w
gate window (traces w/o new high)
5
10
θ
gate target
0.5
0.5
γgain
gain counted as progress
0.02
0.02
δdrop
drop from peak = regression
0.15
0.15
τj
absolute threshold (tiers 0,2 )
0.5
0.5
Appendix
Table 6: Harness hyperparameters: package default vs. the value used in every reported run. Boldface marks a study override. Eval-case capture defaults off and is on in the Harness arm throughout the run, so replay validation has cases to work with; tier 3 stays off because each model-judged metric re-reads the whole trace. Rows marked † are harness-level constants with no package default; ∗ marks the only value that differs across benchmarks. The forward-trial window is lowered to 3 so that a rule can complete a trial inside a single run, and the barrier and poll budgets are raised because trace evaluation is model-judged and takes minutes.
Approach
P
S
V
R
T
Reflexion
×
✓
×
×
✓
Voyager
✓
✓
partial
×
✓
Generative Agents
✓
✓
×
×
partial
ExpeL
✓
✓
×
×
×
AutoManual
✓
✓
partial
×
✓
Agent Workflow Memory
✓
✓
×
×
×
Appendix
Table 7: Where the Harness sits. Rows: Reflexion ( Shinn et al. 2023 ) , Voyager ( Wang et al. 2023a ) , Generative Agents ( Park et al. 2023 ) , ExpeL ( Zhao et al. 2024 ) , AutoManual ( Chen et al. 2024 ) , Agent Workflow Memory ( Wang et al. 2024 ) , A-MEM ( Xu et al. 2025 ) , RAG memory ( Lewis et al. 2020 ) , STOP ( Zelikman et al. 2024 ) , Darwin Gödel Machine ( Zhang et al. 2025 ) , Constitutional AI ( Bai et al. 2022 ) . Columns P, S, V, R, T defined in text.
claude-haiku-4.5 , claude-sonnet-5 ); seed 1 of {1,2,3} configured; arms
Appendix
Table 8: Configuration matrix as run. Each native split is used whole in one continuous pass, so there is no learning and evaluation partition. “pairs” counts the matched Baseline and Harness comparisons contributing to the results; “turns” is the per-task agent budget.
Benchmark
Model
Δpass@1
Δpassk
gap
Terminal-Bench
claude-sonnet-5
-0.143
+0.333
+0.476
Terminal-Bench
claude-haiku-4.5
+0.000
+0.200
+0.200
τ2 airline
gpt-luna
+0.020
+0.040
+0.020
Appendix
Table 9: The three of 16 pairs in which the all- k -pass rate rises more than the first-trial rate, Δpassk>Δpass@1 . Reported as a suggestive pattern, not as validation of a distinctive repeatability signature. Terminal-Bench has 10 tasks, so its passk increments are coarse.
Benchmark
Model
prop.
prom.
retired
prom. rate
AppWorld
terra
112
49
63
0.44
AppWorld
luna
205
78
127
0.38
AppWorld
haiku-4.5
181
61
120
0.34
AppWorld
sonnet-5
96
42
54
0.44
Terminal-Bench
terra
12
12
0
–
Terminal-Bench
luna
23
23
0
–
Appendix
Table 10: Rule lifecycle per run, grouped by benchmark. Terminal-Bench cannot replay and has zero retirements in these runs, so its promotion rate should not be read as replay-gate selectivity.
AppWorld
Terminal-Bench
τ2 airline
τ2 retail
Quantity
terra
luna
haiku
sonnet
terra
luna
haiku
sonnet
terra
luna
haiku
sonnet
terra
luna
haiku
sonnet
graded trials
661
672
672
664
40
40
40
40
200
200
200
200
448
445
448
448
rules proposed
112
205
181
96
12
23
20
15
76
173
129
44
248
359
402
211
rules promoted
49
78
61
42
12
23
20
15
41
93
53
24
151
225
231
126
rules retired
63
127
120
54
0
0
0
0
35
80
76
20
97
134
171
85
notices trend
156
164
190
141
34
35
38
31
171
218
176
139
584
756
811
496
Appendix
Table 11: Harness activity per run. Escalation rate is breach/(trend+breach) . Samples/series is the median length of a per-session metric series and is the direct read-out of the barrier (the barrier); a value of 1 would mean the trigger could not have fired.
Quantity
before
after
rationales blaming meta-tool calls
14%
0.17%
rationales mentioning meta-tools
–
2,251
spurious zero scores
31
1
Appendix
Table 12: Evaluator bias before and after adding meta-tool neutrality guidance to the judge prompts, measured over 4,800 sampled judge rationales after the change. The Harness is unmodified; only the evaluator prompts change. All runs in Table 1 use the corrected prompts in both arms.
tokens / turn
agent turns
cost (USD)
wall / trial
Benchmark
Model
B → H
ratio
B → H
Δ
B → H
repair
B → H (s)
AppWorld
terra
5215 → 7504
1.44 ×
10.1 → 11.9
+1.8
26.47 → 34.45
8.26
17 → 109
AppWorld
luna
5172 → 8986
1.74 ×
9.9 → 11.6
+1.7
2.57 → 4.19
1.79
17 → 114
AppWorld
haiku-4.5
5580 → 7590
1.36 ×
10.0 → 11.4
+1.4
5.80 → 7.60
4.20
18 → 112
AppWorld
sonnet-5
7110 → 9310
1.31 ×
10.2 → 11.5
+1.3
28.00 → 34.00
11.00
20 → 120
Terminal-Bench
terra
6837 → 6151
0.90 ×
8.5 → 9.1
+0.6
3.67 → 2.37
0.61
101 → 202
Appendix
Table 13: Cost and overhead, grouped by benchmark and ordered within each group by added context. Cost is total USD over the run; the repair column is additional spend on top of the Harness task-execution column. Wall time is per trial.
Benchmark
Model
added context
Δsˉ
AppWorld
sonnet-5
1.31 ×
+0.013
AppWorld
haiku-4.5
1.36 ×
+0.024
AppWorld
terra
1.44 ×
+0.022
AppWorld
luna
1.74 ×
+0.004
Terminal-Bench
terra
0.90 ×
+0.075
Terminal-Bench
sonnet-5
1.06 ×
+0.019
Appendix
Table 14: Cost against benefit: added context (Table 13 ) beside the paired task-completion gain (Table 1 ) across all 16 pairs. Every pair shows a positive Δsˉ . Terminal-Bench/terra is the only configuration below Baseline token cost, while Terminal-Bench/haiku-4.5 shows the largest task-completion gain.