ENGINEERING

We Didn't Turn Our Runbooks into Python, and Here Is Where We Drew the Line

By Subhojit Banerjee (Staff Engineering) · Dec 2026 · 4 min read

Deterministic code is cheap to write, so why keep LLMs in the diagnostic loop at all? Here is how we divided deterministic checks from model judgment.

Deterministic code is now almost free to write. So why not convert every runbook into a script and drop the non-determinism?

We tried to answer that honestly. Scripts win on repeatability, CI testing, cost, and audit. They lose on the incident nobody planned for. A runbook says: lag rising but ISR healthy? Suspect the consumer, unless a rebalance just happened. Writing that as code means a branch for every combination, and the incidents that hurt are the combinations nobody wrote.

There is a quieter failure as well. A script that returns OK because it checked the wrong thing is worse than an agent that says it is not sure.

The Operating Boundary

The rule we settled on is direct: code produces facts, enforces gates and permissions, and does all measurement. The LLM chooses what to look at, connects the findings, and explains them.

In practice, every measurable step in a runbook becomes a typed check. The runbook keeps the order, the interpretation, and what to rule out. A reasoning path that keeps reaching the same conclusion in replay gets promoted to code. A check that gives false confidence gets demoted.

We track one ratio: the share of runbook steps backed by a check. It should rise, and it should never reach 100%.

Netflix landed in the same place: constrain stochastic tools with a type system as the principle you defend hardest. The LLM can decide what a set of numbers means. It never decides what a number is.

Key Takeaways

  • Turn every measurable diagnostic step into a typed deterministic check.
  • Keep judgment, sequencing under ambiguity, and synthesis with the language model.
  • Track the ratio of runbook steps backed by typed checks: push it upward, but never aim for 100%.