Skip to lesson

NVIDIANVIDIA-Certified Professional: Agentic AI2026-1010.4 Enable human oversight and intervention for accountability and trust.

Stop agent runs and reconcile their effects

Completed by the knowledge check

Learning objective

Implement interrupts, overrides, and safe cancellation.

Core idea

An interrupt preserves a decision point, an override changes an authorized decision, and cancellation requests that execution stop. None automatically reverses an external write. Safe intervention requires knowing which actions have not started, which are in flight, and which have completed.

See 10.1.1 for the controls a person uses and 10.1.2 for synchronous versus asynchronous review. This lesson focuses on the executor: what happens when a stop request races with a tool call, how resume can repeat work, and when you need compensation instead of another execution attempt.

Treat “stop requested” and “effects reconciled” as separate application outcomes. The first confirms that the system received an intervention; the second confirms what actually happened to the business operation.

How it works

Interrupt before the next consequence

A NeMo Agent Toolkit function pauses the workflow when it awaits UserInteractionManager.prompt_user_input(...); over HTTP, the execution then reports interaction_required. Place that interaction before the next action that needs review. A prompt after sending a message can influence subsequent work, but cannot prevent the message already sent.

For a Python LangGraph implementation, interrupt() saves graph state through a checkpointer and waits for external input. Resume uses Command(resume=...) with the same configurable.thread_id. The interrupted node restarts from its beginning on resume; code before the interrupt executes again. Keep side effects after the interrupt, isolate them into separate nodes where possible, and make repeatable effects idempotent as the documentation recommends.

An interrupt is therefore a controlled suspension point, not an arbitrary freeze of every external service. If another branch has already submitted an operation, the intervention must account for that branch independently. The workflow’s durable state and the downstream system’s state can differ after a timeout or lost response.

Apply overrides to a specific pending operation

In NeMo Agent Toolkit, HumanPromptBinary presents a binary_choice prompt; the HTTP interface documents a Continue/Cancel pair and a selected_option response. Your tool interprets that choice to permit or deny the pending operation before execution. See 10.1.1 for the control itself. Choosing Cancel at this decision point denies the pending action; it does not undo an action already submitted.

LangChain’s HumanInTheLoopMiddleware distinguishes approve, edit, and reject. An edit changes tool arguments before execution; reject skips that tool call and supplies rejection feedback. These are useful override mechanisms when the operation is still pending.

The same documentation distinguishes respond, which acts as a successful tool result for an ask-user interaction. Do not use respond to express denial of a side-effecting action. Use the rejection path so the agent receives the correct execution outcome.

Revalidate edited arguments against the action policy from 10.4.1. Changing a recipient, resource, or scope can require a different reviewer. The LangChain documentation also warns that substantial edits can cause the model to reconsider its approach and potentially execute tools multiple times. An override must remain subject to downstream permissions and duplicate-effect protection.

Cancel local work cooperatively

The toolkit’s HTTP Interactive Execution reference lists running, interaction_required, oauth_required, completed, and failed as all possible execution statuses. It defines no canceled state in that interface. Keep the stop request and its reconciled outcome in your hosting application’s state rather than assuming a toolkit execution status proves cancellation.

For Python asynchronous execution, asyncio.Task.cancel() requests cancellation. It arranges for CancelledError to be raised in the coroutine at the next opportunity; it does not guarantee that the coroutine is canceled. Use try/finally for cleanup, and generally propagate CancelledError after cleanup if you catch it.

The service owner should connect the application stop request to the relevant task, stop admitting subsequent effectful operations, and wait for task termination before reporting that local execution ended. Do not label a closed browser tab or a disconnected response stream as proof that the worker terminated.

Stopping your coroutine does not by itself cancel a request a remote system already received. That remote system might finish the submitted operation. Record the submitted operation identifier and query the downstream result through that system’s supported interface. When the outcome remains unknown, preserve that state for reconciliation rather than reporting that nothing happened.

A stop request ends local execution only after task termination, while a request a remote system already received still needs its downstream result queried.

