MentorAgent.Declarative 1.0.0-rc.14

Suggested Alternatives

Novior.MentorAgent.Declarative

Additional Details

Renamed to Novior.MentorAgent. From 1.0.0 the packages, namespaces and assemblies are Novior.MentorAgent.*; the README section "Migrating from the MentorAgent.* packages" explains the move.

This is a prerelease version of MentorAgent.Declarative.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package MentorAgent.Declarative --version 1.0.0-rc.14
                    
NuGet\Install-Package MentorAgent.Declarative -Version 1.0.0-rc.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MentorAgent.Declarative" Version="1.0.0-rc.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MentorAgent.Declarative" Version="1.0.0-rc.14" />
                    
Directory.Packages.props
<PackageReference Include="MentorAgent.Declarative" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MentorAgent.Declarative --version 1.0.0-rc.14
                    
#r "nuget: MentorAgent.Declarative, 1.0.0-rc.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MentorAgent.Declarative@1.0.0-rc.14
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MentorAgent.Declarative&version=1.0.0-rc.14&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MentorAgent.Declarative&version=1.0.0-rc.14&prerelease
                    
Install as a Cake Tool

MentorAgent.Declarative

Preview Release — MentorAgent is currently in public preview. APIs may change before the stable release.

Optional package. Install it only if you want to define specialist agents in YAML files instead of C# classes. Everything MentorAgent does works without it.

Define a Level-2 specialist in a text file, drop it next to your application, and the assistant can hand off to it — no new class, no [MentorAgent] attribute, no recompile of the agent's behaviour.

Built on the Agent Framework's declarative agent factory (Microsoft.Agents.AI.Declarative).


Package Family

Package Install when
MentorAgent Blazor Server app
MentorAgent.Server Web API / headless backend, or Blazor Auto server-side project
MentorAgent.Blazor Blazor WASM / Blazor Auto client project
MentorAgent.Abstractions Never directly — it arrives with any of the above
MentorAgent.Declarative ← you are here You want YAML-defined agents. Add it alongside MentorAgent or MentorAgent.Server

Table of Contents


What it does

MentorAgent's three-level agent model has a coordinator (L1) that can hand off to specialists (L2). Normally a specialist is a C# class:

[MentorAgent(Name = "ShippingAgent", Description = "Answers questions about deliveries")]
public class ShippingAgent                      // register it: builder.Services.AddScoped<ShippingAgent>();
{
    [MentorAction(Description = "Looks up a tracking number")]   // tool name: get_tracking
    public string GetTracking(int orderId) => /* … */;
}

This package adds a second way to declare the agent — its name, its instructions, its model settings and which tools it may use — as a file:

kind: Prompt
name: ShippingAgent
description: Answers questions about deliveries and shipping costs
instructions: |
  You handle shipping questions only. Use the available tools to look up real orders;
  never invent a tracking number. If the question is not about shipping, say so and stop.
model:
  options:
    temperature: 0.2
tools:
  - kind: function
    name: get_order_status
  - kind: function
    name: get_all_orders

Both kinds end up in the same handoff graph, so route_to_specialist reaches them identically and the user cannot tell which is which.


Getting started

Installation

dotnet add package MentorAgent.Declarative

Registration

using MentorAgent.Declarative;   // AddMentorAgentDeclarative
using MentorAgent.Extensions;    // AddMentorAgent

builder.Services.AddMentorAgentDeclarative(o => o.Directory = "Agents");

builder.Services.AddMentorAgent(o =>
{
    o.ChatClient     = chatClient;
    o.AppName        = "ShopFlow";
    o.ScanAssemblies = [typeof(Program).Assembly];
});

Order does not matter — MentorAgent asks every registered agent source while it builds a coordinator. A coordinator is built lazily for each session scope (each Blazor circuit, each SignalR connection to MentorAgent.Server, each SSE request), on its first message, or once at startup when WarmUpAtStartup is on. So the definitions are read again for every new scope. An edited file reaches new sessions without a restart, existing sessions keep the agents they were built with, and the log lines shown under How to test it appear then, not when the application starts.

