Agent Operations: See, Control, and Optimize Agents
Operate agents you did not write: see every step, stop any run, measure before you trust.
Agents in production fail quietly. A planner loops on a dead courier API and each turn costs more than the last; a refund runs because the approval lived in a prompt; a new classifier goes live with no record of what the old one said. The fix is an operator plane that sits outside the model: a trace for every run, controls a person can change at 3am, and a typed decision model that runs in shadow until your own labels say it may act.
What you learn
- Trajectories as traces: OpenTelemetry GenAI agent and tool spans, Laminar session replay, LangSmith Studio, Langfuse and Phoenix agent views, and Claude Code telemetry as a worked example
- Runtime control outside the model: allowlists and permission order, hooks as policy, approvals that park instead of block, budgets, kill switches, circuit breakers and sandboxes
- Typed decisions with the TypeSafe Jev model: the System One API, noul, choice and score questions, probabilities and confidence, the SDKs, and the vendor list of weaknesses
- Confidence-gated routing, shadow mode beside an existing classifier, fail-open inside one timeout, and calibration with reliability bins, ECE and threshold tuning
- Optimizing agents with trajectory evals, cost per task, prompt caching, model routing, context pruning and parallel tool calls, plus incident response from detection to postmortem
Tools you will actually touch
The assignment pack
An online retailer runs a support agent on 38,000 tickets a month. Last quarter it looped overnight on a courier outage, paid eleven refunds nobody approved, and switched to a new intent classifier with no shadow period. Wrap the agent in an operator plane so none of that can happen silently again, and bring in a typed decision model only as far as your measurements allow.
- One OpenTelemetry trace per run with GenAI-convention spans, and tokens and cost on the root that reconcile with the children
- Five budgets checked before the spend, with the exhausted dimension on the trace and a handoff that keeps the findings
- Refunds park in an approval queue with their arguments and pay exactly once when a human approves; non-allowlisted tools are denied
- An out-of-band kill switch that halts a running agent within one step
- A router that runs the decision model in shadow beside the rules, gates live mode on a measured threshold, and fails open inside one timeout
- A postmortem whose trace id, dimension and cost a reviewer can find in the spans
Approval lives in the prompt, budgets are checked after the spend, and the new classifier went live on a demo.
Every run traced and costed, every control enforced outside the model, and a threshold that came from labelled data.
Scoped kill switches with an audit trail, per-route thresholds argued in money, a circuit breaker on the decision service, and an eval case built from the incident trajectory.
The tutorial pack
Trace an agent, stop it, and route beside it
- 1Export one trace per run with invoke_agent, chat and execute_tool spans, and read it with the five trajectory questions
- 2Watch a planner loop with the ceilings pushed back, then stop it with a ledger checked before the spend
- 3Deny a tool that is not allowlisted, park a refund in an approval queue, and approve it twice to prove it pays once
- 4Pull the kill switch before a run and in the middle of one
- 5Run a System One decision stub in shadow beside the rules classifier and label the disagreements
- 6Calibrate from the shadow log, set the measured threshold, and compare it with the vendor example floor
Give the router a generous 30 second timeout and freeze the decision service with docker pause. One ticket waits 30.2 seconds for an answer that never comes, and every ticket behind it waits too. The SDK defaults behave the same way: 31.2 seconds to give up on a hung listener. Then fix it to one 0.8 second timeout with no retries and watch the same ticket finish in under a second.
- Cost of a normal ticket against a runaway at its ceiling and with the ceilings removed
- Refund lines after two approvals of one parked call, and tool calls before a mid-run kill took effect
- Shadow agreement, expected calibration error, the measured threshold, its coverage, and live accuracy against rules alone
You must be able to answer
AI use is mandatory on every assignment. The integrity mechanism is defend-your-work, so these are the questions that decide whether the work counts.
- “Here is a run that cost forty times the median. Using only its spans, where did the money go and where did it first diverge from a good run?”
- “Your decision service starts answering in four seconds. What does every in-flight ticket experience, and which number on which dashboard moves first?”
- “Defend your router threshold: where did the number come from, what coverage and accuracy does it buy, and what would make you change it?”
Want to be walked through this phase?
The packs are delivered with live teaching, reviewed assignments, and a defence.
Train with me