Skip to content

AgentDefinition

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The full definition of an agent. The same type is used whether the agent is declared in code or stored in the database; AgentDefinition.Origin tells the two apart.

public sealed record AgentDefinition : IEquatable<AgentDefinition>

objectAgentDefinition

IEquatable<AgentDefinition>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

AgentDefinition.ToolNames is a list of names only, never code. A definition can point only at a tool registered in IToolRegistry in code. This is one of the security boundaries of AgentPrism: the user interface can create an agent, but it cannot define executable code.

A definition never carries credentials such as an API key. Provider credentials come from configuration and are not written to the database.

public AgentDefinition()

Gets the names of the other agents this agent may call.

public IReadOnlyList<string> CallableAgentNames { get; init; }

IReadOnlyList<string>

Every name must resolve to an agent in the catalog. The call graph is checked when the definition is saved: self calls and indirect cycles are rejected.

The static check alone is not enough - a factory agent on the code side carries no graph. A depth counter therefore also runs at run time (AgentRunBudget.MaxDepth).

A child agent runs in the same tenant and cannot change the tenant.

Gets the context compaction settings. When null no compaction is applied.

public CompactionSettings? Compaction { get; init; }

CompactionSettings?

Gets a short description of what the agent does.

public string? Description { get; init; }

string?

Gets the name shown in the user interface. Name is used when it is empty.

public string? DisplayName { get; init; }

string?

Gets the harness settings. When null a plain chat agent is produced; when populated, harness capabilities such as context compaction and todo tracking are enabled.

public HarnessSettings? Harness { get; init; }

HarnessSettings?

Gets the system instructions passed to the model.

public string? Instructions { get; init; }

string?

Gets culture-keyed instructions. The key is a BCP-47 tag ("en", "tr"); a region subtag ("tr-TR") falls back to its parent ("tr"). A run’s requested culture that matches neither falls back to Instructions - resolution never fails.

public IReadOnlyDictionary<string, string>? InstructionsByCulture { get; init; }

IReadOnlyDictionary<string, string>?

Gets the MCP resources added to the run context (mode A). Each item has the form "{server}:{uri}". They are read at the start of the run and are predictable; every run receives the same resources.

public IReadOnlyList<string> McpResourceUris { get; init; }

IReadOnlyList<string>

Reading resources requires the AgentPrism.Mcp package to be registered (UseMcp); otherwise building the agent fails. A size limit applies: 64 KB per resource, 256 KB in total.

Gets the memory provider settings. When null no memory provider is added.

public MemorySettings? Memory { get; init; }

MemorySettings?

Gets free-form, application-specific metadata.

public IReadOnlyDictionary<string, JsonElement> Metadata { get; init; }

IReadOnlyDictionary<string, JsonElement>

Gets the provider and model binding to use.

public required ModelBinding Model { get; init; }

ModelBinding

Gets the unique name of the agent, used as the key in the catalog and in API routes.

public required string Name { get; init; }

string

Gets the origin of the definition: code or database.

public AgentDefinitionOrigin Origin { get; init; }

AgentDefinitionOrigin

Gets the names of the skills this agent may load at run time. Every name must match an enabled skill found in code or in the skill store.

public IReadOnlyList<string> SkillNames { get; init; }

IReadOnlyList<string>

Gets the tenant this definition belongs to. A single-tenant setup uses the default value.

public string? TenantId { get; init; }

string?

Gets the names of the tools this agent may use. Every name must match a tool registered in code; otherwise building the agent fails.

public IReadOnlyList<string> ToolNames { get; init; }

IReadOnlyList<string>

Gets the time the definition last changed (UTC).

public DateTimeOffset? UpdatedAt { get; init; }

DateTimeOffset?

Gets the definition version. Every save increments this value and so naturally invalidates the compiled agent cache.

public int Version { get; init; }

int

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(AgentDefinition? other)

other AgentDefinition?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(AgentDefinition?, AgentDefinition?)

Section titled “ operator ==(AgentDefinition?, AgentDefinition?)”
public static bool operator ==(AgentDefinition? left, AgentDefinition? right)

left AgentDefinition?

right AgentDefinition?

bool

operator !=(AgentDefinition?, AgentDefinition?)

Section titled “ operator !=(AgentDefinition?, AgentDefinition?)”
public static bool operator !=(AgentDefinition? left, AgentDefinition? right)

left AgentDefinition?

right AgentDefinition?

bool