mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 22:53:48 +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,17 @@
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Tools.Security;
|
||||
|
||||
public static class PromptInjectionSourceKindExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(PromptInjectionSourceKindExtensions).Namespace, nameof(PromptInjectionSourceKindExtensions));
|
||||
|
||||
public static string GetDisplayName(this PromptInjectionSourceKind kind) => kind switch
|
||||
{
|
||||
PromptInjectionSourceKind.WEB_CONTENT => TB("Web content"),
|
||||
PromptInjectionSourceKind.FILE_CONTENT => TB("File content"),
|
||||
PromptInjectionSourceKind.CHAT_ATTACHMENT => TB("Chat attachment"),
|
||||
PromptInjectionSourceKind.RETRIEVAL_CONTEXT => TB("Retrieved context"),
|
||||
_ => TB("Unknown"),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user