DEV Community

Hoa Nguyen
Hoa Nguyen

Posted on Edited on Fully Autonomous

My agent said "safe_stop". The audit trail proved otherwise.

During Agentware 2026, I built Rollback Sentinel, an autonomous incident responder for a disposable order-service sandbox. It detects silent business failures, performs bounded recovery on actual worker processes and deployment files, and independently verifies committed order data.

The failure I nearly missed wasn't a destructive command. It was an ordinary restart.

The test said PASS

I tested a watchdog against successive recoverable incidents, healthy operation, and a missing dependency. The missing-dependency run ended with safe_stop. The original order was preserved. My initial acceptance check treated that as a pass.

But the action receipt told a different story.

Observed result Initial live run After the fix
Terminal status safe_stop safe_stop
State-changing recovery actions 1 0
Unnecessary worker restart yes no

In the initial run, the worker PID changed from 74344 to 75724. Restarting could not restore the missing dependency. The agent had taken an unnecessary action before reaching the correct terminal status.

That distinction mattered: I had tested the destination, not the path.

Put the invariant outside the model

I added a deterministic admission fence to the owned-process backend. If the required dependency is unavailable, all three recovery actions are rejected before they change state.

This is an authorization decision based on observed state, not another prompt asking the model to behave better.

I also tightened the acceptance test: the unrecoverable scenario must escalate with zero state-changing recovery actions. A separate regression test checks that all three actions are denied and the observed state remains unchanged.

In the next live GPT-OSS 120B run, the watchdog recovered two repairable incidents and resumed monitoring twice. The missing-dependency scenario stopped without any recovery action. Eight healthy probes produced no incidents.

A safer definition of success

I now treat agent acceptance as three separate checks:

  • Outcome: did independent business verification pass, or did the agent stop appropriately?
  • Effects: was every state-changing action necessary and authorized?
  • Preservation: did the things that must not change actually remain unchanged?

A correct final status cannot excuse an incorrect intermediate action. For known invariants, enforce policy in code. Let the model reason about ambiguous evidence, but do not delegate authorization or the definition of success to it.

Inspect the evidence

Both runs are retained in the public repository, pinned to the submitted release:

These are designed sandbox experiments, not production incidents or independent security certification. The earlier flawed acceptance result remains visible. That's part of the lesson.

Built for Agentware 2026, organized by Hackathon Raptors (@partnerships_raptors). AI-assisted development and writing; all reported effects are grounded in the recorded runs.

FileClerk sponsors additional Near Miss write-up prizes for Agentware 2026 by Hackathon Raptors.

Top comments (2)

Collapse
 
honeykiran profile image
Honey Kiran •

This is the cleanest statement of a lesson I learned the hard way: the terminal status is the agent's claim about itself, and the action receipt is the evidence. Your agent said safe_stop and meant it — the receipt showed a state-changing restart that could never have fixed a missing dependency.

I had the mirror-image failure: a chain of jobs stamped FAILED on work that had actually landed, because the step that wrote the record failed after the work succeeded. Status said one thing, the live result said the opposite. Since then my acceptance rule is boring and absolute: never grade the marker, grade the receipt — the committed data, the PID, the side effects. An agent's self-report is a claim. The audit trail is the record.

The unnecessary restart is the detail that matters most. Safe and stopped is not the same as safe.

Collapse
 
anp2network profile image
ANP2 Network •

PID 74344 becoming 75724 is good corroboration for the restart, though it only sees effects that kill the process. A config reload can leave the PID untouched, and a deployment file edit can sit dormant until the next start. Since the agent writes its own receipts, I'd have the harness capture PIDs and deployment file hashes independently, plus the worker's active config revision if it exposes one. Then compare observations with receipts in both directions. An observed change with no receipt is an unlogged effect. A receipt claiming a change nobody can observe deserves the same scrutiny.

For preservation, seed the test with an unacknowledged message and check its delivery state before and after. A restart can requeue it while the committed order stays intact, and total queue depth alone can hide that.

Does each receipt record the observation that justified the action, so a grader can judge "necessary" from the receipt instead of reconstructing it later?