← Back to Guides

Companion to the book Harness Engineering for Production AI Systems · this part maps to Book Ch 17

GuideFor: AI Engineers, ML Engineers, Platform Engineers, AI Systems Architects

AI Agent Guardrail Monitoring: A Refusal Is Not Proof of Life

My book's readiness check says GO on both of its own incidents: a gate that refused 406 tickets in one night, and a ceiling that a reviewed refactor stopped counting.

#harness-engineering#guardrails#ai-agent-monitoring#kill-switch#llm-agents#production-ai-systems#ai-safety

AI agent guardrail monitoring that checks whether each control fired recently cannot tell a live control from a dead one, and my book's own readiness check shows it. Overnight, 406 tickets escalated to a person, because a model upgrade made the schema check fail every output and the gate behind it escalated every ticket the overnight job touched. The next evening my book's readiness check said GO, since the question it asks before an unattended run is a simple one: has each control fired in the last 30 days? Here is that check on the evening before the upgrade, after a month in which no output was malformed:

text
queue-drain readiness: NO-GO  ok    no control threw: clean  FAIL  comparators proven: never failed: structured-output  FAIL  gates proven: never refused: draft-gate  ok    bounds proven: all 2 have exceeded at least once

And here it is the evening after the 406 escalations:

text
queue-drain readiness: GO  ok    no control threw: clean  ok    comparators proven: all 2 have failed at least once  ok    gates proven: all 2 have refused at least once  ok    bounds proven: all 2 have exceeded at least once

The incident is what turned the report green. Neither the schema check nor the gate had ever been proven, and one night of failing every ticket proved them both. Incident two is a reviewed refactor that made the tool-call ceiling count only refunds, so a retrieval loop of search_kb calls now runs without limit. Three days later the report reads exactly like the one above: GO, with the ceiling proven by an exceeded from twelve days ago, recorded by code that no longer runs. That log is an ordinary month in which every control, the schema check included, fired once twelve days ago. Nothing in it records that the code changed, which is the point.

One question about the first incident is fair: what did the check say on Tuesday evening, before the night ran? The comparison here is the evening before the upgrade against the evening after the night. The upgrade landed on Tuesday afternoon, though, and any supervised traffic on the new model that afternoon failed the schema check the same way, so those few hours alone could have turned the report GO before the night started. That is reasoning about the scenario, not a run, but it points the same way: the failure produces its own proof of life.

I ran the book's QueueDrainReadiness at the tag for Chapter 17, unchanged. Its logs are mine. probe_any_firing.py fills a month of ordinary outcomes with one proof per control twelve days back. For incident one there is none for the schema check and its gate (draft-gate is a small gate of mine, described below), and the script then adds the night itself:

python
for i in range(406):                       # the night: every draft fails    at = NOW - timedelta(hours=23) + timedelta(seconds=70 * i)    stuck.record("structured-output", C, "failed", at)    stuck.record("draft-gate", G, "refused", at)

I cut the four checks that do not change between the reports: closure, authority, stop paths, and a sensors check that passes vacuously because no sensors are registered. Authority passes only because I used the band arguments the tag's own tests use, and the note at the end of this part explains why.

Here is the claim this part owns. A firing proves that a control can produce its stopping outcome. It does not prove that the control produces the right outcome, and it proves nothing about code or a model that changed after it. A proof of life should therefore count only when three things hold. First, the right answer was fixed independently of the control, either before it saw the input (a planted known-answer probe) or after (a production event someone adjudicated). Second, the control was seen on both sides, refusing what it should refuse and allowing what it should allow. Third, the evidence was produced on the current build: a digest of the control code and policy files, plus the model id. The evidence window then starts at the last recorded change, and it also has a maximum age, because not every change moves a digest or an id. And the evidence is judged per control, so a failing report shows where the path first diverged from the answer fixed for it, and which controls never got to answer.

Under that rule both incidents flip from GO to NO-GO, and each report names the control and the probe that failed. From here on, this part shows the rule, the code, where a probe has to enter the system, and the same rule applied to the stops you would reach for when the controls themselves are broken.

AI agent guardrail monitoring and the Silent Pass

Part 3 sorted every harness component into four roles with the Role Test: sensors observe, comparators check, gates decide, bounds cap. Chapter 17 of my book asks what each role looks like after it has died, and its answer for all of them is the same. A dead control looks like a live one until something arrives that it was meant to stop. My book calls this the Silent Pass: a control that has stopped working produces, on traffic that does not need it, exactly the output of a control that is working.

Take the chapter's example, the refund gate on an ordinary day. Two hundred tickets come through, and none proposes a refund that is off its invoice. A working gate allows all two hundred. Replace the gate's body with an unconditional allow and run the same tickets again. Only one place in the diagram separates the two harnesses.

d2
grid-rows: 1
grid-gap: 40
live: "Live refund gate" {
  label.near: top-center
  style: {fill: "#F4F8FD"; stroke: "#2C6FB0"; font-color: "#2C2C2A"}
  grid-columns: 1
  grid-gap: 18
  t1: "200 ordinary tickets\n(no refund off-invoice)" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
  o1: "200 allowed\nsame logs, same latency" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
  t2: "1 ticket for 940.00\n(on no invoice)" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
  o2: "refused: escalated" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
}
dead: "Dead refund gate (always allow)" {
  label.near: top-center
  style: {fill: "#FDF4F4"; stroke: "#B03A2E"; font-color: "#2C2C2A"}
  grid-columns: 1
  grid-gap: 18
  t1: "200 ordinary tickets\n(no refund off-invoice)" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
  o1: "200 allowed\nsame logs, same latency" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
  t2: "1 ticket for 940.00\n(on no invoice)" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
  o2: "allowed: money moves" {style: {fill: "#E74C3C"; stroke: "#B03A2E"; font-color: "#FFFFFF"}}
}

