mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-11 18:32:12 +00:00
155 lines
6.8 KiB
Plaintext
155 lines
6.8 KiB
Plaintext
@using AIStudio.Tools.Security
|
|
@inherits MSGComponentBase
|
|
|
|
<MudDialog MaxWidth="MaxWidth.Medium" FullWidth="true">
|
|
|
|
<DialogContent>
|
|
|
|
@if (Result is not null)
|
|
{
|
|
<MudPaper Class="pa-6 mb-4" Elevation="0" Style="background:#fff5f5;border:1px solid #f5d0d0;">
|
|
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="3">
|
|
<MudAvatar Size="Size.Large"
|
|
Color="Color.Error"
|
|
Variant="Variant.Filled">
|
|
<MudIcon Icon="@Icons.Material.Filled.GppMaybe"/>
|
|
</MudAvatar>
|
|
|
|
<MudStack Spacing="0">
|
|
<MudText Typo="Typo.h5">
|
|
@T("Security warning")
|
|
</MudText>
|
|
|
|
<MudText Typo="Typo.body2"
|
|
Color="Color.Error">
|
|
@T("AI Studio blocked this content before it reached a model or agent.")
|
|
</MudText>
|
|
</MudStack>
|
|
</MudStack>
|
|
|
|
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined" Class="mt-4">
|
|
<Content>
|
|
<MudText Typo="Typo.body2">
|
|
@T("Typical attacks on AI systems (e.g. prompt injection) hide instructions within untrusted content to trick an AI model into ignoring its intended rules or performing unintended actions.")
|
|
</MudText>
|
|
</Content>
|
|
</MudAlert>
|
|
</MudPaper>
|
|
|
|
<MudPaper Class="pa-6 mb-4" Elevation="0" Style="background:#f0fff0;border:1px solid #90ee90;">
|
|
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="3">
|
|
<MudAvatar Size="Size.Large"
|
|
Color="Color.Success"
|
|
Variant="Variant.Filled">
|
|
<MudIcon Icon="@Icons.Material.Filled.Check"/>
|
|
</MudAvatar>
|
|
|
|
<MudStack Spacing="0">
|
|
<MudText Typo="Typo.h5">
|
|
@T("Security active")
|
|
</MudText>
|
|
|
|
<MudText Typo="Typo.body2"
|
|
Color="Color.Success">
|
|
@T("AI Studio has reliably detected and blocked the suspicious content. Your applications and data remain protected. Please review the content you uploaded.")
|
|
</MudText>
|
|
</MudStack>
|
|
</MudStack>
|
|
</MudPaper>
|
|
|
|
<MudDivider />
|
|
<MudStack Row="true" Justify="Justify.Center" Class="my-2">
|
|
<MudButton Variant="Variant.Text"
|
|
EndIcon="@(showPromptInjectionInformation ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
|
|
OnClick="@TogglePromptInjectionInformation">
|
|
|
|
@(showPromptInjectionInformation
|
|
? T("Hide more information")
|
|
: T("More information"))
|
|
</MudButton>
|
|
</MudStack>
|
|
|
|
<MudCollapse Expanded="@showPromptInjectionInformation">
|
|
<MudPaper Outlined="true"
|
|
Class="pa-4 mb-4">
|
|
<MudGrid>
|
|
<MudItem xs="12" md="3">
|
|
<MudStack>
|
|
<MudIcon Icon="@Icons.Material.Filled.Source" />
|
|
|
|
<MudText Typo="Typo.subtitle2">
|
|
@T("Source type")
|
|
</MudText>
|
|
|
|
<MudText Typo="Typo.body2">
|
|
@this.GetSourceKindLabel(Result.Source.Kind)
|
|
</MudText>
|
|
</MudStack>
|
|
</MudItem>
|
|
|
|
<MudItem xs="12" md="4">
|
|
<MudStack>
|
|
<MudIcon Icon="@Icons.Material.Outlined.Description"/>
|
|
|
|
<MudText Typo="Typo.subtitle2">
|
|
@T("Content source")
|
|
</MudText>
|
|
|
|
<MudText Typo="Typo.body2"
|
|
Style="word-break:break-all;">
|
|
@Result.Source.Label
|
|
</MudText>
|
|
</MudStack>
|
|
</MudItem>
|
|
|
|
<MudItem xs="12" md="5">
|
|
<MudStack>
|
|
<MudIcon Icon="@Icons.Material.Outlined.WarningAmber"/>
|
|
|
|
<MudText Typo="Typo.subtitle2">
|
|
@T("Detected content")
|
|
</MudText>
|
|
|
|
@foreach (var finding in Result.Findings)
|
|
{
|
|
<MudStack Spacing="0">
|
|
<MudText Typo="Typo.body2">
|
|
<b>
|
|
@($"{this.GetFindingCategoryLabel(finding.Category)}")
|
|
</b>
|
|
</MudText>
|
|
|
|
<MudText Typo="Typo.body2" Class="ml-4 mt-1">
|
|
@finding.Snippet
|
|
</MudText>
|
|
</MudStack>
|
|
}
|
|
</MudStack>
|
|
</MudItem>
|
|
</MudGrid>
|
|
</MudPaper>
|
|
|
|
<MudPaper Class="pa-4 mt-2"
|
|
Style="background:#fafafa;">
|
|
|
|
<MudText Typo="Typo.body2" Class="mb-3">
|
|
@T("Prompt injection is a method used to manipulate AI systems such as chatbots. An attacker places misleading instructions in content so that the AI treats them as legitimate. This can cause the AI to ignore safeguards, expose private information, or generate harmful content.")
|
|
</MudText>
|
|
|
|
<MudLink Href="@PromptInjectionGuardService.WIKI_URL"
|
|
Target="_blank">
|
|
@PromptInjectionGuardService.WIKI_URL
|
|
</MudLink>
|
|
</MudPaper>
|
|
</MudCollapse>
|
|
}
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton Variant="Variant.Filled"
|
|
Color="Color.Default"
|
|
OnClick="@Close">
|
|
|
|
@T("Close")
|
|
</MudButton>
|
|
</DialogActions>
|
|
</MudDialog> |