mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 04:57:59 +00:00
Added a prompt injection detection (#857)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
d3163badd9
commit
902a01a4d0
55 files changed
+5598
-70
No files matched your search
@@ -0,0 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AIStudio.Tools.Rust;
|
||||
|
||||
/// <param name="Text">The content to filter.</param>
|
||||
public readonly record struct SanitizePromptInjectionsRequest([property: JsonPropertyName("text")] string Text);
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
using AIStudio.Tools.Security;
|
||||
|
||||
namespace AIStudio.Tools.Rust;
|
||||
|
||||
/// <param name="SanitizedText">The content with the suspicious passages removed. Usable as it stands.</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 readonly record struct SanitizePromptInjectionsResponse(
|
||||
[property: JsonPropertyName("sanitized_text")] string SanitizedText,
|
||||
[property: JsonPropertyName("findings")] IReadOnlyList<PromptInjectionFinding> Findings,
|
||||
[property: JsonPropertyName("redacted_count")] int RedactedCount);
|
||||
Reference in new issue
Block a user