mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 03:17: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
@@ -2,6 +2,7 @@
|
||||
using AIStudio.Chat;
|
||||
using AIStudio.Dialogs.Settings;
|
||||
using AIStudio.Tools.AssistantSessions;
|
||||
using AIStudio.Tools.Security;
|
||||
|
||||
namespace AIStudio.Assistants.SlideBuilder;
|
||||
|
||||
@@ -373,6 +374,13 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
|
||||
""");
|
||||
}
|
||||
|
||||
//
|
||||
// One report for the whole batch: reading twenty documents must produce one dialog
|
||||
// listing all of them, not twenty dialogs in a row.
|
||||
//
|
||||
var guardService = Program.SERVICE_PROVIDER.GetRequiredService<PromptInjectionGuardService>();
|
||||
await using var promptInjectionScope = guardService.BeginAction();
|
||||
|
||||
var numDocuments = 1;
|
||||
foreach (var document in documents)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user