AI-Studio/app/MindWork AI Studio/Tools/Security/PromptInjectionAlertMessage.cs
Sabrina-devops 902a01a4d0
Added a prompt injection detection (#857)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
2026-08-23 11:09:11 +02:00

17 lines
726 B
C#

namespace AIStudio.Tools.Security;
/// <summary>
/// Asks the UI to tell the user what was filtered out of the content they just used.
/// </summary>
/// <remarks>
/// Carries every result of one user action rather than a single one. Attaching twenty
/// documents at once must produce one dialog listing all of them, not twenty dialogs.
/// </remarks>
/// <param name="Results">What was filtered, per piece of content.</param>
public sealed record PromptInjectionAlertMessage(IReadOnlyList<PromptInjectionScanResult> Results)
{
/// <summary>
/// Gets the total number of filtered passages across all content.
/// </summary>
public int TotalRedactedCount => this.Results.Sum(result => result.RedactedCount);
}