Aspire.Hosting.AgentFramework.DevUI 1.26.0-preview.261023.1

Prefix Reserved
This is a prerelease version of Aspire.Hosting.AgentFramework.DevUI.
dotnet add package Aspire.Hosting.AgentFramework.DevUI --version 1.26.0-preview.261023.1
                    
NuGet\Install-Package Aspire.Hosting.AgentFramework.DevUI -Version 1.26.0-preview.261023.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aspire.Hosting.AgentFramework.DevUI" Version="1.26.0-preview.261023.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Hosting.AgentFramework.DevUI" Version="1.26.0-preview.261023.1" />
                    
Directory.Packages.props
<PackageReference Include="Aspire.Hosting.AgentFramework.DevUI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aspire.Hosting.AgentFramework.DevUI --version 1.26.0-preview.261023.1
                    
#r "nuget: Aspire.Hosting.AgentFramework.DevUI, 1.26.0-preview.261023.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aspire.Hosting.AgentFramework.DevUI@1.26.0-preview.261023.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aspire.Hosting.AgentFramework.DevUI&version=1.26.0-preview.261023.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Hosting.AgentFramework.DevUI&version=1.26.0-preview.261023.1&prerelease
                    
Install as a Cake Tool

Aspire.Hosting.AgentFramework.DevUI library

Provides extension methods and resource definitions for an Aspire AppHost to configure a DevUI resource for testing and debugging AI agents built with Microsoft Agent Framework.

DevUI and its aggregator are for trusted development environments, not production authentication gateways. Protect backend agent endpoints independently; protecting the Aspire dashboard or UI does not automatically protect those routes. Follow the shared hosting guide for backend authorization, caller isolation, and client/proxy credential requirements.

The aggregator binds only to loopback and includes limited browser-request protections: every request must use localhost or a loopback IP address in its Host header, and state-changing requests with a mismatched or invalid Origin or Sec-Fetch-Site: cross-site are rejected. Non-browser clients that send neither header continue to work. These checks reduce local DNS-rebinding and cross-site request risks, but they do not provide authentication, authorization, multi-user isolation, or protection for the backend services. Use the aggregator only for local, trusted development. After validating the incoming browser request, the aggregator does not forward browser provenance headers such as Origin or Sec-Fetch-* on its server-to-server backend hop; application credentials such as Authorization are forwarded.

Getting started

Prerequisites

Agent services must expose the OpenAI Responses and Conversations API endpoints. This is compatible with services using Microsoft Agent Framework with MapOpenAIResponses() and MapOpenAIConversations() mapped.

Install the package

In your AppHost project, install the Aspire Agent Framework DevUI Hosting library with NuGet:

dotnet add package Aspire.Hosting.AgentFramework.DevUI

Usage example

Then, in the AppHost.cs file of AppHost, add a DevUI resource and connect it to your agent services using the following methods:

var writerAgent = builder.AddProject<Projects.WriterAgent>("writer-agent")
    .WithHttpHealthCheck("/health");

var editorAgent = builder.AddProject<Projects.EditorAgent>("editor-agent")
    .WithHttpHealthCheck("/health");

var devui = builder.AddDevUI("devui")
    .WithAgentService(writerAgent)
    .WithAgentService(editorAgent)
    .WaitFor(writerAgent)
    .WaitFor(editorAgent);

Each agent service only needs to map the standard OpenAI API endpoints — no custom discovery endpoints are required:

// In the agent service's Program.cs
builder.AddAIAgent("writer", "You write short stories.");
builder.Services.AddOpenAIResponses();
builder.Services.AddOpenAIConversations();

var app = builder.Build();

app.MapOpenAIResponses();
app.MapOpenAIConversations();

How it works

AddDevUI starts an in-process aggregator inside the AppHost — no external container image is needed. The aggregator is a lightweight Kestrel server that:

  1. Serves the DevUI frontend from the Microsoft.Agents.AI.DevUI assembly's embedded resources (loaded at runtime). If the assembly is not available, it falls back to proxying the frontend from the first backend.
  2. Aggregates entities from all configured agent service backends into a single /v1/entities listing. Each entity ID is prefixed with the backend name to ensure uniqueness across services (e.g., writer-agent/writer, editor-agent/editor).
  3. Routes requests to the correct backend based on the entity ID prefix. When DevUI sends a POST /v1/responses or /v1/conversations request, the aggregator strips the prefix and forwards it to the appropriate service.
  4. Streams SSE responses for the /v1/responses endpoint, so agent responses stream back to the DevUI frontend in real time.
  5. Correlates OpenTelemetry traces with each response when the Aspire Dashboard telemetry API is available. The aggregator propagates a unique W3C trace context to the selected agent service, retrieves matching spans from the dashboard after the response completes, and displays them in DevUI's Traces tab.

