Hands holding a smartphone above a laptop on a wooden table, banner image on the How to supervise an AI agent page

HiringsAI blog

How to supervise an AI agent

Supervision is four duties, not a dashboard: see what the agent did, gate what it may do, stop it when it should stop, measure whether it is improving. How LangChain, the tracing tool, OpenAI and Anthropic document each duty.

four duties, one supervisor (you)seetraces: every step frominput to output, as runsgateper-tool policy: approve,edit, reject, respondstopescalation triggers andstopping conditionsmeasureevals set the baseline;iterate against iteach duty has a documented mechanism behind itThe four-duty framing is our synthesis; no vendor presents it as one model
01

The short answer

An unsupervised agent is not an autonomous success story; it is an unaudited one.

The documentation of four organizations converges on the same four duties
See: the tracing tool'sSee: the tracing tool's observability documentation defines traces as the series of steps an agent takes from input to output, each step a run you can inspect, with selective tracing when you only want some invocations and anonymizers to keep sensitive data out of the traces.
Gate: LangChain's human-in-the-loop middleware checks every toolGate: LangChain's human-in-the-loop middleware checks every tool call against a configurable per-tool policy and pauses execution for a human decision, which can be approve, edit, reject or respond, with conditional interrupts that only pause when a predicate on the call's arguments says so.
Stop: OpenAI's practical guideStop: OpenAI's practical guide names two triggers that should hand control to a person, exceeding failure thresholds and high-risk actions, and Anthropic's guide notes that agents commonly carry stopping conditions like a maximum number of iterations.

The short answer

An unsupervised agent is not an autonomous success story; it is an unaudited one. The documentation of four organizations converges on the same four duties. See: the tracing tool's observability documentation defines traces as the series of steps an agent takes from input to output, each step a run you can inspect, with selective tracing when you only want some invocations and anonymizers to keep sensitive data out of the traces. Gate: LangChain's human-in-the-loop middleware checks every tool call against a configurable per-tool policy and pauses execution for a human decision, which can be approve, edit, reject or respond, with conditional interrupts that only pause when a predicate on the call's arguments says so. Stop: OpenAI's practical guide names two triggers that should hand control to a person, exceeding failure thresholds and high-risk actions, and Anthropic's guide notes that agents commonly carry stopping conditions like a maximum number of iterations. Measure: OpenAI's guide prescribes evals to establish a performance baseline before optimizing, and Anthropic's closes its pattern catalog by repeating that you should measure performance and iterate. Four duties, four mechanisms, all quoted from the pages below.

Four pages were: LangChain's human-in-the-loop middleware documentation, the tracing tool's observability guide, OpenAI's practical guide to building agents, and Anthropic's building-effective-agents engineering guide. The four-duty framing is our synthesis; each mechanism is attributed to its page.

02

See: traces are the unit of supervision

The tracing tool's observability guide defines the vocabulary: a trace is the series of steps your agent takes from input to output, and each individual step is a run.

With tracing enabled youWith tracing enabled you, With tracing enabled you can debug a locally running agent and monitor it through dashboards, and the guide's own pattern list for workflow tracing is pointed: follow the trace to see how data flows through each step.
Two operational details matter for real supervision
Supervision you cannot show to security is not supervisionIt is surveillance debt. one trace = the run, made legible input run: tool call args + result run: model prompt + reply output each box is a run; the chain is the trace (the guide's definitions) debug the local agent from its traces monitor dashboards in production two uses named on the same page traces are also the evidence when someone asks what the agent did and why trace hygiene (the guide's own sections) trace selectively a context manager marks what is traced and what is not volume stays reviewable anonymizers prevent sensitive data from being logged in traces visibility without exposure supervision your security team can accept, per the guide's own mechanisms

See: traces are the unit of supervision

The tracing tool's observability guide defines the vocabulary: a trace is the series of steps your agent takes from input to output, and each individual step is a run. With tracing enabled you can debug a locally running agent and monitor it through dashboards, and the guide's own pattern list for workflow tracing is pointed: follow the trace to see how data flows through each step. Two operational details matter for real supervision. Selective tracing, via a context manager, lets you trace specific invocations or parts of the agent rather than everything, so the volume stays reviewable. And anonymizers can prevent sensitive data from being logged in traces at all, which is the difference between a supervision system your security team accepts and one it bans. Supervision you cannot show to security is not supervision; it is surveillance debt.

one trace = the run, made legibleinputrun: tool callargs + resultrun: modelprompt + replyoutputeach box is a run; the chain is the trace (the guide's definitions)debug the local agentfrom its tracesmonitor dashboardsin productiontwo uses named on the same pagetraces are also the evidence when someone asks what the agent did and why trace hygiene (the guide's own sections)trace selectivelya context manager marks whatis traced and what is notvolume stays reviewableanonymizersprevent sensitive data frombeing logged in tracesvisibility without exposuresupervision your security team can accept, per the guide's own mechanisms
03

