agui-dotnet-human-in-the-loop

Installation
SKILL.md

AG-UI .NET — human in the loop (approval & interrupts)

Goal: stop an agent run at a decision point, hand control to a person, and resume the same run with their decision — either approving a sensitive tool call or supplying input the agent asked for.

A paused run completes its turn with RUN_FINISHED { outcome: interrupt }. The client inspects the response, gets the human decision, then sends a follow-up turn that carries the answer; the SDK reconnects it to the paused tool call so the run continues.

Approval: gate a tool behind a human yes/no

This is the simple path and needs no custom endpoint code — ToChatRequestContext handles the resume.

Server: wrap the sensitive tool

Wrap the function in ApprovalRequiredAIFunction. When the model calls it, the function-invoking client raises a ToolApprovalRequestContent instead of executing:

using Microsoft.Extensions.AI;

var deleteFile = new ApprovalRequiredAIFunction(
    AIFunctionFactory.Create(DeleteFile, "delete_file", "Deletes a file."));
Installs
10
GitHub Stars
20.8K
First Seen
Jun 30, 2026