Skip to content
Tracon

IAgentDecorator

Namespace Tracon · Assembly Tracon.Abstractions.dll

A decorator applied to every agent resolved from the catalog. Tracon adds run recording through this mechanism; a consumer can register its own decorator the same way.

public interface IAgentDecorator

A decorator is not Microsoft Agent Framework middleware. The MAF middleware chain is specific to an agent, and HarnessAgent adds its own inner decorators. An outer decorator works the same way on every agent kind, the harness included.

Gets the order of application. A lower value wraps outside, a higher value wraps inside. Run recording uses 0, which makes it the outermost decorator.

int Order { get; }

int

The direction follows from how the pipeline applies decorators: it sorts by descending order and each step wraps the agent the previous step produced, so the highest value is applied first and every later decorator wraps it. Place a decorator that has to observe or veto everything below it at a low value, and one that has to sit close to the agent’s own calls at a high value - which is why run recording is 0 and the tool-approval gate is 20.

Decorates the agent.

AIAgent Decorate(AIAgent agent, AgentDescriptor descriptor)

agent AIAgent

The agent to decorate.

descriptor AgentDescriptor

The catalog summary of the agent.

AIAgent

The decorated agent.