# IAgentDecorator

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.iagentdecorator/
> Summary: IAgentDecorator: 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.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

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.

```csharp
public interface IAgentDecorator
```

## Remarks

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.

## Properties

### <a id="Tracon_IAgentDecorator_Order"></a> Order

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.

```csharp
int Order { get; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Remarks

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.

## Methods

### <a id="Tracon_IAgentDecorator_Decorate_Microsoft_Agents_AI_AIAgent_Tracon_AgentDescriptor_"></a> Decorate\(AIAgent, AgentDescriptor\)

Decorates the agent.

```csharp
AIAgent Decorate(AIAgent agent, AgentDescriptor descriptor)
```

#### Parameters

`agent` AIAgent

The agent to decorate.

`descriptor` [AgentDescriptor](/api/tracon.agentdescriptor/)

The catalog summary of the agent, describing the definition version
`agent` was compiled from — the pinned version on a
pinned resolve, not the current one.

#### Returns

 AIAgent

The decorated agent.
