using System.Text.Json.Serialization; namespace AIStudio.Tools.Security; /// /// One passage the runtime identified as a prompt-injection attempt and filtered out. /// /// /// The property names are spelled out because the content stream is deserialized without a /// naming policy, so the names have to match what the runtime sends verbatim. /// public sealed record PromptInjectionFinding { /// /// Which rule matched, e.g. "instruction_override". /// [JsonPropertyName("rule_id")] public string RuleId { get; init; } = string.Empty; /// /// The rule's family, e.g. "exfiltration". /// [JsonPropertyName("category")] public PromptInjectionFindingCategory Category { get; init; } = PromptInjectionFindingCategory.UNKNOWN; /// /// The passage as it appeared in the content, so the user can see what was removed. /// [JsonPropertyName("snippet")] public string Snippet { get; init; } = string.Empty; }