# IMentorActionObserver interface

> The IMentorActionObserver interface of Novior.MentorAgent.Abstractions.Interfaces: Receives every decision MentorAgent's tool gate takes — allowed, denied…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentoractionobserver
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent.Abstractions

Receives every decision MentorAgent's tool gate takes — allowed, denied, confirmation asked, confirmed, rejected, stopped, run, failed — for every session and every surface of the process: the Blazor Server circuit, the MAUI app, the hub, `/mentor/chat`, the MCP server and A2A. For an audit trail of the actions, with who asked and why the gate decided as it did.

Register it with `AddMentorActionObserver<T>()`, or as a singleton [`IMentorActionObserver`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentoractionobserver) of your own; every observer registered is called, in the order of registration. It is resolved once, from the application's root services: an observer that needs scoped services creates a scope with `IServiceScopeFactory`.

It never runs on the action's path. Each observer has a queue of its own and receives the decisions in the order they were taken; a slow observer or one that throws delays nothing and stops nothing, and its failure is logged. A call that has not finished within 5 seconds is no longer awaited: the next decision may then reach the observer while that call is still running, so an observer must be thread-safe.

[`IMentorStateService.OnActionStarted`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentorstateservice#onactionstarted) is the per-session event a component shows; this is the process-wide record. A member added to this interface in a later version comes with a default implementation.

## Definition

Namespace: `Novior.MentorAgent.Abstractions.Interfaces`. Package: `Novior.MentorAgent.Abstractions`.

`public interface IMentorActionObserver`

```shell
dotnet add package Novior.MentorAgent.Abstractions
```

## Methods

### `OnDecisionAsync`

`ValueTask OnDecisionAsync(MentorActionDecision decision, CancellationToken cancellationToken)`

One decision of the gate.

**Parameters**

- `decision`: What was decided, for which call, and for whom.
- `cancellationToken`: Cancelled when the call takes longer than 5 seconds.

---

- Previous: [IMentorActionCatalog interface](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentoractioncatalog.md)
- Next: [IMentorActionPolicy interface](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentoractionpolicy.md)
