Security audit provider fallback (#876)
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions

This commit is contained in:
nilskruthoff 2026-07-21 08:17:13 +02:00 committed by GitHub
parent b36b800028
commit f13c35d814
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 6 deletions

View File

@ -117,10 +117,14 @@ public sealed class AssistantAuditAgent(ILogger<AssistantAuditAgent> logger, ILo
/// <summary> /// <summary>
/// Resolves and stores the provider configuration used for assistant plugin audits. /// Resolves and stores the provider configuration used for assistant plugin audits.
/// </summary> /// </summary>
/// <param name="fallbackProvider">The provider to use when no provider is configured for the audit agent.</param>
/// <returns>The configured provider, or <see cref="AIStudio.Settings.Provider.NONE"/> when no audit provider is configured.</returns> /// <returns>The configured provider, or <see cref="AIStudio.Settings.Provider.NONE"/> when no audit provider is configured.</returns>
public AIStudio.Settings.Provider ResolveProvider() public AIStudio.Settings.Provider ResolveProvider(AIStudio.Settings.Provider? fallbackProvider = null)
{ {
var provider = this.SettingsManager.GetPreselectedProvider(Tools.Components.AGENT_ASSISTANT_PLUGIN_AUDIT, null, true); var provider = this.SettingsManager.GetPreselectedProvider(Tools.Components.AGENT_ASSISTANT_PLUGIN_AUDIT, null, true);
if (provider == AIStudio.Settings.Provider.NONE && fallbackProvider is not null)
provider = fallbackProvider;
this.ProviderSettings = provider; this.ProviderSettings = provider;
return provider; return provider;
} }
@ -130,12 +134,13 @@ public sealed class AssistantAuditAgent(ILogger<AssistantAuditAgent> logger, ILo
/// </summary> /// </summary>
/// <param name="plugin">The assistant plugin to audit.</param> /// <param name="plugin">The assistant plugin to audit.</param>
/// <param name="token">A cancellation token for prompt generation and the audit request.</param> /// <param name="token">A cancellation token for prompt generation and the audit request.</param>
/// <param name="fallbackProvider">The provider to use when no provider is configured for the audit agent.</param>
/// <returns> /// <returns>
/// The parsed audit result, or an <c>UNKNOWN</c> result when no provider is configured or the model response cannot be used. /// The parsed audit result, or an <c>UNKNOWN</c> result when no provider is configured or the model response cannot be used.
/// </returns> /// </returns>
public async Task<AssistantAuditResult> AuditAsync(PluginAssistants plugin, CancellationToken token = default) public async Task<AssistantAuditResult> AuditAsync(PluginAssistants plugin, CancellationToken token = default, AIStudio.Settings.Provider? fallbackProvider = null)
{ {
var provider = this.ResolveProvider(); var provider = this.ResolveProvider(fallbackProvider);
if (provider == AIStudio.Settings.Provider.NONE) if (provider == AIStudio.Settings.Provider.NONE)
{ {
await MessageBus.INSTANCE.SendError(new (Icons.Material.Filled.SettingsSuggest, string.Format(TB("No provider is configured for the Security Audit Agent.")))); await MessageBus.INSTANCE.SendError(new (Icons.Material.Filled.SettingsSuggest, string.Format(TB("No provider is configured for the Security Audit Agent."))));

View File

@ -570,7 +570,7 @@ public partial class AssistantBuilder : AssistantBaseCore<NoSettingsPanel>
this.isAuditingPlugin = true; this.isAuditingPlugin = true;
try try
{ {
this.pluginAudit = await this.AssistantPluginAuditService.RunAuditAsync(this.installedAssistantPlugin); this.pluginAudit = await this.AssistantPluginAuditService.RunAuditAsync(this.installedAssistantPlugin, fallbackProvider: this.ProviderSettings);
if (this.pluginAudit.Level is AssistantAuditLevel.UNKNOWN) if (this.pluginAudit.Level is AssistantAuditLevel.UNKNOWN)
{ {
this.FailInstallStep(BuilderInstallStep.SECURITY_CHECK, T("The security check could not determine a result.")); this.FailInstallStep(BuilderInstallStep.SECURITY_CHECK, T("The security check could not determine a result."));

View File

@ -7,9 +7,12 @@ namespace AIStudio.Tools.PluginSystem.Assistants;
/// </summary> /// </summary>
public sealed class AssistantPluginAuditService(AssistantAuditAgent auditAgent) public sealed class AssistantPluginAuditService(AssistantAuditAgent auditAgent)
{ {
public async Task<PluginAssistantAudit> RunAuditAsync(PluginAssistants plugin, CancellationToken token = default) /// <summary>
/// Runs an assistant plugin audit, optionally falling back to the supplied provider when no audit provider is configured.
/// </summary>
public async Task<PluginAssistantAudit> RunAuditAsync(PluginAssistants plugin, CancellationToken token = default, Settings.Provider? fallbackProvider = null)
{ {
var result = await auditAgent.AuditAsync(plugin, token); var result = await auditAgent.AuditAsync(plugin, token, fallbackProvider);
var provider = auditAgent.ProviderSettings; var provider = auditAgent.ProviderSettings;
var promptPreview = await plugin.BuildAuditPromptPreviewAsync(token); var promptPreview = await plugin.BuildAuditPromptPreviewAsync(token);

View File

@ -9,6 +9,7 @@
- Improved update guidance for Flatpak installations and added an enterprise option that lets organizations manage updates entirely through their IT department. - Improved update guidance for Flatpak installations and added an enterprise option that lets organizations manage updates entirely through their IT department.
- Improved secure API-key storage diagnostics on Linux. AI Studio now provides specific guidance when the default password collection is missing or locked, a password-manager prompt is dismissed, or no compatible Secret Service is available. - Improved secure API-key storage diagnostics on Linux. AI Studio now provides specific guidance when the default password collection is missing or locked, a password-manager prompt is dismissed, or no compatible Secret Service is available.
- Improved the file dialogs to prevent opening multiple times when you click "Open" or "Save" multiple times in a row. - Improved the file dialogs to prevent opening multiple times when you click "Open" or "Save" multiple times in a row.
- Improved the Assistant Builder security check so it can use the selected provider when no dedicated security audit agent provider is configured.
- Fixed an issue that could leave AI Studio unresponsive after waking the computer from sleep. Yes, we know this was an annoying bug, and we apologize for the inconvenience. - Fixed an issue that could leave AI Studio unresponsive after waking the computer from sleep. Yes, we know this was an annoying bug, and we apologize for the inconvenience.
- Fixed connections to internal HTTPS services and enterprise configuration servers that use organization-provided root certificates on Linux. - Fixed connections to internal HTTPS services and enterprise configuration servers that use organization-provided root certificates on Linux.
- Fixed enterprise configuration plugins from Windows-created ZIP files may not load correctly on Linux when the ZIP contained plugin files inside a folder. - Fixed enterprise configuration plugins from Windows-created ZIP files may not load correctly on Linux when the ZIP contained plugin files inside a folder.