Gate: a policy on the tools, not a promise from the model

LangChain's human-in-the-loop middleware page is the most concrete supervision mechanism in the reviewed set.

You add the middleware to the agent with an interrupt_on mappingEach tool name maps to True (pause with all decision types allowed), False (auto-approve), or a config naming the allowed decisions.
The page's own example is instructiveThe page's own example is instructive, write_file gets full review, execute_sql allows only approve and reject (no editing), and read_data is not gated at all.
When a call matches the policy, execution pausesThe checkpointer saves the graph state, and a human decision resumes it.
Four decision types are definedFour decision types are defined, approve executes the tool as proposed, edit modifies the arguments first (the page warns to edit conservatively, since big changes can make the model re-evaluate and act unexpectedly), reject skips the call and returns feedback to the agent, and respond answers an ask-user style tool directly.

Gate: a policy on the tools, not a promise from the model

LangChain's human-in-the-loop middleware page is the most concrete supervision mechanism in the reviewed set. You add the middleware to the agent with an interrupt_on mapping: each tool name maps to True (pause with all decision types allowed), False (auto-approve), or a config naming the allowed decisions. The page's own example is instructive: write_file gets full review, execute_sql allows only approve and reject (no editing), and read_data is not gated at all. When a call matches the policy, execution pauses, the checkpointer saves the graph state, and a human decision resumes it. Four decision types are defined: approve executes the tool as proposed, edit modifies the arguments first (the page warns to edit conservatively, since big changes can make the model re-evaluate and act unexpectedly), reject skips the call and returns feedback to the agent, and respond answers an ask-user style tool directly. The page is careful about the last one: respond is for the human acting as the tool, and it must not be used to deny a side-effecting tool, because its message is treated as a successful tool result.

Two refinements keep the gate usable at volume. Conditional interrupts add a when predicate to a tool's config: the predicate receives the call request and returns True to interrupt or False to auto-approve, so you can gate on the arguments, pausing only the DELETEs and letting the SELECTs through, to borrow the page's SQL example shape. And batched versus per-call modes decide whether simultaneous paused calls arrive as one review queue in order or one interrupt each. Note what the gate is not: it is code around the tool call, not an instruction to the model to behave. A policy the model could talk its way out of is not a gate.

