# MentorAgent 1.4.0 release notes

> What's new in MentorAgent 1.4.0: actions registered in code, commands and queries, endpoints as actions, teams from YAML, and UI actions through the gate.

- URL: https://docs.mentoragent.net/release-notes/1-4-0
- Verified with: MentorAgent 1.4.0
- Last updated: 2026-11-18
- Packages: Novior.MentorAgent, Novior.MentorAgent.Abstractions, Novior.MentorAgent.Blazor, Novior.MentorAgent.Declarative, Novior.MentorAgent.Server

MentorAgent 1.4.0 was published on NuGet on 18 November 2026 (UTC). It is a minor version: it adds new features and fixes one defect, with no intended break. Every package is checked against the public API of 1.3.1, so code built on 1.3.1 compiles unchanged.

| Package | Version |
|---|---|
| [Novior.MentorAgent](https://www.nuget.org/packages/Novior.MentorAgent/1.4.0) | 1.4.0 |
| [Novior.MentorAgent.Abstractions](https://www.nuget.org/packages/Novior.MentorAgent.Abstractions/1.4.0) | 1.4.0 |
| [Novior.MentorAgent.Blazor](https://www.nuget.org/packages/Novior.MentorAgent.Blazor/1.4.0) | 1.4.0 |
| [Novior.MentorAgent.Declarative](https://www.nuget.org/packages/Novior.MentorAgent.Declarative/1.4.0) | 1.4.0 |
| [Novior.MentorAgent.Server](https://www.nuget.org/packages/Novior.MentorAgent.Server/1.4.0) | 1.4.0 |

Each package requires the MentorAgent packages that it depends on at exactly this version: upgrade all five together. MentorAgent 1.4.0 runs on .NET 10. To upgrade, see [Upgrade from 1.3.1](https://docs.mentoragent.net/release-notes/1-4-0#upgrade-from-131).

## Highlights

- **[Actions registered in code](https://docs.mentoragent.net/release-notes/1-4-0#actions-registered-in-code).** Make a method an action from `Program.cs`, without an attribute on the class, with the same roles and confirmations.
- **[Commands and queries as actions](https://docs.mentoragent.net/release-notes/1-4-0#commands-and-queries-as-actions).** A type and its handler become one action, named after the type.
- **[Endpoints as actions](https://docs.mentoragent.net/release-notes/1-4-0#endpoints-as-actions).** A minimal API endpoint or a controller's action becomes an action that runs the endpoint itself, its authorization first.
- **[Candidates from your services](https://docs.mentoragent.net/release-notes/1-4-0#candidates-from-your-services).** The public methods of the namespaces you name become actions that start off, until a governor turns them on.
- **[Teams that are not written in C#](https://docs.mentoragent.net/release-notes/1-4-0#teams-that-are-not-written-in-c).** Teams from a source of your own, or from `*.team.yaml` files.
- **[UI actions pass through the gate](https://docs.mentoragent.net/release-notes/1-4-0#ui-actions-pass-through-the-gate).** Action policies and observers now see the actions of a page.
- **[An announced action is checked after a tool call too](https://docs.mentoragent.net/release-notes/1-4-0#an-announced-action-is-checked-after-a-tool-call-too).** A reply that claims an action none of the turn's tools did is caught.

## New features

### Actions registered in code

Some classes cannot carry attributes: they come from a package, or the team that owns them does not want MentorAgent in them. `options.Actions.Add` registers one of their methods as an action of the coordinator, and declares what the attribute would declare:

```csharp title="Program.cs"
builder.Services.AddScoped<StockActions>();
builder.Services.AddMentorAgent(options =>
{
    options.ScanAssemblies = [typeof(Program).Assembly];
    options.Actions
        .Add<StockActions>(nameof(StockActions.CountLowStock),
            action => action
                .Describe("Counts the products low on stock")
                .ReadOnly())
        .Add<StockActions>(nameof(StockActions.Restock),
            action => action
                .Describe("Restocks a product")
                .RequireRoles("Manager")
                .RequireConfirmation());
});

// From a package: no MentorAgent attribute on it
public sealed class StockActions(StockStore store)
{
    public int CountLowStock() => store.CountBelow(10);

    public string Restock(int productId, int quantity) =>
        store.Add(productId, quantity);
}
```

The builder has `Describe`, `Category`, `RequireConfirmation`, `ReadOnly`, `RequireRoles`, `Off`, `NavigateTo` and `Hint`. A registered action is like a `[MentorAction]` method: its roles, its confirmation, the default confirmation for writes, the `IMentorActionGovernor`, `/mcp` and the A2A card apply to it the same way.

A mistake stops the application when it starts, and the message names the method:

- a method that is not there, or that is overloaded, static or generic;
- a registration without a description;
- a method registered twice, or that is already an action by its attributes.

### Commands and queries as actions

An application that already sends commands and queries to handlers can offer them to the model as they are. `AddCommand` and `AddQuery` register a type and its handler:

```csharp title="Program.cs"
builder.Services.AddScoped<CancelOrderHandler>();
builder.Services.AddScoped<FindOrderHandler>();
builder.Services.AddMentorAgent(options =>
{
    options.ScanAssemblies = [typeof(Program).Assembly];
    options.Actions
        .AddCommand<CancelOrder, CancelOrderHandler>(
            action => action
                .Describe("Cancels an order that has not shipped")
                .RequireRoles("Manager"))
        .AddQuery<FindOrder, FindOrderHandler>(
            action => action.Describe("Reads one order"));
});

public sealed record CancelOrder(int OrderId, string Reason);

public sealed class CancelOrderHandler(OrderStore store)
    : IMentorCommandHandler<CancelOrder>
{
    public Task HandleAsync(CancelOrder command, CancellationToken ct)
        => store.CancelAsync(command.OrderId, command.Reason, ct);
}

public sealed record FindOrder(int OrderId);

public sealed class FindOrderHandler(OrderStore store)
    : IMentorQueryHandler<FindOrder, OrderView?>
{
    public Task<OrderView?> HandleAsync(
        FindOrder query, CancellationToken ct)
        => Task.FromResult(store.Find(query.OrderId));
}
```

The handlers implement `IMentorCommandHandler<TCommand>`, `IMentorCommandHandler<TCommand, TResult>` or `IMentorQueryHandler<TQuery, TResult>`, new in `Novior.MentorAgent.Abstractions`.

- **The name and the parameters come from the type.** The action is named after the type in snake case, and its parameters are the type's public properties. `Name(…)` gives another name to any action registered in code.
- **A query reads, a command writes.** A query is always read-only. A command is a write, so it asks for a confirmation unless you declare otherwise.
- **The same rules apply.** Roles, confirmations, the governor, the action policies, `/mcp`, the A2A card and team members apply as to a method registered in code.

### Endpoints as actions

In `Novior.MentorAgent.Server`, an endpoint that your application already has becomes an action without writing it again:

```csharp title="Program.cs"
builder.Services.AddAuthorization(o => o.AddPolicy("Billing",
    p => p.RequireRole("Billing")));
builder.Services.AddMentorAgentServer();

// after var app = builder.Build();
app.MapPost("/invoices/{id:int}/void",
        (int id, VoidRequest body, InvoiceStore store) =>
            store.Void(id, body.Reason))
    .RequireAuthorization("Billing")
    .WithMentorAction("void_invoice", action => action
        .Describe("Voids an invoice that is not paid"));

public sealed record VoidRequest(string Reason);
```

`[MentorAction]` on a controller's action does the same. The action runs the endpoint itself, in the process, as the user of the turn:

- **The endpoint's own checks first.** Its authorization, then its filters, its binding and its validation. The middleware before routing, such as rate limiting and CORS, does not run for these calls.
- **The roles come from the endpoint's authorization.** `[Authorize(Roles = …)]`, `RequireRole`, a policy by name or the fallback policy. The action is offered only to a user who holds one of them, and a user without them is refused before any confirmation. Roles declared on the action replace them.
- **The verb decides the confirmation.** `GET` and `HEAD` read. The other verbs write, and ask for a confirmation by default.
- **The model fills in the request.** It gives the route values, the query values and one JSON body. An answer of 400 or more is a failed action, with its status.
- **Not published.** These actions are not on `/mcp` nor on the A2A card.

A declaration that the action cannot honour stops the application when it starts, and names the endpoint. The Server's README lists each message and its fix.

`ScanAssemblies` no longer reads controllers. Up to 1.3.1, a `[MentorAction]` on a controller's action called the method on an instance from the container, past the endpoint's `[Authorize]` and filters, and failed when the controller was not registered as a service. Now it runs the endpoint, with `AddMentorAgentServer()`: see [Upgrade from 1.3.1](https://docs.mentoragent.net/release-notes/1-4-0#upgrade-from-131). Which classes are controllers is read from the metadata of their attributes, without creating them: an attribute of your application whose constructor throws, or whose type does not load, does not stop it.

### Candidates from your services

With `options.AutoMentor.Enabled` and the namespaces of a perimeter in `options.AutoMentor.Namespaces`, the public methods of the services there become *candidates*: actions of the coordinator that start off and ask for a confirmation. A candidate is offered to no model until an [`IMentorActionGovernor`](https://docs.mentoragent.net/concepts/governance) turns it on, and nothing outside the perimeter becomes an action, whatever a governor says.

- `[MentorExclude]`, on a class or a method, keeps it out.
- A candidate's description is the `<summary>` of its XML documentation comment, read from the `.xml` file next to its assembly.
- Its roles are those of its `[Authorize(Roles = …)]`.

The README of the repository explains the perimeter in «Candidates from your services».

### Teams that are not written in C#

An `IMentorTeamSource`, registered with `AddMentorTeamSource<T>()`, gives teams as `MentorTeamDefinition`s, with the fields of `[MentorTeam]` and `[TeamMember]`. A member's tools are named as the session's actions, and an `Approver` is the member whose verdict ends the discussion. The source is asked each time a coordinator is built, and its teams join the coordinator as the ones written in C# do.

In `Novior.MentorAgent.Declarative`, every `*.team.yaml` file of the folder, and every `TeamDefinitions` entry, gives a team, checked as a source's team is. A file that does not hold is left out, with the line and the column of the fault. An unknown key or a key written twice is a fault, and a team file is never read as an agent.

What does not hold is left out with its reason, in the log and in `IMentorAgentSourceObserver.OnTeamsLoaded`, a new method with an empty default. The new reason codes are `name-taken` and `no-members`. A member's tools can be writes, of a source's team or of one written in C#: each keeps its roles and its confirmation, and passes the gate once.

### UI actions pass through the gate

On Path A, the coordinator now calls a page's UI actions through the gate, like every other action. Up to 1.3.1 they ran in a loop of their own, which no policy and no observer saw. Now:

- the action policies and their before-action hook are asked about them, and decide whether they are offered;
- `IMentorActionObserver` receives their decisions, with the action's description as `DisplayName`;
- they get a span, and Stop reaches them;
- after `navigate_to`, the next request of the same turn offers the actions of the page now shown.

A UI action still asks for no confirmation and needs no role of its own, and the widget shows its start and end as before. `MentorActionRequest.Kind` and `MentorActionDecision.Kind`, `Server` or `UI`, tell a UI action from an action of the application, and `MentorActionDecision.PageName` names the page.

A model that keeps calling UI actions is now stopped by the cap of the run, as for your own actions: 40 calls in a turn, the default of the agent's function-invoking client. Up to 1.3.1 the loop of UI actions stopped at 10.

### An announced action is checked after a tool call too

A model could read a record and then write that it had taken it in charge, without calling the tool that does it. [`CheckAnnouncedActions`](https://docs.mentoragent.net/reference/options#checkannouncedactions) skipped every turn with a call, so it did not see it. Now the check also runs after a turn that called tools, and the question names them: only an action that none of them did counts. A reply that reports what they did or returned is not one.

A turn that handed the request to a specialist, a team or a remote agent, used a hosted tool or waits for an approval is still not checked. On gpt-4.1, over 18 turns that read records, the check cost one more call of about 440 tokens (386 to 643) in each turn with a call, and 0.5 to 0.7 seconds after the reply had reached the user. No reply was flagged by mistake.

An application's own `IChatClient` that answers without a model, for example when a budget is spent, can now say so: it sets `MentorChatKeys.ModelNotCalled` in the `AdditionalProperties` of its response, and of each streaming update, with the cause as the value. A turn none of whose requests reached a model is not checked.

### Other features

- **Where the actions come from.** `IMentorActionCatalog.GetRegistrations()` returns one `MentorActionRegistration` per origin and class: its `Origin`, its `Source`, the actions it gives and what it left out, by the rule's name. The origins are in `MentorActionOrigins`: `attribute`, `fluent`, `command`, `query`, `endpoint`, `candidate` and `page`. Every `MentorActionInfo` names its `Origin` and its `RegistrationId`, and `MentorActionInfo.Method` is the method the action runs, when there is one. A catalogue that you wrote yourself compiles as before.
- **The pages in the catalogue.** After the registrations of the code, `GetRegistrations()` has one registration per page that declared UI actions, with the names declared since the application started. Only names are kept, within the limits of `MentorPageActionLimits`.
- **Skills from a console.** Wrapped in `MentorPreferredSkillsSource`, a source's skills replace the application's own of the same name. Wrapped in `MentorLiveSkillsSource`, a source is asked at every session, so a skill that it withdraws is gone for the next one. With `SkillsRefreshInterval`, each source is now cached on its own.
- **The tenant in every decision.** `MentorActionDecision.TenantId` names the tenant of the call, so an observer of several tenants tells the same user in two of them apart.
- **The rules of actions.** `ACTION-RULES.md` has 47 new rules, in the areas `fluent`, `endpoint`, `candidate`, `page`, `team` and `skill`, and `scan.controllers-are-endpoints`, `scan.attributes-not-created` and `policy.offered-to-agents`. The rules are listed by name in the [1.4.0 section of CHANGELOG.md](https://docs.mentoragent.net/release-notes/1-4-0#full-list-of-changes).
- **The project template** creates its project on MentorAgent 1.4.0.

## Improvements

- **The action policies decide about every agent's offer.** What 1.3.1 changed for the offer is now a rule, `policy.offered-to-agents`: every agent of the turn, a member of a team read from a `*.team.yaml` file included, is offered only the actions that the policies allow.
- **A check of the public API.** At pack time, every package is checked against the public API of 1.3.1. An intended break would be listed as Breaking in the CHANGELOG.
- **Support.** The policy is the one of 1.3.1: only the latest minor version gets fixes. See [Versioning and support](https://docs.mentoragent.net/release-notes#versioning-and-support).

## Fixes

Each defect has a severity from S1, the most severe, to S4: see [Versioning and support](https://docs.mentoragent.net/release-notes#versioning-and-support).

- **BUG-234 (S3):** after a navigation, the next request of the turn offered the UI actions of the page being left, and a call to one ran its handler on a page going away. Blazor disposes that page only after the next one has initialized. Now they are taken back before the navigation, in a turn with a Blazor circuit. Over the hub, SSE and A2A the page's actions still come with the client's snapshot.

## Security

This version fixes no security advisory.

## Breaking changes

This version has no intended breaking change. Four changes of behavior are worth checking when you upgrade: `CheckAnnouncedActions` also checks turns with a tool call, controllers are no longer read by `ScanAssemblies`, UI actions pass through your policies and observers, and `Novior.MentorAgent.Declarative` brings YamlDotNet 18.1.0. The steps are in [Upgrade from 1.3.1](https://docs.mentoragent.net/release-notes/1-4-0#upgrade-from-131).

## Deprecations

This version deprecates nothing.

## Dependency updates

| Package | From | To | Why |
|---|---|---|---|
| `YamlDotNet` (in `Novior.MentorAgent.Declarative`) | (none) | 18.1.0 | New, MIT license: it reads the team files. |

The other dependencies are unchanged: `Microsoft.Agents.AI` 1.27.0, `Microsoft.Extensions.AI` 10.11.0, `ModelContextProtocol` 2.3.0, `A2A` 1.0.0-preview3.

## Known issues

The defects that are still open in 1.4.0, with what to do about each one, are on the [Known issues](https://docs.mentoragent.net/reference/known-issues) page, together with the prerelease packages and the package versions to pin. The limits that are not defects are in [Known limitations](https://docs.mentoragent.net/reference/known-limitations).

## Upgrade from 1.3.1

1. **Upgrade the five packages together.** Each package requires the MentorAgent packages that it depends on at exactly its own version.
2. **Check the cost of `CheckAnnouncedActions`.** It now adds one call of a few hundred tokens after a turn that called tools too, not only after a reply without a tool. Give [`ClassifierChatClient`](https://docs.mentoragent.net/reference/options#classifierchatclient) a small model, or set `CheckAnnouncedActions = false`.
3. **Check your controllers with `[MentorAction]`.** They now run as endpoints, with their authorization and filters, and need `AddMentorAgentServer()`.
4. **Check your action policies and observers.** They now see UI actions. A policy that decides about every tool now decides about UI actions too: use `Kind` to tell them apart.
5. **If you use `Novior.MentorAgent.Declarative` and YamlDotNet.** An older YamlDotNet that comes through another package moves to 18.1.0. A project that references an older version itself gets the downgrade error NU1605 until it references 18.1.0 or later.
6. **Update the links you write by hand.** If a page links `MentorAgent.css` and `MentorAgent.js` itself, as the `index.html` of a [Blazor WebAssembly](https://docs.mentoragent.net/configure/blazor-webassembly#minimal-configuration) client or of a [.NET MAUI](https://docs.mentoragent.net/configure/maui#minimal-configuration) app does, change `?v=1.3.1` to `?v=1.4.0` in both links.

If you upgrade from 1.3.0, first read [Upgrade from 1.3.0](https://docs.mentoragent.net/release-notes/1-3-1#upgrade-from-130) in the 1.3.1 notes: it fixes a security defect in action policies. From 1.2.0, first read [Upgrade from 1.2.0](https://docs.mentoragent.net/release-notes/1-3-0#upgrade-from-120).

## Full list of changes

Every entry of this version is in the [1.4.0 section of CHANGELOG.md](https://github.com/Novior-dev/MentorAgent/blob/main/CHANGELOG.md#140---2026-11-18), which is also the [release notes on NuGet](https://www.nuget.org/packages/Novior.MentorAgent/1.4.0#releasenotes-body-tab).

---

- Previous: [Release notes](https://docs.mentoragent.net/release-notes.md)
- Next: [MentorAgent 1.3.1 release notes](https://docs.mentoragent.net/release-notes/1-3-1.md)
