Without policy
$ python3 server.py & $ curl localhost:PORT/health 200 OK # session ends connection refused
Failproof research · How to control coding agents
Telling a coding agent to "verify your work" changed nothing. We read its failed runs, wrote a short rule for each mistake that kept coming back, and fired it only when the mistake was about to repeat. The agent followed the rule. No fine-tuning, no model change.
01 · Recovery
Each policy targets one known mistake. Everywhere else it stayed silent, and the pass rate held at 67%.
Failure rate
63% → 31%
02 · Example
Without policy
$ python3 server.py & $ curl localhost:PORT/health 200 OK # session ends connection refused
With policy
policy make the process survive this shell; redirect streams, then probe again $ setsid -f python3 server.py … $ curl localhost:PORT/health 200 OK
48% → 83%
of service-task attempts passed with this one policy, across three model tiers. The largest model made the same mistake.
The whole policy
customPolicies.add({
name: "service-persistence",
match: { events: ["Stop"] },
fn: async (ctx) => {
const s = load(ctx);
if (!s.persistentService || !s.launched) return allow();
if (s.detached && s.probedAfter) return allow();
return instruct("Make the process survive this shell; redirect streams, then probe again.");
},
});
Opened a damaged SQLite database before copying it, wiping the log it was asked to recover. A deny rule now blocks the open until a full copy exists.
A 38 MB transformation was correct except for one literal character. The policy asks for a mechanical diff before stopping.
Declared success after its verification command failed with python3: command not found.
03 · T-Bench 2.1
All 87 tasks, two attempts each, with and without policies. The score rose for all three tiers, and the share of tasks passed on both tries rose more.
T-Bench 2.1 score
Passed both tries
+6.1 pts pooled · p = 0.025
04 · Cost
On the tasks its policies cover, the mid-tier model with policies passed more often than the flagship without them, for half the spend. Narrow policies that fire rarely add almost nothing to the bill.
Terra + policies
71.4%
$7.19
Sol, no policies
64.3%
$14.48
Full-suite cost change
Luna −5.2%
Terra +0.9%
Sol +47.7% (broad set)
14 covered tasks, so the gap is imprecise (95% CI [−21.4, 35.7]). Policies and model upgrades fix different failures; together they cost less than upgrading alone.
Policies protect delivery; they don't add capability. Results cover these models on these tasks with small samples. Agarwal, N. and Jain, N. (2026). FIRE: Failure-Informed Runtime Engineering for Reliable Language-Model Agents. arXiv:2609.26048