Make sure the files reach the output folder

A definition that is not copied is the most common way this feature appears not to work. In your .csproj:

<ItemGroup>
  <Content Include="Agents\**\*.agent.yaml" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

If the directory is missing you get a warning naming the resolved path, [MentorAgent:Declarative] Directory '…' does not exist., when a coordinator is built: on a session's first message, or at startup with WarmUpAtStartup. That message exists because the failure is otherwise silent.


The YAML format

The schema comes from the Agent Framework, not from MentorAgent. The fields that matter in practice:

Field Meaning
kind Prompt for a prompt-based agent. Required
name The specialist's name. This is what appears in handoff logs — keep it stable
description What this specialist is for. The coordinator reads it to decide when to route here
instructions The agent's system prompt, used exactly as written. Use a \| block for multiple lines. MentorAgent adds nothing to it, including the grounding rule its generated specialist prompts carry, so write your own: state only facts a tool returned; if nothing provides what is asked, say so, and never estimate or invent a number, a name, a date or a status. Without it, a specialist asked for a figure its tools cannot return may make one up
model.options temperature, topP, and other per-agent model settings
tools Names of tools this agent may call — each entry needs kind and name, see below
outputSchema Optional JSON-schema-style shape for a typed answer

description is worth care: it is the coordinator's only basis for choosing this agent over another. "Handles orders" competes badly with "Handles orders, shipping and returns for existing customers".

Two format details that cost an afternoon

Neither is in the Agent Framework guide, and both fail in a way that points somewhere else.

Every tools entry needs kind. The reader accepts codeInterpreter, fileSearch, function, webSearch and mcp, but function is the only one MentorAgent keeps: it binds to a tool of your application. Omit kind and loading fails with NotSupportedException — not a validation message naming the line.

The other four are not names of your tools, and they do not add anything. The Agent Framework would turn them into provider-hosted tools (web search, code interpreter, file search, or a remote MCP server at whatever endpoint the file gives), configured by the file alone. MentorAgent removes them from the agent when it loads and logs a warning naming them:

[MentorAgent:Declarative] 'shipping.agent.yaml': removed web_search. A definition file can only use the application's own tools (`kind: function`); web search, code interpreter, file search and MCP servers are configured by the host, through MentorOptions.HostedTools and McpServers.

The agent still loads, with its function tools only. If those tools cannot be taken out, the whole agent is skipped with an error instead. To give the assistant these capabilities, configure them in the host (MentorOptions.HostedTools, McpServers), where the host's own controls apply.

Folded scalars (>) are not supported by this reader. Use |, or a single line. With > the parse error reports the end of the file, so you will look everywhere except at the block that caused it:

description: >                     # ✗ parse error, blamed on the last line of the file
  Handles shipping and delivery.

description: |                     # ✓
  Handles shipping and delivery.

description: Handles shipping.     # ✓

Tools: named, not defined

A tools: entry names a tool; it does not create one. The name must match one of your application's Level-1 methods: a public instance method with [MentorAction] or [Description] on a class in ScanAssemblies that is registered in DI, including a [MentorSkill] class. That is the whole list the factory is given. The methods of a C# [MentorAgent] specialist, MCP client tools, [MentorTeam] tools and the built-in tools (navigation, memory, UI actions) are not in it, so naming one of them binds nothing real (see below).

tools:
  - kind: function              # required — see below
    name: get_order_status      # must match exactly; a typo gives the agent a declaration with nothing behind it

The tool name is the snake_case of the C# member, with a trailing Async dropped: GetOrderStatusAsync() → get_order_status, matched exactly and case-sensitively. Get it wrong and nothing tells you at load time. The agent does not simply go without the tool: for a name that matches nothing, the Agent Framework creates a declaration-only function of that name and gives it to the agent. The model sees it and may call it, but there is no code behind it, so the call never runs and the specialist has no data to answer with. Check every name against your [MentorAction] / [Description] methods.

