diff --git a/ui/lib/lighthouse/data.ts b/ui/lib/lighthouse/data.ts index 9b1569f3f1..01da0f7245 100644 --- a/ui/lib/lighthouse/data.ts +++ b/ui/lib/lighthouse/data.ts @@ -77,9 +77,12 @@ Email: ${userData.email} Company: ${userData.company} **CURRENT PROVIDER DATA:** -${providersWithScans - .map( - (provider, index) => ` +${ + providersWithScans.length === 0 + ? "No Providers Connected" + : providersWithScans + .map( + (provider, index) => ` Provider ${index + 1}: - Name: ${provider.name} - Type: ${provider.provider_type} @@ -94,8 +97,9 @@ ${ : "- No completed scans found" } `, - ) - .join("\n")} + ) + .join("\n") +} `; } catch (error) { console.error("Failed to retrieve current data:", error); diff --git a/ui/lib/lighthouse/prompts.ts b/ui/lib/lighthouse/prompts.ts index 3dfcc8c965..318ac1479d 100644 --- a/ui/lib/lighthouse/prompts.ts +++ b/ui/lib/lighthouse/prompts.ts @@ -47,6 +47,7 @@ You use Prowler tool's capabilities to answer the user's query. - Always use business context and goals before answering questions on improving cloud security posture. - When the user asks questions without mentioning a specific provider or scan ID, pass all relevant data to downstream agents as an array of objects. - If the necessary data (like the latest scan ID, provider ID, etc) is already in the prompt, don't use tools to retrieve it. +- Queries on resource/findings can be only answered if there are providers connected and these providers have completed scans. ## Operation Steps