A stop request ends local execution only after task termination, while a request a remote system already received still needs its downstream result queriedStart at the application stop request. It stops admitting subsequent effectful operations and, connected to the relevant task, makes Task.cancel() request cancellation; after waiting for task termination, local execution has ended. On the dotted path, cancellation does not by itself cancel a request a remote system already received: its submitted operation identifier is used to query the downstream result, and an outcome that remains unknown is preserved for reconciliation.connect to the relevant taskdoes not by itself cancelsubmitted operation identifieroutcome remains unknownApplication stoprequestStop admittingsubsequenteffectfuloperationsTask.cancel()requestscancellationWait for taskterminationLocal executionendedRequest a remotesystem alreadyreceivedQuery thedownstream resultPreserve thatstate forreconciliation

Compensate completed effects

Microsoft’s Compensating Transaction pattern records completed steps and the information needed to undo their business effects. Compensation is application-specific, can fail, and need not restore the original state or run in the exact reverse order. Its steps should be idempotent so a failed compensation can resume safely.

Define a compensation record for each reversible effect: the original operation identifier, observed outcome, corrective action, and recovery status. An operator may need to resolve a nonrefundable or irreversible effect manually. Distinguish that unresolved business consequence from the local worker’s successful cancellation.

Key distinctions and trade-offs

Select the intervention from the execution phase:

InterventionAppropriate phaseMechanismRemaining cost or risk
InterruptBefore a decision-dependent effectToolkit prompt_user_input(...) or LangGraph interrupt()Waiting state and resume management
OverridePending operation with reviewable argumentsToolkit HumanPromptBinary; LangChain edit or rejectRevalidation and changed agent behavior
Local cancellationRunning asynchronous workPython Task.cancel() and cleanupCooperative response; remote work can continue
CompensationEffect already completedRecorded, idempotent corrective commandsExtra operations and incomplete business recovery

Do not put an external write before a replayable interrupt and assume a checkpoint prevents duplicates. Persistence records workflow progress; replay behavior still determines which code runs again. Likewise, an override for future steps cannot rewrite a completed transfer into a different destination.

Architecture / decision scenario

A conference organizer’s meeting assistant sends follow-up invitations to 600 attendees in batches. The operator notices an incorrect venue after 120 invitations have completed; 10 more are in flight and 470 have not started. The business requires the send pipeline to acknowledge stop requests within two seconds and a human to review corrections within ten minutes.

One proposal closes the streaming connection and tells the operator that the run was canceled. Another rewinds the workflow checkpoint and resends the full list with corrected text. The first lacks proof that the worker stopped; the second can duplicate invitations already delivered.

The application owner chooses a separate stop transition. It closes admission to the 470 unstarted invitations, requests local task cancellation, and reconciles the 10 submitted operations using their downstream identifiers. The operator receives the actual completed, prevented, and unresolved counts. The owner measures acknowledgment latency separately from reconciliation time.

For completed invitations, the event manager approves a correction campaign as a compensating business action. A pending invitation can instead receive an edit before execution, subject to the same authorization checks. If the review workflow uses LangGraph, its resume path keeps sends out of code that replays before interrupt().

A cancellation test injects the stop request before submission, during a lost response, and after completion. Success means each phase produces an accurate business outcome and a bounded recovery path, rather than one reassuring status for all three.

Common exam traps

  • Treating cancellation acknowledgment as proof that remote effects stopped.
  • Assuming code before a LangGraph interrupt runs only once.
  • Using respond as denial of a side-effecting tool call.
  • Swallowing CancelledError and continuing the workflow.
  • Treating compensation as an atomic rollback with no further failure modes.

Where the exam guide differs

Note:

The study guide’s suggested readings use “NVIDIA Agent Intelligence Toolkit.” The product documentation calls it NeMo Agent Toolkit. The guide’s objective says “intervention.” For an exam item using that term, choose an interrupt, override, or cancellation from the execution phase, and account separately for effects already completed.

What to remember

Interrupt pending decisions, validate overrides, and cancel running work through its execution mechanism. Reconcile submitted effects before declaring the business operation stopped. Completed effects need compensation or an explicit unresolved outcome, even after the local task terminates.

Knowledge check

References