This is the design point of the whole package. MentorAgent hands the factory the application's real tool list, already wrapped in its gate, so a YAML agent calling create_order still hits:

  • RequiredRoles — the role check, exactly as a C# specialist does
  • human approval — the confirmation banner, if the tool requires one
  • action feedback, per-tool metrics and tracing

An agent defined in a file therefore has no capability your application did not already have, and no shortcut around the controls on it. That holds for the other kind values too: webSearch, codeInterpreter, fileSearch and mcp entries would add provider-hosted tools outside your list, so MentorAgent removes them with a warning (see Two format details that cost an afternoon).


Security — a definition file is code

Read this before pointing Directory anywhere.

A definition chooses the model, writes the system instructions, and names the tools the agent may call. Anyone who can write that file can rewrite the assistant's persona and widen which tools it reaches for. That makes it code, whatever its file extension says.

  • Load only from deploy-time locations. An application directory or an embedded resource. Never an upload folder, never a user-writable path, never a path built from request input.
  • Review definitions like source. Put them in version control and through the same review as a .cs file.
  • The gate still holds. A file cannot invent a tool or bypass a role check — that is enforced, not advisory. A kind: function entry resolves only against your own, gated tools, and a webSearch, codeInterpreter, fileSearch or mcp entry is removed with a warning, so a file cannot add web search, a code interpreter or an MCP server of its own choosing. But it can instruct the agent to try things, so the controls on your tools remain the thing that actually stops it.

The second point is the one people skip: YAML feels like configuration, and configuration feels safe to let more people edit.


When to use YAML and when to use C#

YAML C# [MentorAgent]
Change an agent's instructions Edit a file Recompile
New tool / new logic Not possible — tools stay in C# Where it belongs
Compile-time checking None; a bad tool name is silent Full
Who can author it Anyone who can edit a reviewed file Developers
Fits when Wording and routing get tuned often The agent has real behaviour

A good rule: behaviour in C#, phrasing in YAML. If you find yourself wanting a loop or a branch in a definition file, that agent wants to be a class.

You can mix freely — both kinds coexist in the same handoff graph.


Loading definitions from somewhere else

Definitions do not have to be files. Pass them as strings for agents stored in a database, a configuration service, or a test:

builder.Services.AddMentorAgentDeclarative(o =>
{
    o.Definitions.Add("""
        kind: Prompt
        name: FaqAgent
        description: Answers frequently asked questions about the shop
        instructions: Answer briefly, in the user's language. Say so when you do not know.
        """);
});

To ship definitions inside the assembly, the safest deploy-time location, embed them and pass their text as inline definitions:

<ItemGroup>
  <EmbeddedResource Include="Agents\**\*.agent.yaml" />
</ItemGroup>
builder.Services.AddMentorAgentDeclarative(o =>
{
    var asm = typeof(Program).Assembly;
    foreach (var name in asm.GetManifestResourceNames()
                            .Where(n => n.EndsWith(".agent.yaml", StringComparison.Ordinal))
                            .Order(StringComparer.Ordinal))
    {
        using var reader = new StreamReader(asm.GetManifestResourceStream(name)!);
        o.Definitions.Add(reader.ReadToEnd());
    }
});

For a fully custom source — one that hits your own store, or refreshes on a schedule — implement IMentorAgentSource from the MentorAgent package directly and register it. AddMentorAgentDeclarative is one implementation of that interface, not a privileged path:

using MentorAgent.Core;       // IMentorAgentSource, MentorAgentSourceContext
using Microsoft.Agents.AI;    // AIAgent

public sealed class DatabaseAgentSource : IMentorAgentSource
{
    // Called once per coordinator build, i.e. once per session, not once per process.
    // Cache here if reading your store is expensive.
    public async Task<IReadOnlyList<AIAgent>> GetAgentsAsync(
        MentorAgentSourceContext context, CancellationToken ct = default)
    {
        // context.ChatClient — your MentorOptions.ChatClient wrapped only in the token meter
        //                      (not the coordinator's pipeline), so usage lands in the metrics
        // context.Tools      — the Level-1 tools, already gated
        …
    }
}