four ways to answer a paused tool call (LangChain's page)approverun it as proposed; the page'sexample: send the draft as writteneditchange the args first; the pagewarns: edit conservativelyrejectskip the call, return feedback;example: deny deletion, say whyrespondyou act as the tool (ask-user);never to deny side effectsreject and respond are marked with notification metadata, per the pagea respond reads as a successful tool result; do not deny with it (the page's warning) The policy is per tool, per call (the page's example shape)write_file: full review (all four)execute_sql: approve or reject onlyread_data: no gate (False)when predicate: gate on the argsconditional interrupts: True pauses, False auto-approves, per the pagecheckpointing is required for any of this; production needs a persistent checkpointerThe gate is code around the call, not an instruction to the model where the agent's reality check comes from (per Anthropic)environment feedbacktool results, code executionhuman feedbackat checkpoints or blockersThe page: agents gain ground truth from the environment at each stepsupervision supplies the second channel; the first is built into the loop
04

Stop: triggers and conditions that end the run

Supervision includes the right to stop.

OpenAI's practical guideOpenAI's practical guide names the two escalation triggers directly: exceeding failure thresholds, where you set limits on agent retries or actions and escalate when the agent crosses them, and high-risk actions, where anything sensitive, irreversible or high-stakes waits for human confirmation.
Anthropic's guide adds the quieter stopAnthropic's guide adds the quieter stop, agents commonly include stopping conditions such as a maximum number of iterations to maintain control, and agents pause for human feedback at checkpoints or when they hit blockers.
Read together, the two guides describe a run with three exitsIt finishes, it asks, or it is halted by a limit you set in advance.
A run with no designed exit is not autonomy it is driftEvery run needs a designed exit it finishes task complete; The good exit it asks checkpoint or blocker: pauses for a person it is halted retry / action threshold, or max iterations hit OpenAI's guide: escalate on failure thresholds and high-risk actions Anthropic's guide: stopping conditions like max iterations keep control a run with no designed exit is drift, not autonomy The loop that connects the four duties traces what happened evals judged vs baseline policy update gates tighten/loosen evidence, judgment, adjustment: supervision is a loop, not a launch setting synthesis: each node cites a reviewed mechanism; the loop itself is our frame

Stop: triggers and conditions that end the run

Supervision includes the right to stop. OpenAI's practical guide names the two escalation triggers directly: exceeding failure thresholds, where you set limits on agent retries or actions and escalate when the agent crosses them, and high-risk actions, where anything sensitive, irreversible or high-stakes waits for human confirmation. Anthropic's guide adds the quieter stop: agents commonly include stopping conditions such as a maximum number of iterations to maintain control, and agents pause for human feedback at checkpoints or when they hit blockers. Read together, the two guides describe a run with three exits: it finishes, it asks, or it is halted by a limit you set in advance. A run with no designed exit is not autonomy; it is drift.

every run needs a designed exitit finishestask complete;The good exitit askscheckpoint or blocker:pauses for a personit is haltedretry / action threshold,or max iterations hitOpenAI's guide: escalate on failure thresholds and high-risk actionsAnthropic's guide: stopping conditions like max iterations keep controla run with no designed exit is drift, not autonomy The loop that connects the four dutiestraceswhat happenedevalsjudged vs baselinepolicy updategates tighten/loosenevidence, judgment, adjustment: supervision is a loop, not a launch settingsynthesis: each node cites a reviewed mechanism; the loop itself is our frame
05

Measure: the baseline before the tuning

Both guides treat measurement as the precondition for every other decision.

OpenAI's model-selection advice is sequencedOpenAI's model-selection advice is sequenced, set up evals to establish a performance baseline, meet your accuracy target with the best models available, then optimize cost and latency by swapping in smaller models where they still achieve acceptable results, an approach that also tells you where the smaller models fail.
Anthropic's guide closesAnthropic's guide closes its entire pattern catalog with the same instruction generalized: the key to success, as with any LLM feature, is measuring performance and iterating on implementations, and complexity should be added only when it demonstrably improves outcomes.
Its evaluator-optimizer patternIts evaluator-optimizer pattern is the measurement loop built into the workflow itself, used when there are clear evaluation criteria and iterative refinement provides measurable value.
Supervision's fourth dutySupervision's fourth duty is what turns the other three from precautions into a system: traces tell you what happened, gates and stops control what may happen, and evals tell you whether any of it is working.

Measure: the baseline before the tuning

Both guides treat measurement as the precondition for every other decision. OpenAI's model-selection advice is sequenced: set up evals to establish a performance baseline, meet your accuracy target with the best models available, then optimize cost and latency by swapping in smaller models where they still achieve acceptable results, an approach that also tells you where the smaller models fail. Anthropic's guide closes its entire pattern catalog with the same instruction generalized: the key to success, as with any LLM feature, is measuring performance and iterating on implementations, and complexity should be added only when it demonstrably improves outcomes. Its evaluator-optimizer pattern is the measurement loop built into the workflow itself, used when there are clear evaluation criteria and iterative refinement provides measurable value. Supervision's fourth duty is what turns the other three from precautions into a system: traces tell you what happened, gates and stops control what may happen, and evals tell you whether any of it is working.

OpenAI's ladder: baseline first, optimize second1. evalsset the baseline2. best modelshit the accuracy target3. swap downsmaller where okThe guide's point: swapping also shows you where smaller models failAnthropic's version: measure performance, iterate; add complexity only on proofits evaluator-optimizer pattern is the measure loop inside the workflow itself three things supervision is notnot a prompt telling the model to be careful; the gate lives in codenot a dashboard nobody reads; traces exist to be reviewednot a one-time setup; both guides prescribe measure-and-iteratesynthesis of the vendors' documentation' mechanisms and warnings
06

Where this leaves you

Supervising an agent is a job with four duties, and each one has a documented mechanism rather than a hope.

Supervising an agent is a job with four dutiesSupervising an agent is a job with four duties, and each one has a documented mechanism rather than a hope.
See every run as a traceSee every run as a trace, with sensitive data anonymized and volume kept reviewable.
Gate the tools with a written policy, per tool and per callGate the tools with a written policy, per tool and per call, With a human decision behind the dangerous ones.
Design the exits finish, ask, or halt at a limit you chose
The agents that earn more autonomy are the ones whose supervision produced the evidence for it

Where this leaves you

Supervising an agent is a job with four duties, and each one has a documented mechanism rather than a hope. See every run as a trace, with sensitive data anonymized and volume kept reviewable. Gate the tools with a written policy, per tool and per call, with a human decision behind the dangerous ones. Design the exits: finish, ask, or halt at a limit you chose. And measure against a baseline, because the other three duties only tell you the agent behaved; the evals tell you it is good. The agents that earn more autonomy are the ones whose supervision produced the evidence for it.

The supervisor's five-line checklist1. tracing on: every run visible, sensitive data anonymized2. interrupt policy written: which tools, which decisions, per call3. conditional gates: pause on risky arguments, not on everything4. exits designed: failure thresholds, high-risk holds, max iterations5. baseline evals before any tuning; measure, then iterate
A wooden desk with glasses, a coffee cup, a plant and the edge of a laptop, banner image on the How to supervise an AI agent page

Keep reading, or try a tool.

Long-form guides on building, automating and AI computing.