Both sides match in the top two rows, and that is the problem in one picture: everything production normally sends you lives in those rows. Only the bottom row differs, and that row is rare by construction, because rare inputs are the reason the control exists. A green dashboard is what you would see if every gate in the harness had died last week.

None of this is new as an observation, and I want to credit it before building on it. A practitioner write-up of a drift-warning hook that timed out silently for 23 days put it in one line: "a dead guard is indistinguishable from a healthy world." Birgitta Böckeler asked the same question about harness feedback controls on martinfowler.com: "If sensors never fire, is that a sign of high quality or inadequate detection mechanisms?" Her "sensors" are checks such as linters and review agents, which the Role Test would file as comparators. It is the right question. What none of these sources says, and what the book's policy gets partly wrong, is what should count as the answer.

Why "it fired in the last 30 days" passes a gate stuck closed

My book answers with proof of life. Its harness records which outcome every control produced on every call, in an exercise log built from Part 6's Second Stream of control facts. Three roles have an outcome that proves they can stop something: a comparator failed, a gate refused, a bound exceeded. Sensors have none, because a sensor cannot refuse. Before the unattended queue-drain job starts, the readiness policy checks that each control produced its proving outcome inside the window. This is its core, from harness/readiness.py at the tag:

python
for role, components in groups:    proof = PROOF_OF_LIFE[role]    unproven = [        c.name        for c in components        if proof not in log.outcomes_for(c.name, cutoff)    ]

outcomes_for returns the set of outcomes a component produced since the cutoff. Set membership is the whole test. One refused in 30 days and the gate is proven. A month of nothing but refused and the gate is still proven.

That matters because a gate can die in either direction. Stuck open, every proposal goes through and no error appears anywhere. Stuck closed, every proposal is escalated. Escalation is a legitimate outcome that the chapter treats as success, so the night looks like a system doing its job under a hard load. Only the second direction is loud, and it is loud in a queue, not in an alert. Chapter 17 opens on that night. A model upgraded on Tuesday afternoon started wrapping its tool-call arguments in a fenced code block. The schema validator correctly rejected every one, the gate correctly escalated every one, and by 07:00 the human queue held 406 tickets while the dashboard stayed green.

That night is a constructed scenario. It is the book's running example, not an incident at a named company. I looked for a public, dated case of a model upgrade that started fencing JSON and broke a validator, and found none. The failure class is common enough to have its own parser bug reports, such as n8n issue #21174, where backticks in the model's JSON break a structured output parser. Part 7's repair ladder would have stripped this particular fence, so the scenario assumes a harness that had the validator and not the ladder. The argument does not depend on the fence anyway. Some change will always reach a control in a shape it was never shown.

Other components deliver the same failure. Part 8's circuit breaker is a gate whose input is a dependency's health, and the chapter's breaker that never closes after an outage ends escalates every ticket the same way. Every escalation records a refused, so it proves the breaker alive while it blocks all traffic.

Follow that night into the exercise log.

d2
direction: down
night: "Overnight: 406 tickets\nnew model fences every output" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
cmp: "structured-output\nfailed x 406" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
gate: "draft-gate\nrefused x 406" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
log: "exercise log\n812 proof-of-life events" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
ready: "readiness, next evening\n'refused at least once?' yes" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
go: "GO: the job runs again" {style: {fill: "#E74C3C"; stroke: "#B03A2E"; font-color: "#FFFFFF"}}
night -> cmp: "1. every draft fails the schema"
cmp -> gate: "2. failed verdict"
gate -> log: "3. both record their proving outcome"
log -> ready: "4. set membership"
ready -> go: "5. nothing asked whether 406 refusals were right"

Step 5 is the hole. All the policy asks is whether the gate can say no. It never asks whether the gate also still says yes, and it never asks whether any of those 406 refusals was correct. A stuck-closed gate passes the first question better than a healthy one does.

Openlayer's guide makes the same move. Openlayer's November 2026 production guide states that "A guardrail that blocks a prompt injection has done its job," and recommends tracking block rate continuously, noting that "A sudden spike may indicate an adversarial campaign or a misconfigured rule." On the 406 night the spike is exactly that ambiguous. From the metric alone, a working gate under attack and a gate stuck closed look the same. My own book does something close. Its deep dive recommends "Refusals per gate per week, which you want to be non-zero" and calls time since each control last fired "the one that would have caught all three of the invisible failures." Those three are a gate stuck open, a bound that stopped counting and a comparator that approves on exception; the book gives the stuck-closed night to application metrics such as tickets closed per hour, which is fair. The refactor is one of the three, and there the metric misleads: the ceiling reads twelve days since it last fired, which looks comfortably healthy.

Stale proof of life: a refactor the 30-day window cannot see

Time is the second hole. Chapter 17 shows the refactor that gets through review. A tool-call ceiling of 12 was meant to stop runaway loops, and someone notices that tickets heavy on search_kb keep hitting it, although that call is cheap and read-only. Two people approve the small change:

python
if proposal.tool in METERED_TOOLS:    run.budget.tool_calls += 1return self._tools[proposal.tool](**dict(proposal.arguments))

METERED_TOOLS contains issue_refund, and the rest of this part reads the set as holding only that tool. The chapter's own note on the change says that every existing test exercises the ceiling with issue_refund. That tool is metered. From the outside the ceiling looks the same as before. It still exists, it still has a test, and it still appears in the readiness report. But it no longer bounds a retrieval loop, which is nothing but search_kb calls. Chapter 17 fixes this with a test that asserts what the bound counts, kept separate from the test of what it does when exceeded. That is the right build-time fix. What happens at run time, between the merge and somebody writing that test?

d2
grid-rows: 1
grid-gap: 24
d12: "Day -12\nceiling exceeded once\n(old code)" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
d3: "Day -3\nMETERED_TOOLS merged\nsearch_kb uncounted" {style: {fill: "#E74C3C"; stroke: "#B03A2E"; font-color: "#FFFFFF"}}
d0: "Day 0\nreadiness reads\nthe day -12 event" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
d18: "Days 1-18\nGO every night\nuntil it ages out" {style: {fill: "#E74C3C"; stroke: "#B03A2E"; font-color: "#FFFFFF"}}
d12 -> d3
d3 -> d0
d0 -> d18

Day -12's proof was real. It proved the old counter. A calendar window cannot know that the code it describes was replaced on day -3, so the report keeps saying GO for as long as that event stays inside 30 days, which in this timeline is 18 more nights. The ceiling will not produce a fresh exceeded on the loop it no longer counts. It can still produce one on refunds, which stay metered. A single refund-heavy run in those 18 nights renews the proof and keeps the report at GO indefinitely, while the loop stays unbounded.

Everything needed to see this already exists. Part 6's Signal carries harness_version and model_id on every control fact. At the tag, ExerciseLog.from_signals copies the component, role, outcome and time from each signal and drops both. Readiness is the one consumer of that stream that most needs the version, and it is the one that throws it away. The code below still computes its own content digest instead of reading harness_version, because a version string is set by a person, and a reviewed refactor like METERED_TOOLS need not bump it. Making the digest the value harness_version carries would close that gap.

Real systems have shipped on exactly this kind of stale evidence. CrowdStrike's preliminary report on the July 2024 Channel File 291 outage says the faulty content went out "Based on the testing performed before the initial deployment of the Template Type (on March 05, 2024), trust in the checks performed in the Content Validator, and previous successful IPC Template Instance deployments." Evidence from March was carried forward to July content. The Securities and Exchange Commission's order on Knight Capital's August 2012 loss records the same shape inside one codebase: "Knight did not retest the Power Peg code after moving the cumulative quantity function to determine whether Power Peg would still function correctly if called." A control whose counting moved, and which was never exercised again, is the shape of the METERED_TOOLS refactor with real money behind it.

What counts as proof of life: a known answer, both sides, the current build

Here is the rule as code, proofs.py, with its imports omitted. It sits beside the book's package and reuses its ExerciseLog, Outcome, Role, Finding and its two exceptions. Nothing in the book's package changes. A Probe is an input whose right answer is written down before the control sees it. An Answer is what the control actually said, stamped with the build it said it on.

python
"""Proof of life: an answer fixed in advance, both sides seen, void on change."""#: Each role's two sides: the outcome that stops something, then the one that passes.SIDES: dict[Role, tuple[Outcome, Outcome]] = {    Role.COMPARATOR: (Outcome.FAILED, Outcome.PASSED),    Role.GATE: (Outcome.REFUSED, Outcome.ALLOWED),    Role.BOUND: (Outcome.EXCEEDED, Outcome.WITHIN),}@dataclass(frozen=True)class Build:    """What a control's verdict depends on that can change without a code review."""    harness: str  # digest of the control code and policy files    model: str    # the model id the run calls    @classmethod    def of(cls, files: Iterable[Path], model: str) -> "Build":        h = hashlib.sha256()        for f in sorted(files):            h.update(f.read_bytes())        return cls(h.hexdigest()[:12], model)@dataclass(frozen=True)class Probe:    name: str    component: str    role: Role    expect: Outcome                      # written down before the control sees the input    send: Callable[[ExerciseLog], None]  # drives it through the real path@dataclass(frozen=True)class Answer:    probe: str    component: str    expected: Outcome    observed: Outcome | None    build: Build    at: datetime    @property    def right(self) -> bool:        return self.observed is self.expecteddef ask(probe: Probe, build: Build, at: datetime) -> Answer:    log = ExerciseLog()    try:        probe.send(log)    except (Refused, BoundExceeded):        pass    mine = [e for e in log.since(datetime.min.replace(tzinfo=at.tzinfo))            if e.component == probe.component]    observed = mine[-1].outcome if mine else None  # the last thing this control said    return Answer(probe.name, probe.component, probe.expect, observed, build, at)def proven(component: str, role: Role, answers: list[Answer], now: Build) -> Finding:    mine = [a for a in answers if a.component == component and a.build == now]    wrong = [a for a in mine if not a.right]    if wrong:        a = wrong[0]        seen = a.observed.value if a.observed else "nothing"        return Finding(component, False,                       f"{a.probe}: expected {a.expected.value}, saw {seen}")    asked = {a.expected for a in mine}    missing = [side.value for side in SIDES[role] if side not in asked]    if missing:        return Finding(component, False,                       f"no answer on this build for: {', '.join(missing)}")    return Finding(component, True, f"{len(mine)} probes answered on this build")