builder.Services.AddSingleton<IMentorAgentSource, DatabaseAgentSource>();

Configuration options

Option Type Default Description
Directory string? null Folder to scan, absolute or relative to the app base directory. Deploy-time paths only
SearchPattern string "*.agent.yaml" File pattern inside Directory
Recursive bool false Scan subdirectories too
Definitions IList<string> empty YAML supplied inline, loaded in addition to Directory
ConfigurationSection string? null Name of the configuration section the YAML may reference. null exposes nothing

SearchPattern and Recursive — what the scan is allowed to reach

Both defaults are deliberately narrow, and widening them is a decision worth making on purpose rather than by accident:

builder.Services.AddMentorAgentDeclarative(o =>
{
    o.Directory = "Agents";

    // Default "*.agent.yaml", not "*.yaml". A deployment folder holds other YAML — a CI file,
    // a Helm values file — and reading one of those as an agent definition would at best fail
    // loudly. Widen it only if your definitions genuinely do not carry the suffix.
    o.SearchPattern = "*.agent.yaml";

    // Default false. A nested folder is exactly where a definition gets added without review,
    // and a definition file is code: it picks the model, writes the instructions and names the
    // callable tools. Turn it on when your layout needs it, not "just in case".
    o.Recursive = true;    // now Agents/support/*.agent.yaml is loaded too
});

Inline Definitions are loaded first (named inline[0], inline[1], … in the log), then files in a stable order (sorted by path), so two definitions declaring the same agent name resolve identically on every machine rather than depending on the file system's enumeration order. A missing Directory is warned about — almost always a CopyToOutputDirectory miss, where the assistant otherwise starts fine and is simply missing a specialist nobody thinks to look for.

ConfigurationSection — exposing configuration to a definition

Default null: no configuration reaches the YAML at all, and the definitions are self-contained. Set it to expose one section, so a definition can reference values instead of hardcoding them:

// appsettings.json
{
  "AgentSettings": {
    "SupportEmail": "help@contoso.com",
    "MaxRefund": "250"
  }
}
builder.Services.AddMentorAgentDeclarative(o =>
{
    o.Directory            = "Agents";
    o.ConfigurationSection = "AgentSettings";   // only AgentSettings:* reaches the YAML
});

The values arrive as Power Fx variables, one per key, named by the key's full configuration path: AgentSettings:SupportEmail, AgentSettings:MaxRefund, plus one for the section AgentSettings itself. The factory enumerates the section with AsEnumerable(), which does not make paths relative. How a definition references them is part of the Agent Framework's declarative schema, not something MentorAgent defines, so check the framework's documentation for the expression syntax before relying on it.

Name a section. Never hand over the whole IConfiguration. The factory loads whatever configuration it is given into the Power Fx engine as variables — one per key, in its constructor. A single key that Power Fx rejects as a name (in the version this package uses, an empty or whitespace-only key) takes the entire factory down before any definition is read. The exception does not say which key it was: Power Fx's message is the fixed text Invalid name: ${name}. The placeholder is never filled in, so do not look for a key literally named ${name}. This is not hypothetical: a key contributed by an unrelated configuration provider produced

ArgumentException: Invalid name: ${name}

and no agents loaded at all. Naming one section bounds the blast radius to keys you control.

MentorAgent catches that failure and logs the cause rather than letting it surface as a generic startup error, then returns no agents:

[MentorAgent:Declarative] The agent factory rejected the configuration exposed to YAML
(AgentSettings). Every key in it becomes a Power Fx variable and must be a valid identifier.
Narrow MentorDeclarativeOptions.ConfigurationSection, or leave it null.

If you see it, the fix is a narrower section — or null, which is the right setting unless you actually need substitution.


