# AgentDefinitionOrigin

> 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.agentdefinitionorigin/
> Summary: AgentDefinitionOrigin: Tells where an agent definition came from.

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

Tells where an agent definition came from.

```csharp
[JsonConverter(typeof(JsonStringEnumConverter<AgentDefinitionOrigin>))]
public enum AgentDefinitionOrigin
```

## Fields

`Code = 0` 

The definition is made in code. It is validated at compile time, so it wins over
a database definition when the names clash.

`Custom = 2` 

The definition comes from a custom [IAgentSource](/api/tracon.iagentsource/). The
management API does not edit definitions from this origin.

`Database = 1` 

The definition is stored in the database and built at run time.

## Remarks

The value is written **as a name** in JSON (`"Code"`), not as a
number. The wire contract is therefore self describing and survives a change in the
order of the values. The converter sits at type level: it gives the same format
everywhere without touching the consumer's application-wide JSON settings. No enum
is PERSISTED as JSON (RunStatus and RunEventType are smallint in the database, and
AgentDefinitionOrigin is rebuilt on read), so a change of format does not affect
stored data.
