Skip to main content
    All shows

    Sunday, July 19

    Trace, Release, and Operate

    0:00-:--
    Speed

    Transcript

    Koko: Here is the one instinct this entire lesson is built on: you debug an agent from its trace, not from the model's private reasoning. Everything else — releasing safely, keeping it running, fixing what breaks — depends on being able to see exactly what the run did. If you can't reconstruct the run, you don't have an agent. You have a black box that occasionally spends money.

    Max: Okay, that framing hits differently. I think I assumed the model's reasoning was the thing to look at — like, if something goes wrong, you go ask the model why.

    Koko: That is exactly the trap, and we are going to come back to it in a minute because it sounds sophisticated and it is exactly backwards. But first let's build the foundation. This lesson is about three things: making the run observable, releasing behind gates so you can catch failures before they're catastrophic, and fixing with the smallest effective change rather than reaching for the sledgehammer. We start with observability because it is the prerequisite for everything else. You cannot do the other two without it.

    Max: So observability first, and then you earn the right to release and operate. What does a trace actually contain? What am I recording?

    Koko: Every observable event in the run, in order. Every model call. Every tool call and its arguments. Every handoff between agents. Every policy decision, every approval, every state change. The latency of each step, the cost, every error. That is the evidence trail.

    Max: That's a long list. What about the model's chain of thought — its reasoning steps? That's not on the list.

    Koko: Correct, and deliberately so. The model's inner monologue, its private reasoning — you often can't reliably capture it, and here is the part that matters: you don't need it. Think about a flight recorder. When investigators reconstruct what happened to a flight, they don't recover the pilots' thoughts. They recover the instruments and the actions. What the throttle did. When the landing gear came up. Which warning fired in what order. That is enough to know exactly what happened.

    Max: So the trace is the flight recorder for the agent run.

    Koko: Exactly that. The side effects on the world — the calls made, the records changed, the money moved — those tell you the truth of the run, whatever the model was thinking.

    Max: Okay, make that concrete for me. What does diagnosis actually look like when you have a trace versus when you don't?

    Koko: Let's use a freight company — call it Northwind. A customer disputes a charge, the agent decides a refund is warranted, and the customer ends up getting paid twice. Without a trace, you are guessing. Did the model hallucinate two refunds? Did the customer click submit twice? Did accounting double-enter? You do not know.

    Max: And with a trace?

    Koko: You don't guess. It reads plainly. The refund tool was called. It timed out waiting for a response. The agent retried the call. And both calls actually landed — because the tool wasn't idempotent, the second call created a second real payment. Diagnosis complete. You never once needed to know what the model was thinking. The observable trail of tool calls and results was the entire story.

    Max: So the idempotency problem shows up in the trace, not in the model's head. The model might not even know it happened twice.

    Koko: Right. And that is why the tempting instinct — asking the model to explain itself — is the wrong move. Walk me through it. If a client's agent double-issued a refund, what do you think most people's first move is?

    Max: Honestly? Ask the model. Give it the context, ask it why it issued two refunds. Get an explanation.

    Koko: And that sounds like a reasonable debugging step. It is not. The model's after-the-fact explanation is a story it generates on request. It is not a record of what happened. It can be confidently wrong. And it is not admissible evidence in an incident review. The tool-call log is admissible. Trust the trace, never the narration.

    Max: That's a sharp distinction. The model is a narrator, not a recorder.

    Koko: Exactly right. And the instinct to carry from this is: the side effects on the world are the source of truth, so design the trace to capture every consequential action before you ever ship. Because you cannot add a flight recorder after the crash.

    Max: That has real teeth in a professional-services context. I'm thinking about a global airline running an operations agent — rebooking passengers, issuing travel credits during disruptions. That's moving real money at volume and speed. What's the right lens for advising on that?

    Koko: The advisory question is not whether the model is good. It's operational. Who owns the runbook? What are the service-level objectives? What is the incident path when a travel credit goes wrong at three in the morning? None of that is answerable unless the agent is fully traced.

    Max: Okay but here's where I'd probably go wrong. The vendor has a dashboard — accuracy metrics, uptime, response time. Isn't that observability?

    Koko: That is the trap with a logo on it. A dashboard of aggregate metrics is not a trace. It tells you something broke. It does not tell you which call, with which arguments, in which order broke it. Those are completely different things.

    Max: So aggregate metrics give you the smoke alarm, but the trace gives you which wire shorted.

    Koko: Good analogy. And in a private-equity diligence context — you're evaluating a portfolio company with a deployed agent — this is the single sharpest question you can ask: is this thing observable and reconcilable, or is it a black box moving money we cannot audit?

    Max: And if it's a black box?

    Koko: That is a finding, not a feature. You'd flag it the same way you'd flag an undocumented manual process in the financials. The organization cannot operate what it cannot see, and it cannot fix what it cannot reconstruct. Observability is not a nice-to-have you add later. It is the first thing you build, before the incident gives you a reason to wish you had.

    Koko: So we have a traced agent. We can see what it's doing. That's necessary — but it's not sufficient to go live. There's a discipline that sits between 'it works in testing' and 'it runs the business,' and skipping it is exactly how a good agent causes a bad outage.

    Max: So what's the discipline? Because the move I'd want to make at that point is just turn it on — the eval suite passed clean, let's stop babysitting it and switch it on for all disputes.

    Koko: And that gets said in every go-live meeting. It's the most natural thing to want to do. But a green eval is necessary, not sufficient. Evals run on the cases you thought of. Production runs on the cases you didn't.

    Max: The timeout. The malformed record. The traffic spike at two in the morning.

    Koko: Exactly. The edge you never imagined. Staged rollout with a fallback is how you meet those cases without betting the whole operation on them. Here's my analogy for this: opening a new highway beside a working one.

    Max: Okay, I'm listening.

    Koko: You don't demolish the old road on day one and route every car onto fresh concrete. You open one lane, keep the old road running as the detour, watch how the surface holds under load, and widen lane by lane. And you keep the ability to close the new road fast if something cracks.

    Max: So staged rollout is the lanes you open, the fallback is the old road still there, and rollback is the barrier you can drop in minutes.

    Koko: That's it exactly. And those three things have to be designed before you open the first lane — not improvised after you hear tires screeching.

    Max: Alright, so what does that actually look like in order? What are the pieces?

    Koko: Seven of them. First, you define your service-level objectives — the measurable bar the agent must clear in production. Accuracy on real cases, latency, cost per outcome, error rate. An SLO you didn't write down is an SLO you can't fail against.

    Max: That's uncomfortably obvious when you say it that way.

    Koko: And almost universally skipped. Second, release gates — the evidence the agent must show before it ships at all. Third, staged rollout: a small slice of real traffic first, watched closely, then widen only as the SLOs hold. Fourth, keep a fallback live — the human queue, the old process — so a failing agent degrades to slower-but-safe instead of just broken.

    Max: Slower but safe. I like that framing. A graceful degradation instead of a cliff.

    Koko: Right. Fifth, write the incident response before you need it. Who's on call, how it escalates, where the pause switch is. Sixth — and this one gets dropped constantly — rollback must be one action away. Not three tickets and a meeting. One action. And seventh: when you do change something, revalidate before you widen again.

    Max: Walk me through Northwind on this. Because I want to see how these pieces actually land.

    Koko: So the fixed dispute agent goes live first on only the simplest, lowest-dollar disputes. Hard cap on refund size. Every refund above a threshold still routes to a human. The manual dispute queue is fully staffed as the fallback — it doesn't get cut.

    Max: So the old road is still open.

    Koko: Still open, still staffed. The SLO is explicit: zero duplicate payments and a defined resolution accuracy. And here's the key part — if the duplicate-payment count ticks above zero, the rollback trigger fires automatically. Disputes flow back to the human queue. No meeting required.

    Max: That rollback trigger being automatic is doing a lot of work there. Because if it requires a human to notice and decide, there's latency.

    Koko: There's latency and there's politics. Pre-defined, automatic, no negotiation in the moment. That's what shipping like an operator means.

    Max: The instinct is: define the SLO and the rollback trigger before you ship, roll out in stages behind a live fallback, and treat a release you cannot reverse as a release you are not ready to make.

    Koko: Memorize that last clause. A release you cannot reverse is a release you are not ready to make.

    Max: Now for the consulting application — because this is where I'm thinking about where it lands with a Fortune-500 client. Is this mostly a technical problem?

    Koko: Almost not at all. This is operating-model design. And it lands hardest in organizations where nobody has yet named the owners. Advising that airline's operations team, for instance — the deliverable isn't a model. It's the runbook.

    Max: Named SLOs, on-call rotation, escalation ladder, documented rollback, quarterly revalidation.

    Koko: That's the document. And here's the thing — this is governance work you already know how to do for human operations. An agent is a new operator who needs the same runbook, written down. The discipline doesn't change because the operator is software.

    Max: Okay so here's the trap I'd walk into on a private-equity engagement with a portfolio company. The founder has been running the old process informally — by feel, by instinct, group chat. And the temptation is to say, just run the agent the same way. It's faster, they know the business.

    Koko: That trap is very seductive and very dangerous. A human operator acting by feel does a few dozen things a day. This agent acts thousands of times a day. You cannot operate that on instinct and a group chat.

    Max: You've automated fragility.

    Koko: Exactly the phrase. Formalize the SLOs, the incident path, and the rollback before it scales — or you've taken all the speed and risk of a machine and given it none of the governance that a machine requires. And that's what you're there to catch before it becomes a headline.

    Koko: So the agent is live. And operating it is a discipline that never really ends — you're watching quality, watching for drift as the world shifts under the model, watching security, cost, business value. Not just on launch day. Continuously.

    Max: And eventually something breaks.

    Koko: Eventually something breaks. And what you do in that moment is the whole test of whether you're an operator or an amateur. The rule is: find the smallest effective fix. The change that repairs the exact layer where the run actually broke. Match the fix to the failure.

    Max: How do you know which layer that is?

    Koko: The trace already told you. That's why we spent a full module on observability. The trace names the broken layer. So fix that layer and nothing more.

    Max: Smallest effective. I like that framing. What's the analogy?

    Koko: A surgeon's incision. A good surgeon makes the smallest cut that reaches the problem, not the largest. Or think of a mechanic — the diagnostic points to one worn part, so you replace that part. You don't swap the whole engine because the car made a noise.

    Max: But the broad move feels decisive. Like you're really fixing it.

    Koko: It feels decisive. It is usually the most expensive way to fix nothing. Let's make it concrete. Remember Northwind — the agent that paid refunds twice.

    Max: The mutating call that timed out, got retried, and landed twice because it wasn't idempotent.

    Koko: Exactly. The trace showed the mechanical defect precisely. So the smallest effective fix is: make the refund tool idempotent — a retry with the same dispute key should be a safe no-op. And add a confirmation check that verifies whether a refund already posted before issuing another. That's it. You repaired the precise layer the trace implicated.

    Max: Okay, but here's where I think a lot of people — including me, honestly — would reach for something else first. If the agent paid twice, isn't the obvious move to rewrite the system prompt? Add a firm instruction: never pay the same refund twice.

    Koko: And that is the first trap. Hard no. This was never a reasoning failure. The model didn't forget the rules. A more eloquent prompt still issues a second real payment when a non-idempotent call times out and retries, because the bug is in the plumbing, not the brain.

    Max: Right, okay. So prompting fixes a reasoning problem. This isn't a reasoning problem.

    Koko: Correct. Now hit me with the other one. I know you have it.

    Max: Switch to the bigger, smarter model. A more capable model wouldn't make a clumsy mistake like that.

    Koko: The classic. And I'll correct it just as hard. A more powerful model is also still sending a second real payment when a non-idempotent call retries after a timeout. The model's intelligence is irrelevant to a mechanical defect in the tool layer. The big-model move costs the most — in money, in new untested behavior, in delay — and it doesn't touch what the trace is pointing at.

    Max: So both traps feel like upgrades, but neither one touches the actual broken layer.

    Koko: That's it exactly. Big-hammer moves feel like progress. They are not.

    Max: Okay. So you made the smallest fix. You're done?

    Koko: You're half done. Now you prove it. And this is the part that separates a repair from a hope.

    Max: What does proving it look like?

    Koko: Two things. First, a regression case. A permanent test that reproduces the exact timeout-and-retry condition and asserts that exactly one refund posts. So this specific failure can never silently return.

    Max: Locks the door behind you.

    Koko: Permanently. Second: reconciliation. You don't just stop new double-pays — you sweep the transactions already out the door, find the duplicates that shipped before the fix, and correct or claw them back.

    Max: Because the bug already cost real customers real money before you caught it.

    Koko: Right. The reconciliation is how you make that whole. A redeploy without a regression case and a reconciliation is a hopeful redeploy. You've patched the future and abandoned the past.

    Max: I can see why that matters in a consumer context. But in professional services — private equity, portfolio companies — what does reconciliation actually mean for the client?

    Koko: It's the highest-value move you bring them. Picture a PE-backed healthcare-services company whose claims or billing agent has been running for a month before anyone noticed a defect. The smallest effective fix stops the bleeding. The reconciliation is what recovers the payments already made in error. And in a portfolio company, recovered cash is a line the deal team can actually book.

    Max: That's not an operational cleanup, that's a P-and-L item.

    Koko: Exactly. Which is why the consultant who shows up with a reconciliation plan — not just a patch — is the one who gets called back.

    Max: Okay, so last trap. The fix is in, the new runs look clean, client is happy. We're done.

    Koko: Half done. Clean going forward says nothing about the double-pays that shipped last month. Operating an agent means owning its past outputs, not just its next one. Reconcile what already went out, or the incident isn't closed.

    Max: So the instinct is: the trace names the broken layer, fix that layer with the smallest change that holds, and then prove it forward with a regression and backward with a reconciliation.

    Koko: That's the whole thing. Write that one down.

    Max: Alright. We've covered a lot across these three modules. Can you tie the thread?

    Koko: Three instincts, and they build on each other. First: make the run observable, so when something goes wrong you debug from the trace, not from the agent's narration of what it thinks it did.

    Max: Because the narration is a post-hoc story.

    Koko: Often a confident one. Second: release like an operator — SLOs, staged rollout, a live fallback, a rollback you can reach in minutes. Ship behind gates, not into the dark.

    Max: And third: when it breaks, fix the smallest effective thing and prove it. Regression plus reconciliation. Never a hopeful redeploy.

    Koko: That's the difference between launching an agent and operating one. And operating one is the whole job. Launching gets you to day one. Operating gets you to year two.

    Max: And in the work we do — advising companies under real financial pressure — that distinction is exactly where credibility gets built or lost.

    Koko: You're not the person who handed over a demo. You're the person who owns the system through its first failure. That's a different kind of engagement, and a much more valuable one.

    Max: I feel like I actually have a framework now, not just a checklist.

    Koko: That's exactly what these instincts are for. You want to keep sharpening this — the guided journey and the labs that let you practice all of it hands-on are at KokoAI Academy, on koko knows dot A I.

    Max: Worth the trip.

    Koko: You already know more about operating agents than most people who are shipping them right now — go use it.