# HostedAgentConfiguration

- Kind: `class`
- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Version: `13.4.0-preview.1.26281.18`
- Namespace: `Aspire.Hosting.Foundry`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentConfiguration.cs)

A configuration helper for hosted agents.

## Definition

```csharp
namespace Aspire.Hosting.Foundry;

public class HostedAgentConfiguration
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Foundry/HostedAgentConfiguration`

## Remarks

This type is used instead of `Agents.ProjectsAgentVersionCreationOptions` to provide a strongly typed configuration surface for hosted agent definitions. When used from polyglot app hosts, only the ATS-compatible properties are exported; Azure SDK-specific members remain .NET-only.

## Constructors

- [HostedAgentConfiguration(string)](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/constructors.md#constructor-string) -- A configuration helper for hosted agents.

## Properties

- [ContainerProtocolVersions](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#containerprotocolversions) : `IList<ProtocolVersionRecord>` `get; init` `ats ignored` -- The protocols that the agent supports for ingress communication of the containers.
- [ContentFilterConfiguration](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#contentfilterconfiguration) : `ContentFilterConfiguration?` `get; set` `ats ignored` -- Configuration for Responsible AI (RAI) content filtering and safety features.
- [Cpu](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#cpu) : `decimal` `get; set` -- CPU allocation for each hosted agent instance, in vCPU cores.
- [CpuString](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#cpustring) : `string` `get` `ats ignored` -- CPU allocation as a string.
- [Description](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#description) : `string` `get; set` -- The description of the hosted agent.
- [EnvironmentVariables](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#environmentvariables) : `IDictionary<string, string>` `get; init` -- Environment variables to set in the hosted agent container.
- [Image](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#image) : `string` `get; set` `ats ignored` -- The fully qualified container image name for the hosted agent.
- [Memory](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#memory) : `decimal` `get; set` -- Memory allocation for each hosted agent instance, in GiB. Must be 2x the CPU allocation.
- [MemoryString](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#memorystring) : `string` `get` `ats ignored` -- Memory allocation as a string.
- [Metadata](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#metadata) : `IDictionary<string, string>` `get; init` -- Additional metadata to associate with the hosted agent.
- [Tools](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration/properties.md#tools) : `IList<ProjectsAgentTool>` `get; init` `ats ignored` -- Tools available to the hosted agent.