How to test it

  1. Put shipping.agent.yaml in an Agents folder, with CopyToOutputDirectory.
  2. Start the app and send a first message (or set WarmUpAtStartup = true, which builds a coordinator at startup). The log should then show, at Information level (the tool count is every Level-1 tool handed to the factory, not the number the file names):
    [MentorAgent:Declarative] Agent 'ShippingAgent' loaded from shipping.agent.yaml (12 tool(s) available to it).
    [MentorAgent] Handoff: declarative agent 'ShippingAgent' added to workflow.
    
  3. Ask something in that agent's area — "where is order 1001?". The answer should come back through it.
  4. Negative check — a bad file does not take the app down. Break the YAML deliberately: you get 'shipping.agent.yaml' could not be loaded — skipped, and everything else still starts.
  5. Negative check — the gate holds. Name a tool carrying RequiredRoles in the YAML and ask the agent to use it while unauthenticated. It must be refused, the same way a C# specialist is, and no action taken.

Why a separate package

Microsoft.Agents.AI.Declarative brings the Power Fx interpreter (YAML expressions are Power Fx), the Agents object model in three assemblies, Microsoft.ML.Tokenizers and several more.

That is a fair price for file-based authoring and pure overhead for everyone else, so it stays out of the MentorAgent core package. Installing this one is an explicit decision to pay it.

The reference is Microsoft.Agents.AI.Declarative 1.18.0-rc1, on the same 1.18 line as Microsoft.Agents.AI 1.18.0 in the core package, so adding it does not move the rest of the library onto a different Agent Framework version. The declarative package is still a prerelease upstream.


Requirements

  • .NET 10
  • MentorAgent (or MentorAgent.Server) configured with a ChatClient — declarative agents need one, and are skipped with a warning without it
  • A provider supporting the model options you use in the definitions

Package Purpose
MentorAgent Blazor Server — full AI assistant
MentorAgent.Server Any ASP.NET Core app — headless AI backend
MentorAgent.Blazor Blazor WASM — SignalR client
MentorAgent.Abstractions Shared contracts and UI components

License

MIT — the full text ships in the repository's LICENSE file.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

1.0.0-rc.14 - 2026-10-03

### Added

- **MentorAgent:** `[MentorAction(ReadOnly = true)]` and `MentorOptions.IsReadOnlyAction` (by tool name, for
 `[Description]` methods) declare the actions that only read. MentorAgent takes the host's word for it: such an
 action is published to MCP clients with `readOnlyHint`. A confirmation-gated action is never read-only.
