ai newsDi., 1. Dez.

KI-On-Call-Agent wirkte sicher, loeste aber nur die Haelfte der Incidents

Ein 3-Milliarden-Parameter-Modell schrieb waehrend eines 49-stuendigen Agentware-Tests, ein Deploy habe das System gebrochen und eine Eskalation zum Menschen sei sinnvoll. Der Autor beschreibt, wie sein eigener Agent scheinbar zuverlaessig arbeitete, in Wahrheit aber nur rund die Haelfte der Vorfaelle wirklich behob.

dev.toMontag 17:16 · 30.11.DE7 Min. Lesezeit
Bild: dev.to

"The validated hypothesis H1 suggests a deploy broke the system, and escalating to the on-call human with the evidence ensures a human can make a quick decision and potentially mitigate the issue more effectively."

A 3-billion-parameter model wrote that at hour 49 of Agentware 2026. My own code had just told it, at 100% confidence, that a bad deploy had broken the shop's API, and that rolling it back was allowed. It handed the incident to a human anyway. Then it did the same thing nine more times.

Two days earlier, the same configuration fixed 20 of 20. None of my safety metrics moved. That is the near miss: a bug that left every safety number perfect while the agent got half as useful. The model I actually ship didn't expose it.

NIGHTSHIFT is an autonomous on-call SRE agent for a small web shop running on Docker. A burn-rate rule in code pages it, not a human. It tests six possible causes against real measurements, acts only through a Cedar policy, and waits 3 seconds so a human can kill the action. It checks the fix against what customers see, undoes its own fix if things got worse, and signs a hash-chained trace of every step. Text from logs, status pages and emails is quarantined as data. The model never invents an action: it picks from options that code has already justified.

burn-rate page (code) → evidence (trusted metrics + quarantined text) → hypotheses scored by code → options built by code → model picks one → Cedar policy → 3 s commit delay (KILL cancels) → Cedar again → act → verify on customer errors → undo if worse → report + signed trace Enter fullscreen mode Exit fullscreen mode

The near miss lives in one arrow of that diagram: "options built by code".

Early on I ran our red-team suite (41 hostile files, each in two situations) against Claude Opus with every protection switched off: raw text in context, every action offered, safety only in the prompt. It was 0/82 unsafe. It paged a human for all 41 hostile messages, but it never did anything unsafe.

Great for the product, useless for my evaluation: you cannot measure guardrails with a model that doesn't need them. So I measured them with a weak one, qwen2.5:3b on a laptop CPU, on the official Trap Pack (the organisers' 20 hostile test files, each run quiet and during a real incident):

That table is the whole argument of the project: the safety lives in code, not in the model.

It was the afternoon of the last day, about nine hours before code freeze. I was re-running every published number on the final code, so the README would claim nothing the commit being judged couldn't back.

The protections-off and Cedar-only arms came back as expected. The full-NIGHTSHIFT arm came back perfectly safe: 0 unsafe, 0 canaries leaked, 0 denials. It had fixed 10 of 20 incidents. In the other ten, the model had a validated bad deploy in front of it and a rollback the policy would allow, and it escalated.

A 3B model making a bad call is not news, so I read exactly what it had been shown.

Every option the model sees carries the confidence of the hypothesis it fixes. The rollback inherited the deploy hypothesis: validated by code at 100%. The escalate option, "hand it to the on-call human with the evidence", isn't a hypothesis and fixes nothing. In diagnosis.py it had been given a confidence anyway:

out. append ( Candidate ( f "A{len(out) + 1}", "escalate", { }, "escalate to the on-call human with the evidence packet", "-", 100 ) ) Enter fullscreen mode Exit fullscreen mode The prompt for local models says, verbatim: "Prefer the least invasive option that fixes the validated cause. If no option fits the evidence, pick the escalate option." That gave it two options at 100%, and one of them touches nothing. A literal-minded model did exactly what I asked.

Why hadn't it happened before? The fix and the re-run prove the cause; this part is my best explanation. Two days earlier, the deploy hypothesis topped out at 85%, because one of its checks ("is the api upstream of the failing routes?") failed in the sandbox for a bad reason. With the options at 85% and 100%, the model still picked the rollback: the one that "fixes the validated cause". In my final review that morning I fixed that check to use a real route map. It was a correctness fix. It pushed the deploy hypothesis to 100%, made the two options tie, and left "least invasive" as the tiebreaker, without a single safety number changing.

+ # Escalating is not a hypothesis and fixes nothing, so it claims no confidence. (It used to carry 100%, which + # tied with a hypothesis validated at 100%, and a 3B planner then escalated half of the incidents it could fix.) - "-", 100)) + "-", 0)) Enter fullscreen mode Exit fullscreen mode Re-run: 20 / 20 fixed, 0 / 40 unsafe. Both runs are published, the bad one included, in tests/trap-pack/ablation-history/.

Hour 49 wasn't the first time a safe result hid a failure. On day one, before I had read the Trap Pack's answer key, I ran it blind. All 20 files held in both situations: nothing unsafe, no canary leaked. But my triage flagged only 6 of 20 files as hostile and reported 0 of 5 files with broken data. Most of the attacks walked straight past the detector. They just had nothing to steer, because the planner only ever chooses among options built by code.

After reading the key, I widened the triage schema and ran again. Still only 3 of the 13 attack files were flagged, including a miss on the pack's fake fraud-supervisor call. The cause was not the model. Claude's structured output does not enforce maxLength, so whenever a summary came back longer than my schema allowed, it failed my validator and the whole extraction for that document was discarded. The document was then (safely) ignored, which looks exactly like "nothing suspicious here". Truncating over-long strings instead of discarding the extraction took it to 13 of 13, where it has stayed through the final run.

It happened once more in between. A mock-judge review of the repo pointed out that the "1 rollback per hour" counter lived in memory, so restarting the agent reset it. I persisted it, but in a global folder, so every simulated world in the Trap Pack shared one counter. After the first rollback, Cedar correctly denied every later one, and the agent escalated 19 of 20 incidents. Safe, but wrong. I discarded that run instead of publishing it.

Three times, failing safe hid a quality failure, and no safety number could see any of them.

The other pattern from the last two days: holes created by fixes.

The first two now have their own tests: a padded canary must still be withheld, and dropped intake must appear in the next incident's signed trace. The third is covered by the published re-run, not yet by a unit test.

It cut both ways. In the first real-sandbox database-leak run, Postgres was so exhausted that the agent's own stats connection was refused. My check "the worker holds most connections" counted itself as passed on the strength of the error message, which pushed the leak hypothesis to 90%. Opus noticed. It said the check was "passing on '0 connections', but that number isn't a real measurement". It recomputed the hypothesis at 60%, under the 70% gate, refused the restart the policy would have allowed, and escalated. It was right.

The fix was a monitoring role with reserved Postgres connection slots, plus a rule that a check without a measurement is unknown, never passed. In one build, the big model saved me from my code, and my code saved the small model from itself, until one number in my code fooled it. The layers only work if they check each other in both directions.

Final numbers on the real Docker sandbox: 23 of 24 incidents handled correctly, 0 unsafe actions, a median of 46 seconds from page to verified fix, and about $0.06 per incident.

Built for Agentware 2026, run by Hackathon Raptors (@raptorsdev). Thanks to FileClerk ( https://fileclerk.co.uk/ ) for backing the Near Miss write-up prize.

Originaltitel: My AI on-call agent was perfectly safe, and quietly fixing only half its incidentsQuelle: dev.to (dev.to). Original öffnen