mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-04-09 18:01:37 +00:00
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,deb,updater, appimage,deb) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,deb,updater, appimage,deb) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
46 lines
1.5 KiB
C#
46 lines
1.5 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace AIStudio.Agents.AssistantAudit;
|
|
|
|
/// <summary>
|
|
/// Represents a single structured security finding produced by the assistant audit agent.
|
|
/// </summary>
|
|
public sealed class AssistantAuditFinding
|
|
{
|
|
#pragma warning disable MWAIS0005
|
|
/// <summary>
|
|
/// Gets the normalized internal severity level derived from <see cref="SeverityText"/>.
|
|
/// </summary>
|
|
#pragma warning restore MWAIS0005
|
|
[JsonIgnore]
|
|
public AssistantAuditLevel Severity { get; private init; } = AssistantAuditLevel.UNKNOWN;
|
|
|
|
|
|
/// <summary>
|
|
/// Gets or initializes the JSON-facing severity label used by the audit model response.
|
|
/// </summary>
|
|
[JsonPropertyName("severity")]
|
|
public string SeverityText
|
|
{
|
|
get => this.Severity switch
|
|
{
|
|
AssistantAuditLevel.DANGEROUS => "critical",
|
|
AssistantAuditLevel.CAUTION => "medium",
|
|
AssistantAuditLevel.SAFE => "low",
|
|
_ => "unknown",
|
|
};
|
|
|
|
init => this.Severity = value.Trim().ToLowerInvariant() switch
|
|
{
|
|
"critical" => AssistantAuditLevel.DANGEROUS,
|
|
"medium" => AssistantAuditLevel.CAUTION,
|
|
"low" => AssistantAuditLevel.SAFE,
|
|
_ => AssistantAuditLevel.UNKNOWN,
|
|
};
|
|
}
|
|
|
|
public string Category { get; init; } = string.Empty;
|
|
public string Location { get; init; } = string.Empty;
|
|
public string Description { get; init; } = string.Empty;
|
|
}
|