- **MentorAgent:** `MentorOptions.RequireLookupForRecordQuestions`, off by default (BUG-106, the residue). When a
 classifier model says a message asks for a value of the application's records, the first model call must call
 a declared read-only action that the tool filter selected for that message, or hand the request to a
 specialist (`ChatToolMode.RequireAny`). One classifier call (`ClassifierChatClient` when set, bounded by
 `SafetyCheckTimeout`) per turn whose selection holds a declared read — about one second of median latency
 on the ApiServer sample, two to three where a read now happens that did not; a classifier that fails or
 answers anything else leaves the turn as without the option. Measured on the ApiServer sample (with its
 rc.14 changes: products looked up by name, the seed's IDs) against the previous build and samples: the
 Dell's price from a read 19/19 against 17/20, the iPad Air stock 20/20 against 19/20, a product that does
 not exist answered without an invented figure 10/10 on both. Needs `EnableToolFiltering`, an `EmbeddingGenerator` and
 declared reads; a startup warning says when it has no effect.
- **MentorAgent:** `MentorOptions.RequireActionForChangeRequests`, off by default (BUG-118). When the classifier says
 a message asks to carry out one of the confirmation-gated actions the tool filter selected for it, and gives every
 input that action needs, the first model call must call one of them, or hand the request to a specialist or a
 team — so the confirmation banner comes before any sentence; when it says the message asks for a page, the first
 call must be `navigate_to`. The classifier is shown each action's required inputs: a request that leaves one out
 ("Annulla l'ordine 1004" when `cancel_order` needs a reason), only describes the entry ("the last order"), gives a
 name where the input is an ID, or needs the current value ("add 5 units") is not forced, and the assistant may ask.
 Only actions that will show a banner are ever required (declared confirmation, with `RequireConfirmation` on; with
 `HitlMode.Native` no `AutoApprovalRules` rule is consulted for the required call), and never one whose input
 schema cannot be shown faithfully (a `$ref`, a combination of schemas, parameters none of which is marked
 required). A page request is matched against the application's `[MentorPage]` pages; a request from another agent
 is never required to navigate. One classifier call per turn while the application has
 a page or the message selected such an action — the same call as `RequireLookupForRecordQuestions` when both are
 on. Classifier measured on Azure gpt-4.1 before release, three repetitions per message: with the two actions a
 stock or price request usually selects listed, 207/207 on 69 development messages and 60/60 on 20 written after
 the last change; with all nine of the ApiServer's gated actions listed, 204/207 and 58/60, the misses complete
 requests left unforced; an incomplete request or a read question was never labelled ACTION. Live on the ApiServer sample (3 Oct), the
 same build with the option off and on, alternating: asked "Imposta lo stock dell'iPad Air a 30", the assistant
 said it was done with no tool called 11 times in 25 with the option off, and showed the banner 25/25 with it on
 (15/15 on the final build); "Portami alla pagina prodotti" navigated 5/10 off, 10/10 and 8/8 on; requests missing
 a value were asked about every time; reads and greetings unchanged. Needs `EnableToolFiltering`
 and an `EmbeddingGenerator`; a startup warning says when it has no effect or covers page requests only.

### Security

- **MentorAgent:** BUG-103 (S1): with `McpCallerPrincipal` set and roles in a claim type other than
 `ClaimTypes.Role` (a `roles` claim, as Entra ID tokens and JwtBearer with `MapInboundClaims = false`
 carry), a signed-in caller with no roles listed and called a role-gated action once an entitled caller
 had asked first. The tool list was cached per caller under a key built from `ClaimTypes.Role` claims,
 while the decision used `IsInRole`. The list is now decided on every request, with the resolver asked
 once and `ClaimsPrincipal.IsInRole` as the only test, for `tools/list` and `tools/call` alike.
- **MentorAgent.Server:** BUG-110 (S3): `GET /mentor/session` handed the client the conversation in
 clear; an edited snapshot was restored as history, and another user's snapshot restored into one's own
 connection. The snapshot is now protected with ASP.NET Core Data Protection under a purpose naming the
 connection's user: opaque, tamper-evident, and restorable only for that user (on a host without
 sign-in every visitor is the same anonymous user). `POST` checks the owner before reading the body.

### Changed

- **Breaking — MentorAgent:** `MapMentorAgentMcp()` no longer attaches the `MentorAgentMcp` CORS policy
 (BUG-108). MCP clients that are not browsers need none. For a browser-based client call `app.UseCors()`
 and `MapMentorAgentMcp(configure: e => e.RequireCors("MentorAgentMcp"))`; a host that replaced that
 policy as the rc.13 README suggested needs the `configure` line too. A `MentorAgentMcp` policy the host
 registers before `AddMentorAgent` is no longer replaced by the any-origin one.
- **Breaking — MentorAgent.Server:** the `/mentor/session` body is opaque (see Security). Snapshots saved
 by clients before rc.14 are refused with `400`: save the conversation again. Restoring after a restart
 or on another instance needs the Data Protection key ring persisted and shared.
- **MentorAgent:** the classifier behind `RequireLookupForRecordQuestions` is asked at temperature 0, the
 temperature its wording was measured at, like the other classifiers; it ran at the provider's default. No
 difference was measured on the rc.14 messages (141/141 at either temperature). With reads alone it is asked the
 rc.14 question, unchanged; `RequireActionForChangeRequests` (see Added) adds its labels only when that option
 is on. The turn that answers an approval a Stop left open (BUG-116) is no longer forced: the stopped action is
 declared there for its answer, a required call could be satisfied by calling it again, and on a message that
 matched nothing the carried action was left out of the forced request while its answer was in it.
