mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-23 08:53:48 +00:00
Moved the background agents to AI operations (#1215)
This commit is contained in:
1 parent
8a4a26503b
commit
c50a93cd17
139 files changed
+4069
-2340
No files matched your search
@@ -0,0 +1,45 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AIStudio.AIOperations.PluginAudit;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a single structured security finding produced by the security audit of a plugin.
|
||||
/// </summary>
|
||||
public sealed class PluginAuditFinding
|
||||
{
|
||||
#pragma warning disable MWAIS0005
|
||||
/// <summary>
|
||||
/// Gets the normalized internal severity level derived from <see cref="SeverityText"/>.
|
||||
/// </summary>
|
||||
#pragma warning restore MWAIS0005
|
||||
[JsonIgnore]
|
||||
public PluginAuditLevel Severity { get; private set; } = PluginAuditLevel.UNKNOWN;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JSON-facing severity label used by the audit model response.
|
||||
/// </summary>
|
||||
[JsonPropertyName("severity")]
|
||||
public string SeverityText
|
||||
{
|
||||
get => this.Severity switch
|
||||
{
|
||||
PluginAuditLevel.DANGEROUS => "critical",
|
||||
PluginAuditLevel.CAUTION => "medium",
|
||||
PluginAuditLevel.SAFE => "low",
|
||||
_ => "unknown",
|
||||
};
|
||||
|
||||
set => this.Severity = value.Trim().ToLowerInvariant() switch
|
||||
{
|
||||
"critical" => PluginAuditLevel.DANGEROUS,
|
||||
"medium" => PluginAuditLevel.CAUTION,
|
||||
"low" => PluginAuditLevel.SAFE,
|
||||
_ => PluginAuditLevel.UNKNOWN,
|
||||
};
|
||||
}
|
||||
|
||||
public string Category { get; set; } = string.Empty;
|
||||
public string Location { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in new issue
Block a user