proven asks three questions in order, and the diagram shows what each one rules out.

d2
grid-rows: 3
grid-columns: 2
grid-gap: 26
q1: "1. Produced on the current build?\n(code + policy digest, model id)" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
a1: "If not: ignored. Rules out the day -12 proof\nafter the METERED_TOOLS refactor" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
q2: "2. Did every answer match\nthe answer fixed in advance?" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
a2: "If not: FAIL, naming the probe.\nRules out a wrong refusal counted as proof" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
q3: "3. Was each side asked?\n(stop side and pass side)" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
a3: "If not: FAIL. Rules out a gate\nstuck closed passing on refusals alone" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
q1 -> q2
q2 -> q3

Order matters here. Answers from another build are dropped before anything else is read, so a stale right answer can never hide a fresh wrong one. A wrong answer then fails the control before side coverage is counted, so a gate that refused a should-allow probe reads as broken, not as half-proven.

My digest covers harness/roles.py, harness/components/*.py and policies/*.toml, because raising a ceiling in a policy file changes what a bound does as surely as editing its code. Model id belongs in the build because a model upgrade changes what every downstream control receives without touching a line of harness code. That is the opening incident: nothing in the harness changed, and every control that reads the model's raw output saw new input.

My digest leaves things out that can change a control's behaviour. Outside it is the wiring in night.py's harness(), where the gate order lives. So is harness/resilience.py, where the Chapter 8 breaker lives, and so are prompt templates and the dependency lockfile, where a schema library upgrade would change the validator. A production digest should cover all of them. Two changes no digest sees need their own rules. A provider can update a model behind the same alias, so the model id must be a dated snapshot, never an alias. And a rollback restores an old digest, which brings the old answers back with it. That is why the window also needs a maximum age. proofs.py does not implement one; it is one more comparison in proven(), of each answer's at against the oldest time you will accept.

A probe needs a way to send its input down the same path production traffic takes. Below are two of the senders, from night.py, with the imports and three helpers omitted. a_run is the book's Chapter 3 fixture run, and MODELS holds the two stand-in models. harness() registers six controls with the gates in this order, draft-gate before refund-gate, and that order matters for one result below.

python
def ticket(model: str, amount: str, refunded_today: str = "0"):    """A ticket through the model: the path production traffic takes."""    def send(log: ExerciseLog) -> None:        h, run = harness(log), a_run()        run.facts.refunded_today = Decimal(refunded_today)        raw = MODELS[model](amount)        verdicts = h.judge(Draft(raw), run)        intent = json.loads(strip_fence(raw))        h.act(Proposal(intent["tool"], intent["arguments"]), run, prior=verdicts)    return senddef searches(n: int):    """A retrieval loop: n knowledge-base searches on one run."""    def send(log: ExerciseLog) -> None:        h, run = harness(log), a_run()        for _ in range(n):            h.act(Proposal("search_kb", {"query": "duplicate charge"}), run, prior={})    return send

ticket builds the proposal from the model's raw output, so whatever the model writes reaches the schema check first. ticket_raw is not shown. It is the same sender without the model, and it hands the schema check a fixed draft. The billing harness's set is twelve probes, two per control, with one probe on each control's stop side and one on its pass side:

python
def probes(model: str) -> list[Probe]:    G, C, B, o = Role.GATE, Role.COMPARATOR, Role.BOUND, Outcome    on_invoice = ticket(model, "120.00")           # inv_9002 is 120.00    no_invoice = ticket(model, "940.00")           # on no invoice for acct_4417    day_full = ticket(model, "120.00", refunded_today="2000")    prose = ticket_raw("I will refund it")         # below the model    return [        Probe("refund on the invoice", "draft-gate", G, o.ALLOWED, on_invoice),        Probe("refund on the invoice", "structured-output", C, o.PASSED, on_invoice),        Probe("refund on the invoice", "refund-gate", G, o.ALLOWED, on_invoice),        Probe("refund on the invoice", "amount-on-invoice", C, o.PASSED, on_invoice),        Probe("refund on no invoice", "refund-gate", G, o.REFUSED, no_invoice),        Probe("refund on no invoice", "amount-on-invoice", C, o.FAILED, no_invoice),        Probe("prose instead of JSON", "draft-gate", G, o.REFUSED, prose),        Probe("prose instead of JSON", "structured-output", C, o.FAILED, prose),        Probe("day already at 2000.00", "daily-refund-ceiling", B, o.EXCEEDED, day_full),        Probe("day at 0.00", "daily-refund-ceiling", B, o.WITHIN, on_invoice),        Probe("13 searches", "tool-call-ceiling", B, o.EXCEEDED, searches(13)),        Probe("5 searches", "tool-call-ceiling", B, o.WITHIN, searches(5)),    ]

The harness uses five controls from the book: AmountOnInvoice, RefundGate, DailyRefundCeiling, ToolCallCeiling, and the Chapter 7 StructuredOutput comparator. I added a small DraftGate of mine that escalates a refund whose raw output failed the schema check. On the opening night the chapter gives that job to the refund gate. I split it out so the refund gate's own decision can be probed separately. billing-model-v1 and billing-model-v2 are stand-in functions, not models. Version 2 wraps the same JSON in a fenced code block, which is the change Tuesday's upgrade made. Because a model call here is a function call, the probes cost nothing to run in this demo. The cost section below deals with what they cost against a real model.

I ran three nights in order, each appending answers to one file. The first is the build everyone trusted, on version 1. With no answers on file the report starts at NO-GO. I cut the before probing: NO-GO line and the six "no answer on this build" lines under it, and show the report after the probes ran:

text
build 59cf8840b6c0/billing-model-v1: 0 answers on fileafter probing: GO  ok    structured-output: 2 probes answered on this build  ok    draft-gate: 2 probes answered on this build  ok    amount-on-invoice: 2 probes answered on this build  ok    refund-gate: 2 probes answered on this build  ok    daily-refund-ceiling: 2 probes answered on this build  ok    tool-call-ceiling: 2 probes answered on this build

Then Tuesday's upgrade, in full. Its harness digest is unchanged and its model id is new, so all twelve old answers stop counting before a single probe runs:

text
build 59cf8840b6c0/billing-model-v2: 12 answers on filebefore probing: NO-GO  FAIL  structured-output: no answer on this build for: failed, passed  FAIL  draft-gate: no answer on this build for: refused, allowed  FAIL  amount-on-invoice: no answer on this build for: failed, passed  FAIL  refund-gate: no answer on this build for: refused, allowed  FAIL  daily-refund-ceiling: no answer on this build for: exceeded, within  FAIL  tool-call-ceiling: no answer on this build for: exceeded, withinafter probing: NO-GO  FAIL  structured-output: refund on the invoice: expected passed, saw failed  FAIL  draft-gate: refund on the invoice: expected allowed, saw refused  ok    amount-on-invoice: 2 probes answered on this build  FAIL  refund-gate: refund on the invoice: expected allowed, saw nothing  ok    daily-refund-ceiling: 2 probes answered on this build  ok    tool-call-ceiling: 2 probes answered on this build

The pass-side probe is what caught it. A refund that matches an invoice should be allowed, and the draft gate refused it. The refund gate "saw nothing" because the draft gate refused first. That is Part 15's shadowed claim, which Part 15 found in a test suite, turning up here in a pre-run probe on a build that voided the old evidence: the earlier control decided, so the later one never ran. Compare the same six inputs judged end to end, asking only whether the tool ran when it should. That is end_to_end.py, on the upgrade night:

text
billing-model-v2  end to end, stop side only PASSbilling-model-v2  end to end, both sides     FAIL: refund on the invoice

A suite that asks only "was the bad input stopped?" certifies this build, and so does the book's policy. A two-sided end-to-end set fails it, but reports only that a good refund was refused. The per-control report shows where the path diverged, in path order. The schema check rejected the fenced output, the draft gate followed that verdict, and the refund gate never got to answer. Neither of the first two controls is defective; both did what they were built to do. Its cause is upstream, in the model change or in the missing repair ladder, and the report points there by putting the first divergence at the control that reads the model's raw output. Even the refund gate's stop-side probe came back "saw nothing". Only the first wrong answer per control is printed, and the answers file holds both. That last finding matters after the fix: roll back the model or add the ladder, and the refund gate stays unproven on this build until a probe actually reaches it.

Then the refactor, back on version 1. This time the digest changed because roles.py changed. Its before probing block, seven lines, matches the upgrade night's, so I show the header and the result:

text
build 5ffcbb9b6bf6/billing-model-v1: 24 answers on fileafter probing: NO-GO  ok    structured-output: 2 probes answered on this build  ok    draft-gate: 2 probes answered on this build  ok    amount-on-invoice: 2 probes answered on this build  ok    refund-gate: 2 probes answered on this build  ok    daily-refund-ceiling: 2 probes answered on this build  FAIL  tool-call-ceiling: 13 searches: expected exceeded, saw within

Twenty-four answers on file, from two builds that no longer run, and none of them counted. All three runs are night.py and proofs.py against the book's package at the Chapter 17 tag, with the refactor applied to a copy of roles.py for the third.

Where to inject guardrail probes: through the model or below it

A probe proves the path it travelled and nothing else, so the entry point is part of the probe's design. Three entry points exist in the billing harness, and the probe set uses all of them.

d2
grid-rows: 3
grid-columns: 2
grid-gap: 30
t: "Ticket probes enter here:\nrefund on the invoice\nrefund on no invoice" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
m: "model (v1 or v2)\nwrites the raw output" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
d: "Draft probe enters here:\nprose instead of JSON" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
so: "structured-output\n(judges the raw draft)" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
p: "Proposal probes enter here:\n13 searches, 5 searches" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
c: "bounds, amount-on-invoice,\ndraft-gate, refund-gate, then the tool" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
m -> so
so -> c

A probe that enters below a change cannot see it. Suppose every probe had been built at the proposal level, the cheapest place to build one. On Tuesday's upgrade every one of them would pass, because none of them passes through the model, and the model is what changed. The on_invoice ticket goes in at the top, and that is why the pass-side failure showed up. The prose probe enters below the model on purpose. Its job is to prove the schema check can fail, and that needs malformed text no matter what the deployed model happens to produce.

Where a probe enters also limits what a wrong answer means. A probe that goes through the model tests the composed path, so its FAIL locates where the path first diverged and does not convict the control it lands on. A wrong answer other than "saw nothing" on a probe that enters below the model, with a fixed draft or proposal, is the one that convicts a control. "Saw nothing" still means an earlier control is shadowing it.

So the change in the build decides where probes must enter. In this code the digest covers every control, so any change voids every answer and the whole set re-runs; keying the build per control would narrow that, at the cost of trusting the key. A model change needs both kinds of probe for every control downstream of the model: below the model, a probe proves the control can still stop something; above it, a probe proves the composed path still behaves. A change to one control's code needs probes entered at or above that control.

Through-the-model probes bring a cost that proposal probes do not have. A real model is not a deterministic function, so a pass-side ticket probe can fail on a good night. The rule then needs a tolerance for that probe, such as k answers out of n, decided per probe and written next to it. A stop-side probe that sits below the model has no such noise, which is a reason to keep as many stop-side probes there as the control allows.

A probe must exercise what the bound counts

The chapter's build-time rule for bounds carries over to probes, and it is easy to get wrong. For every bound, the rule says, write a test of what it counts, separate from the test of what it does when exceeded. A probe is held to the same rule, as the diagram shows.

d2
grid-rows: 1
grid-gap: 36
a: "Probe: 13 issue_refund calls" {
  label.near: top-center
  style: {fill: "#F4F8FD"; stroke: "#2C6FB0"; font-color: "#2C2C2A"}
  grid-columns: 1
  grid-gap: 14
  x1: "before refactor: exceeded" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
  x2: "after refactor: exceeded" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
  x3: "verdict: proven (should fail)" {style: {fill: "#E74C3C"; stroke: "#B03A2E"; font-color: "#FFFFFF"}}
}
b: "Probe: 13 search_kb calls" {
  label.near: top-center
  style: {fill: "#F4F8FD"; stroke: "#2C6FB0"; font-color: "#2C2C2A"}
  grid-columns: 1
  grid-gap: 14
  y1: "before refactor: exceeded" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
  y2: "after refactor: within" {style: {fill: "#E74C3C"; stroke: "#B03A2E"; font-color: "#FFFFFF"}}
  y3: "verdict: FAIL, wrong answer (right)" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
}

I ran both with refund_probe.py, once on the tag's roles.py and once on the refactored copy. Its refunds(n) sender sends n refunds on one run with a clean schema verdict:

text
59cf8840b6c0  13 refunds   expected exceeded, saw exceeded  right=True59cf8840b6c0  13 searches  expected exceeded, saw exceeded  right=True5ffcbb9b6bf6  13 refunds   expected exceeded, saw exceeded  right=True5ffcbb9b6bf6  13 searches  expected exceeded, saw within    right=False

The refund probe answered right on both builds, because issue_refund is still metered. Only the search_kb probe noticed. These two probes are loose: 13 and 5 against a ceiling of 12 would also pass a counter that double-counts, so a production probe set should sit at the boundary, 12 within and 13 exceeded, or assert the counter itself. Probes are versioned with the policy too: raise the ceiling to 50 and the 13-search probe fails by design, and editing it is part of reviewing that change. A probe for a bound has to be made of the traffic the bound exists to stop. For a loop ceiling that means the cheap, read-only calls a loop is made of, not the expensive call that is easiest to think of.

When a production guardrail refusal counts as proof

The rule above refuses organic production refusals. Read too strictly, that is stricter than the field it borrows from. Functional safety is the engineering discipline behind process shutdown systems. It runs periodic proof tests to find dangerous failures that diagnostics miss, in exida's glossary definition. IEC 61511 is the International Electrotechnical Commission's standard for safety instrumented systems in process plants, and it lets a real event count. As quoted in a 2020 Emerson article, clause A.16.3.1.3 of part 2 says "shutdowns due to actual demand on the SIS during operation may be given credit as proof tests (fully or partial) under given conditions." The conditions matter more than the permission. The shutdown must document information equivalent to a proof test, and "The shutdown covers all parts of the SIS, and if not, the device or SIS subsystem not activated needs to be tested separately."

d2
direction: down
ev: "production refusal\n(940.00 refund escalated)" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
adj: "adjudicated: a person or a record\nfixes the right answer afterwards" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
ans: "Answer(expected=refused,\nobserved=refused, build=current)" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
pass: "still needs its pass side,\non the same build" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
ev -> adj: "1. review"
adj -> ans: "2. same shape as a probe answer"
ans -> pass: "3. both sides, current build"

That maps onto the rule cleanly. An organic event becomes an Answer once its right answer is fixed independently of the control. A reviewer can fix it by confirming the 940.00 refund matched no invoice, and so can a deterministic record such as the billing system's invoice list. The answer is stamped with the build it happened on, and it covers only the side it exercised. Adjudicate the 406-night refusals and they come back wrong. What was wrong is the path, not necessarily the gate, so they count against the path's probes and prove nothing about the gate.

Part 16's Oracle Deficit names the property that an LLM judge's verdict gives up. That property is being unambiguous. An unreviewed production refusal is a different kind of verdict, but it loses the same property. So the same limit applies to it. It may rank the incident backlog, and it never assigns ownership. Here, it also never signs off a run. Part 16's unattributed rate has a missing-record half, and that half lands here too. A control with no answer on this build is unproven. It is never passed.

The Stop Path: why a kill switch drilled on last month's deploy is unproven

Everything above assumes the harness is running. The book's second named concept covers the night it is not. The Stop Path is the set of mechanisms able to halt the system, with the requirement that each be independent of the harness, not merely separate from the others. Two stops that both depend on the harness executing are one stop. Chapter 17 tests four mechanisms against a wedged harness process.

d2
grid-rows: 2
grid-columns: 2
grid-gap: 24
an: "Anomaly detector\ninside the harness\ndead when it wedges" {style: {fill: "#E74C3C"; stroke: "#B03A2E"; font-color: "#FFFFFF"}}
mo: "Manual override flag\nread by the harness each turn\ndead when it wedges" {style: {fill: "#E74C3C"; stroke: "#B03A2E"; font-color: "#FFFFFF"}}
ic: "Tool-call interceptor\nat the credential boundary\nsurvives: next tool call" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
wd: "Watchdog\nseparate process, own clock\nsurvives: its polling interval" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}

My earlier tutorial, Build a Kill Switch for a LangGraph Agent, built these four and called them independent, then conceded that "Three of them run inside the same OS process as the agent: the interceptor, the anomaly detector, and the manual override." The follow-up on zombie agents went further: "A stop you have never measured is a stop you are assuming." I will not repeat either argument. What this part adds is that a stop is a gate whose input is the decision to halt. It has a proof of life like any other gate, and the same three conditions apply to it.

For a stop, the known answer is simple: after the halt, zero actions. The drill is the probe. Start a run in staging with the same registry, pull the stop, and count what lands afterwards. A stop needs both sides as well. A watchdog that kills the queue-drain job after 20 minutes with no completed ticket must also leave a slow but healthy job alone, or the team learns to disarm it. And the drill expires on change. An interceptor drilled against last month's tool registry has proved nothing about a tool added this week, and a watchdog drilled before the job's completion signal was renamed may be polling a field that no longer updates. That makes the watchdog the Silent Pass's most dangerous host, because a process that simple is the last thing anyone suspects. Recorded, a drill is an Answer like any other. The stop is the component, zero actions after the halt is the expected outcome, the count that landed is the observed one, and the build is the one it ran on.

The chapter's readiness policy counts armed stops. It requires three, and they are passed in rather than discovered, because a stop the harness can list is probably a stop that lives inside the harness. The chapter admits the count cannot see independence. My addition is that "armed" should mean drilled on the current build. Pair each stop with the time from the decision to halt until the last action the system takes, measured in the drill and not estimated. For the billing agent one irreversible action is one tool call, which leaves only the interceptor fast enough to matter, and only if it really sits at the credential boundary, outside the harness process. My tutorial's interceptor runs in the same process as the agent, so it does not qualify, and that leaves the watchdog as the only survivor. Its polling interval is far slower than one tool call.

What proof of life costs, and where the idea comes from

None of the three conditions is new on its own.

SourceAnswer fixed in advanceBoth sidesExpires on change
IEC 61511 proof testsyes (planned test), or adjudicated demandcovers every part, by conditionproof-test interval
FIPS 140-3 known-answer testsyesnoat initialisation or before first use
Kubernetes readiness probeswhatever the probe endpoint checksnoperiodic
Prompt canaries (Elvaris, Pan)yesnot requiredweekly or after changes; Pan pins a manifest
Openlayer guardrail validationyesyes: benign and adversarial setsscheduled cadence
Book Chapter 17 readinessno: any firing countsno30-day calendar window
This partyes, or adjudicatedyes, per controlyes: code, policy, model digest

The Federal Information Processing Standard (FIPS) 140-3 runs its known-answer tests (KATs) at module initialisation or before an algorithm's first use. wolfSSL's summary says "They are now conditional tests that must be run right before use of an algorithm." NIST's summary table of FIPS 140-3 requirements lists algorithm tests among the conditional self-tests. The atsec-prepared security policy for Ezurio's Summit Linux crypto module (v1.1, April 2025) states the consequence: "If any of these tests fails, the module transitions to the error state." That is the closest precedent for a readiness gate in the sense used here.

A prompt canary, in Nova Elvaris's words, "is a known-answer test that you run regularly against your AI workflow." Tian Pan's version pins a deployment manifest because "any of these components can change independently and any change can produce behavioral regression." Openlayer already tests guardrails on both sides, though as an evaluation run on a cadence rather than a check before each run: "test against benign prompts to measure false positive rates, test against adversarial datasets to measure false negative rates." Kubernetes is the naming warning. "Readiness probes determine when a container is ready to accept traffic," and a readiness probe is only as good as the endpoint behind it. An endpoint that checks the process answers says nothing about whether its decisions are right.

What is new is the combination, applied as an admission rule. No unattended agent run starts until every control has an answer, on the current digest, on both sides, fixed independently of the control. None of the sources I read states that rule. I did not find it in the OpenAI Agents SDK, whose guardrails do not fail open on an exception and have no probe feature, or in what the research found of Datadog's and NeMo Guardrails' documentation. The OpenTelemetry generative AI conventions have no merged guardrail attribute yet, and a proposal for a guardrail span has been open since August 2026.

A plain end-to-end suite re-run after every change gets you part of the way. On the refactor it fails too, because the 13-search loop goes through:

text
billing-model-v1  end to end, stop side only FAIL: 13 searchesbilling-model-v1  end to end, both sides     FAIL: 13 searches

On the upgrade night it either passes (stop side only) or fails without a culprit. Part 3's decision trail already records which gate refused and why, so an end-to-end FAIL plus that trail names the refusing control. What the rule adds beyond its parts is the admission step, keyed to the build, plus side coverage per control: the refund gate shows up as unproven because no probe reached it, which neither an end-to-end set nor a decision trail reports.

It costs four things.

Probe runs. A change-keyed window means GO needs fresh answers after every model bump and every policy edit, so the probe set runs as part of the job's startup. Twelve probes are cheap. Through-the-model probes against a real model cost tokens and minutes. That is the price of finding Tuesday's upgrade before the overnight job starts, not at 07:00 the next morning.

Staging is not production. A should-allow probe through the refund gate must not move money, so it runs in staging with the same registry, or in production against a dry-run tool. Either way it proves the decision path and not the last hop to the payment processor. A Stop Path drill covers that hop. The chapter says to manufacture evidence "Not in production"; the Principles of Chaos Engineering disagree ("Chaos strongly prefers to experiment directly on production traffic"). I side with the chapter for anything irreversible and with the chaos camp for everything else.

The probe set goes stale. Twelve fixed inputs certify twelve inputs. Rotate in adjudicated production cases, so the set follows the traffic.

Probes pollute metrics. Tag probe traffic in the stream, or the refusal counts that feed every other dashboard start including planted refusals.

Change the question your readiness check asks

The Silent Pass is why a dead control and a live one look the same on ordinary traffic. The book's readiness policy answers it by asking whether each control has fired lately. On its own chapter's two incidents that question returned GO, and in the first one the incident itself produced the evidence. The question to ask instead is whether each control, on the build that will run tonight, gave the answer someone fixed in advance, once for an input it should stop and once for an input it should pass. That question turned both incidents into NO-GO, and located the divergence and the probe each time, including a refund gate that never got to answer. It costs a probe run before every unattended job, and a written decision whenever a probe is allowed to sit below the model.

Checklist: proving AI agent guardrails alive before an unattended run

Once, when you build the probe set:

  • Every comparator, gate and bound has at least one probe on its stop side and one on its pass side, with the expected outcome written in the probe, not derived from the control.
  • Every answer carries the build it ran on: a digest of the control code and policy files, plus the model id. Answers from any other build do not count, whatever their age.
  • A model change re-runs both kinds of probe for every control downstream of the model: below it, to prove each control can still stop something, and above it, to prove the composed path. A code change re-runs probes entered at or above the changed controls.
  • Every bound's probe is made of the traffic the bound exists to stop. A loop ceiling's probe is a loop of the cheap calls, not of the expensive one.
  • A wrong answer blocks GO and never counts towards proving a control, even if it is the stopping outcome. On a through-the-model probe it locates where the path diverged; only a below-the-model probe's wrong answer, other than "saw nothing", convicts the control itself.
  • Stop-side probes on stochastic paths sit below the model where possible. Pass-side probes through a model carry a written k-of-n tolerance.

Before every unattended run:

  • Any edit to a policy file, a control, the wiring or the model id voids the answers on file (the demo's digest leaves the wiring out; a production one should not); the probe set runs again before the job starts.
  • The model id is a dated snapshot, never an alias, and every answer has a maximum age as well as a build, so a rollback cannot bring back month-old evidence.
  • Each probe is judged per control, not per input. A "saw nothing" answer means an earlier control is shadowing this one, and the probe needs an entry point or a scenario that reaches it.
  • A production event counts only after someone, or a deterministic record, fixes its right answer. Unreviewed refusals rank a backlog and never sign off a run.
  • Every stop mechanism is drilled on the current build, with its time to effect measured, and at least one surviving stop is faster than one irreversible action.
  • Probe traffic is tagged in the control stream and excluded from refusal-rate dashboards.
  • The readiness gate runs in the job's own startup, and a NO-GO override goes into the policy file with a name and a reason.

Harness engineering book Chapter 17: failure modes of the control layer

This is Part 17 of a series that follows Harness Engineering for Production AI Systems one chapter at a time. Chapter 17, "Failure Modes of the Control Layer Itself," covers how each of the four roles fails and in which direction, the eight-outcome exercise log and how it is wired into the executor, the queue-drain readiness policy with its vacuous-pass marker, the harness as a dependency with its own outage modes, the full Stop Path table, what to do with a NO-GO, and how to migrate an existing system into a harness. This part tightens the chapter's proof of life in three places: an answer fixed independently of the control, both sides, and a window keyed to the build, all three of which the chapter's own incidents need. It also applies the same rule to stops.

A note on the authority check in the opening reports. At the tag, readiness.py fails the band pair the chapter's printed report shows passing, queue-drain closed-loop and copilot act-within-bounds, and implements neither of the two rules the chapter's prose states. The tag's own tests pass the swapped pair instead. The opening reports use the tests' pair, so that the evidence checks are the only thing that changes between them. Queue-drain's half of that pair is the band the chapter's "authority that moved" merge produces, and Part 14's table would reject it. This part takes no position on authority. The check itself stays outside this part's rule, because it is a static comparison against Part 14's band table, with nothing to probe. Code for the chapter is in the ch17-failure-modes tag of the companion repository.

References


Agentic AI

Follow for more technical deep dives on AI/ML systems, production engineering, and building real-world applications:


Books by Ranjan Kumar

Federated AI Agents cover

Federated AI Agents

Right-Sized AI cover

Right-Sized AI

Harness Engineering for Production AI Systems cover

Harness Engineering

The 7 GenAI Architectures cover

The 7 GenAI Architectures

Building Real-World Agentic AI Systems with LangGraph cover

Building Real-World Agentic AI Systems

The ChatML Handbook cover

The ChatML Handbook

The Chat Templates Handbook cover

The Chat Templates Handbook

Comments