- **MentorAgent:** tool filtering: when no action clears `ToolFilterMinScore`, the three best-ranked
 actions that need no confirmation and no role are sent anyway (an MCP tool only when its server marks it
 `readOnlyHint`), within `ToolFilterMaxTools`. About 80 input tokens per model call on such turns,
 greetings included. Give every action that changes data `RequiresConfirmation` (BUG-106).
- **MentorAgent:** the coordinator's prompt states record values only from a tool, the page data or the
 documents, and the web-search capability no longer names prices (BUG-106).
- **MentorAgent:** `RateLimitPerUser`, `OnToolResult` and the dashboard's top actions now cover MCP
 `tools/call` (BUG-107). MCP calls have an allowance of their own, separate from chat messages, per
 `NameIdentifier`, `sub` or `oid`; a caller with none is counted by remote address when
 `IHttpContextAccessor` is registered, otherwise all such callers share one. Each call writes one
 Information line with a fingerprint of the caller.
- **MentorAgent:** `RefuseOutOfScope` refusals count in `GuardrailBlockCount` and
 `mentoragent.guardrail_blocks`. With `RefuseOutOfScope` and the safety check on, the hosted-tool scope
 check asks its own question on turns where a hosted tool is about to be declared (BUG-105).
- **MentorAgent:** compaction is not installed with `UseServiceManagedHistory` (it had nothing to
 compact). A reset of the conversation writes one Information line.
- **MentorAgent.Abstractions:** the widget's "New conversation" button is disabled from the moment a
 message is sent until its reply ends, and while a confirmation is pending; a confirmation banner still
 up when the turn ends (Stop) is dismissed.
- **MentorAgent:** A2A: a navigation, a UI action, a memory write or a skill no longer counts as grounding,
 so such a reply is put once more like a tool-less one (BUG-106).
- **MentorAgent:** tool filtering: a message that matches no action carries the actions the previous message
 selected — one message back only, never what was itself carried, a confirmation-gated action never alone. The
 answer to the assistant's own question ("Sì, procedi", the reason it asked for) used to arrive without the
 action the question was about (OSS-01). A new or restored conversation carries nothing.
- **MentorAgent:** `MentorshipLevel.Proactive`: a next step may be offered only when a tool of the current
 request, a page, a skill, a specialist or a team can carry it out — otherwise none, and never an export, an
 e-mail, a ticket, a reminder or an alert, or parcel tracking (BUG-074). With tool filtering on, the prompt no
 longer presents the number of actions as the tools at hand.

### Fixed

