skills/microsoft/learn-microsoft-agent-framework-with-foundry-zavashop-supply-chain-workshop/agent-framework-agui-csharp/Gen Agent Trust Hub
agent-framework-agui-csharp
Pass
Audited by Gen Agent Trust Hub on Oct 12, 2026
Risk Level: SAFEINDIRECT_PROMPT_INJECTIONCOMMAND_EXECUTIONEXTERNAL_DOWNLOADS
Full Analysis
- [Indirect Prompt Injection Surface]: The
SharedStateAgentpattern inreferences/server.mdaccepts arbitrary JSON data from the client through theag_ui_stateproperty and interpolates it directly into a system message for the model. - Ingestion points:
references/server.md(SharedStateAgent.RunCoreStreamingAsync) extracts data fromChatOptions.AdditionalProperties["ag_ui_state"]. - Boundary markers: The implementation uses text delimiters such as "Here is the current state in JSON format:" and "The new state is:", but lacks explicit instructions for the model to ignore embedded commands within that data.
- Capability inventory: The agent may possess tool-calling capabilities (both backend and frontend), allowing the injected data to potentially trigger actions if the model follows instructions contained within the state object.
- Sanitization: The example code uses
state.GetRawText()to include the data in the prompt without applying specific sanitization or schema validation at the interpolation step. - [Subprocess Execution]: The skill facilitates the use of the GitHub Copilot CLI as a model provider through the
CopilotClientclass. - This involves booting a CLI subprocess (configured via
COPILOT_CLI_PATH). - The documentation notes that an
OnPermissionRequesthandler, such asPermissionHandler.ApproveAll, is required for tool execution. This effectively delegates authorization decisions to the model's logic for the duration of the session. - [External Package References]: The installation instructions reference several pre-release NuGet packages from Microsoft and Azure organizations.
- Dependencies:
Microsoft.Agents.AI.Hosting.AGUI.AspNetCore,Microsoft.Agents.AI.OpenAI,Microsoft.Agents.AI.GitHub.Copilot, andAzure.AI.OpenAIare fetched from official registries. - Context: These are standard SDK components from a well-known service provider, used here to enable the core protocol functionality.
- [Telemetry and Logging]: Documentation in
references/advanced.mdsuggests enabling comprehensive HTTP logging (HttpLoggingFields.RequestBodyandResponseBody) in development environments. - While intended for debugging AG-UI protocol streams, this configuration will capture and store all conversation content and tool payloads, which may include sensitive information if not restricted to non-production environments.
Audit Metadata