The aggregator publishes its URL to the Aspire dashboard, where it appears as a clickable link.

Tracing

Tracing is enabled automatically when the running Aspire Dashboard exposes its telemetry API, available in Aspire 13.2 and later. DevUI checks this capability at startup, so older or unavailable dashboards do not delay agent responses or produce trace errors in the UI.

Agent services must still be configured to emit and export OpenTelemetry spans to Aspire. This normally means using Aspire service defaults and registering the Agent Framework activity sources used by the service. The aggregator keeps the dashboard API key server-side; it is never returned to the browser.

Aspire commonly exports spans in batches, so trace events may appear shortly after an answer completes. Trace retrieval works for streaming and non-streaming responses, happens in the background, and does not keep the chat response in a streaming state.

DevUI merges trace snapshots throughout a bounded polling window of about six seconds. Spans exported after that window may be missing. For non-streaming responses, the aggregator forwards the body as it arrives and captures the top-level response ID from only the first 64 KiB. An ID outside that prefix leaves the response unchanged but cannot be correlated with traces.

OpenTelemetry attributes can contain sensitive prompts, responses, tool arguments, or results when sensitive-data capture is enabled. Only enable sensitive telemetry in an appropriately secured development environment.

Agent discovery

By default, WithAgentService declares a single agent named after the Aspire resource. You can provide explicit agent metadata when the agent name differs from the resource name, or when a service hosts multiple agents:

builder.AddDevUI("devui")
    .WithAgentService(writerAgent, agents: [new("writer", "Writes short stories")])
    .WithAgentService(editorAgent, agents: [new("editor", "Edits and formats stories")]);

Agent metadata is declared at the AppHost level so the aggregator builds the entity listing directly — agent services don't need a /v1/entities endpoint.

Configuration

Custom entity ID prefix

By default, entity IDs are prefixed with the Aspire resource name. You can specify a custom prefix:

builder.AddDevUI("devui")
    .WithAgentService(myService, entityIdPrefix: "custom-prefix");

Custom port

You can specify a fixed host port for the DevUI web interface:

builder.AddDevUI("devui", port: 8090);

DevUI frontend assembly

To serve the DevUI frontend directly from the aggregator (instead of proxying from a backend), add the Microsoft.Agents.AI.DevUI NuGet package to your AppHost project. The aggregator loads its embedded resources at runtime via Assembly.Load.

Additional documentation

Feedback & contributing

https://github.com/dotnet/aspire

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Aspire.Hosting.AgentFramework.DevUI:

Repository Stars
foxminchan/BookWorm
An Aspire reference architecture for cloud-native microservices and agentic AI with MCP, A2A & AG-UI
Version Downloads Last Updated
1.26.0-preview.261023.1 73 10/23/2026
1.25.0-preview.261014.1 150 10/14/2026
1.24.0-preview.261006.1 500 10/7/2026
1.23.0-preview.260928.1 649 9/29/2026
1.22.0-preview.260918.1 257 9/18/2026
1.21.0-preview.260911.1 274 9/11/2026
1.20.0-preview.260831.1 389 8/31/2026
1.19.0-preview.260822.1 353 8/22/2026
1.18.0-preview.260818.1 511 8/18/2026
1.17.0-preview.260804.1 240 8/4/2026
1.16.0-preview.260730.1 113 7/30/2026
1.15.0-preview.260722.1 682 7/22/2026
1.14.0-preview.260721.1 92 7/21/2026
1.13.0-preview.260703.1 254 7/3/2026
1.12.0-preview.260629.1 110 6/30/2026
1.11.1-preview.260625.1 287 6/25/2026
1.11.0-preview.260623.1 101 6/23/2026
1.10.0-preview.260610.1 342 6/10/2026
1.9.0-preview.260603.1 449 6/3/2026
1.8.0-preview.260528.1 192 5/28/2026
Loading failed