AI-Studio/app/MindWork AI Studio/Tools/Security/PromptInjectionScanResult.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

19 lines
937 B
C#

namespace AIStudio.Tools.Security;
/// <summary>
/// What the runtime filtered out of one piece of external content.
/// </summary>
/// <param name="Source">Where the content came from, so the user can tell which file or page it was.</param>
/// <param name="Findings">The passages that were removed. Capped by the runtime.</param>
/// <param name="RedactedCount">How many passages were removed in total, which may exceed the number of findings.</param>
public sealed record PromptInjectionScanResult(PromptInjectionSource Source, IReadOnlyList<PromptInjectionFinding> Findings, int RedactedCount)
{
/// <summary>
/// Gets a value indicating whether anything was filtered out of this content.
/// </summary>
/// <remarks>
/// The content itself stays usable either way: passages are removed, the content around
/// them is not rejected.
/// </remarks>
public bool WasFiltered => this.RedactedCount > 0;
}