mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 01:57:59 +00:00
Added security checks for confidence levels
This commit is contained in:
1 parent
3eca153f83
commit
185a99c9ed
22 files changed
+322
-125
No files matched your search
@@ -140,6 +140,8 @@ public sealed class AgentDataSourceSelection (ILogger<AgentDataSourceSelection>
|
||||
//
|
||||
|
||||
// We start with the provider currently selected by the user:
|
||||
var requiredDataSecurity = dataSources.AllowedDataSources.GetRequiredSecurityPolicy();
|
||||
var requiredComplianceLevel = dataSources.AllowedDataSources.GetRequiredComplianceLevel();
|
||||
var agentProvider = this.SettingsManager.GetPreselectedProvider(Tools.Components.AGENT_DATA_SOURCE_SELECTION, provider.Id, true);
|
||||
if (agentProvider == Settings.Provider.NONE)
|
||||
{
|
||||
@@ -147,6 +149,12 @@ public sealed class AgentDataSourceSelection (ILogger<AgentDataSourceSelection>
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!agentProvider.AllowsDataSourceAccess(this.SettingsManager, requiredDataSecurity, requiredComplianceLevel))
|
||||
{
|
||||
logger.LogWarning($"The agent for data source selection uses provider '{agentProvider.InstanceName}' with confidence '{agentProvider.GetConfidenceLevel(this.SettingsManager).GetName()}', but the available data sources require data security '{requiredDataSecurity}' and provider confidence '{requiredComplianceLevel.GetName()}'. The agent cannot select data sources.");
|
||||
return [];
|
||||
}
|
||||
|
||||
// Assign the provider settings to the agent:
|
||||
logger.LogInformation($"The agent for the data source selection uses the provider '{agentProvider.InstanceName}' ({agentProvider.UsedLLMProvider.ToName()}, confidence={agentProvider.UsedLLMProvider.GetConfidence(this.SettingsManager).Level.GetName()}).");
|
||||
this.ProviderSettings = agentProvider;
|
||||
|
||||
Reference in new issue
Block a user