- **MentorAgent:** BUG-104 (S1): with `EnableCompaction` on and a local history (the built-in provider,
 `ChatHistoryProviderFactory` or `ChatHistoryProvider`), the question of every turn that called a tool
 or ran a UI action was not stored — the Agent Framework's compaction marked it as history in place
 (microsoft/agent-framework#8441) — and stored messages were stamped with its attribution. Compaction now
 works on copies. Questions lost on earlier versions cannot be recovered from their snapshots.
- **MentorAgent:** BUG-105 (S2): `RefuseOutOfScope` refused price questions about the application's own
 catalogue (4 of 4 measured). It judged messages against the hosted-tool cost rule and saw page names
 only. It now asks a question of its own, which defaults to answering, with the pages' descriptions; the
 classifier's labels are read by position (`Contains("OUT")` matched "about" and "without").
- **MentorAgent:** BUG-106 (S2): a catalogue question no action matched was sent with the core tools only,
 and the reply invented a price range or said the catalogue lacked it. See Changed.
- **MentorAgent:** BUG-107 (S2): MCP `tools/call` skipped `OnToolResult`, the per-user rate limit and the
 tool metrics: a host that redacts results served them unredacted to MCP callers. A hook that throws now
 withholds the result (`isError`).
- **MentorAgent:** BUG-108 (S2): the README's MCP steps, followed as written, answered 500 to every
 request on a pipeline without `app.UseCors()`. See Changed.
- **MentorAgent.Blazor:** BUG-109 (S3): "New conversation" before the first message on WebAssembly raised
 the Blazor error bar (the hub was not connected yet).
- BUG-110 (S3): `/mentor/session` and `RestoreSessionAsync`: a non-integer marker answered 500; a
 snapshot saved by a host that keeps its history another way (Responses vs Chat Completions, another
 history provider) was accepted, then failed every turn or restored empty; a restored conversation the
 service no longer knew failed every turn until a reset — now, when the first turn after the restore
 fails because the provider says it does not know the conversation, a new one starts (a content filter, a
 missing deployment, a 429 or a 5xx keep it). WebAssembly's `NotSupportedException` points to
 `/mentor/session`.
- **MentorAgent.Server:** BUG-111 (S3): the package README now carries BUG-102's rule (keep the
 transcript in the session) with its recipe, and no longer says a reset clears history.
- **MentorAgent:** BUG-114 (S3): over A2A, the judge of a second reply without data withheld policies that
 contain a number ("meals up to 50 €") as `NOT GROUNDED`, and passed "the catalogue does not list the price"
 (nobody looked). Measured on Azure gpt-4.1, fourteen replies × 3: 25/42 before, 42/42 now.
- **MentorAgent:** BUG-115 (S2): after the user declined a confirmation the reply could invent why the action had
 not run ("the order is probably already being processed", for an order that was Pending). The localized text
 said "the operation was cancelled" — for a request to cancel an order — and the Native flow sent no instruction
 at all. Both modes now send the same structured result, stating that nothing was checked or changed and that no
 other reason or record state is to be given; `confirm.denied` no longer uses the verb for cancelling (10
 languages).
- **MentorAgent:** BUG-116 (S2): with `HitlMode.Native`, Stop pressed while a confirmation waited made every
 later turn fail (`ToolApprovalRequestContent found … no matching ToolApprovalResponseContent`) until "New
 conversation". The open request is now answered, as not run, at the start of the next turn; no extra model
 call. Also covered: a second Stop, or a failure, before that answer is stored; a run that fails after the user
 confirmed (the action may have run: reported as of unknown outcome, never run again); the approval-round cap.
 On that turn the tool filter and the router decide on the new message. A snapshot saved in that state and
 restored, here or elsewhere, still carries the open request.
- **MentorAgent:** BUG-117 (S2): a provider error that arrived inside the stream — a 429 on the Responses
 API, a hosted tool that failed — on a run that wrote no text ended the turn with nothing on screen: no reply,
 no `Error` event. It now takes the path of a thrown provider error (the localized message, `OnException`, the
 error metrics). Text written after the last tool call is kept with no error under it; a sentence written
 before a tool call is not an answer. A model refusal reads as a block (`guardrail.blocked`), not as an error.

### Known issues

- **MentorAgent:** BUG-074 (S3): with `MentorshipLevel.Proactive`, the assistant can still offer next steps the
 application does not have — 3 in 15 turns on the Blazor Server sample after the rc.14 rule, 5 before ("add it
 to the cart", "the available deals", "plan a reorder").
- **MentorAgent:** BUG-118 (S2) is closed for hosts that opt in to `RequireActionForChangeRequests` (see Added).
 Without it the model can still narrate an action it never performed — "Stock aggiornato" with no tool called,
 or "Ecco la pagina Prodotti" with no navigation — and with it a complete request the classifier does not
 recognise runs as without the option.
- BUG-106's residue is closed for hosts that opt in to `RequireLookupForRecordQuestions` (see Added); without
 it, a catalogue question can still be answered with an offer to look the value up.

The full history is in CHANGELOG.md, inside this package.