agui-dotnet-human-in-the-loop

agui-dotnet-human-in-the-loop is a skill for Claude Code, Codex from ag-ui-protocol/ag-ui. It costs 206 tokens per session (1,347 once invoked), scanned A, original, MIT.

A .NET skill for pausing an AG-UI agent run so a person can approve a sensitive action or provide information, then resuming the same run.

In plain words
What is it for?
Use it to require approval before tools such as file deletion execute, or to interrupt a run, collect free-form user input, and continue with that answer.
Why use it?
It prevents an agent from taking a sensitive action without explicit human permission and lets people answer questions before the run continues.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Part of the ag-ui-dotnet plugin — 9 skills shipped together

Good fit Use it to require approval before tools such as file deletion execute, or to interrupt a run, collect free-form user input, and continue with that answer.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ag-ui-protocol/ag-ui/agui-dotnet-human-in-the-loop
About the project

AG-UI is an event-based protocol that lets AI agent backends communicate with user-facing applications. It standardizes agent events and inputs while supporting transports such as server-sent events, WebSockets, and webhooks. The catalogue add-ons help developers build integrations and applications around the protocol.

ag-ui-protocol/ag-ui · 15,802 stars · on GitHub · ag-ui.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ag-ui-protocol/ag-ui --skill agui-dotnet-human-in-the-loop
Clone the repo
git clone --depth 1 https://github.com/ag-ui-protocol/ag-ui

Made for: Claude Code, Codex.

Or install ag-ui-dotnet, the plugin that ships this one along with the rest of its 9 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agui-dotnet-human-in-the-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/ag-ui-protocol/ag-ui/agui-dotnet-human-in-the-loop/github.svg)](https://agentmods.dev/skills/ag-ui-protocol/ag-ui/agui-dotnet-human-in-the-loop)
Your own site
<a href="https://agentmods.dev/skills/ag-ui-protocol/ag-ui/agui-dotnet-human-in-the-loop"><img src="https://agentmods.dev/badge/skills/ag-ui-protocol/ag-ui/agui-dotnet-human-in-the-loop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agui-dotnet-human-in-the-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/ag-ui-protocol/ag-ui/agui-dotnet-human-in-the-loop"><img src="https://agentmods.dev/badge/skills/ag-ui-protocol/ag-ui/agui-dotnet-human-in-the-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 206 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,347 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 4
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00206 $0.01347
Opus 5 $0.00103 $0.00674
Sonnet 5 $0.00041 $0.00269
Haiku 4.5 $0.00021 $0.00135

Measured 10d ago against content hash bb287057eba0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

agui-dotnet-human-in-the-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sdks/dotnet/plugins/ag-ui-dotnet/skills/agui-dotnet-human-in-the-loop/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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."));

builder.Services.AddChatClient(/* provider IChatClient */)
    .ConfigureOptions(o => (o.Tools ??= []).Add(deleteFile))
    .UseFunctionInvocation();

Client: detect the request, decide, resume

The first turn returns a ToolApprovalRequestContent. Show it to the human, then resume by appending the request and the human's response and streaming again:

using Microsoft.Extensions.AI;

var messages = new List<ChatMessage> { new(ChatRole.User, "Delete report-draft.txt") };

var turn1 = new List<ChatResponseUpdate>();
await foreach (var u in client.GetStreamingResponseAsync(messages))
{
    turn1.Add(u);
}

var request = turn1.SelectMany(u => u.Contents)
                   .OfType<ToolApprovalRequestContent>()
                   .FirstOrDefault();

if (request is { ToolCall: FunctionCallContent call })
{
    bool approved = AskHuman($"Run {call.Name}?");   // your UI / prompt

    messages.Add(new ChatMessage(ChatRole.Assistant, [request]));
    messages.Add(new ChatMessage(ChatRole.User, [request.CreateResponse(approved)]));

    await foreach (var u in client.GetStreamingResponseAsync(messages))
    {
        Console.Write(u.Text);   // runs the tool if approved, skips it if not
    }
}

Read the full file on GitHub · 108 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 108 lines · 206 tokens per session scan A bb287057eba0

Subscribe to this mod's changes

agui-dotnet-human-in-the-loop is a skill published in the GitHub repository ag-ui-protocol/ag-ui (15,802 stars, last pushed today), licensed MIT. It adds 206 tokens to every session and 1,347 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.