fix: Don't invoke tools if no providers or completed scans (#8443)

Co-authored-by: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com>
This commit is contained in:
Chandrapal Badshah
2025-08-05 13:02:35 +05:30
committed by GitHub
parent cf8402e013
commit b30eab7935
2 changed files with 10 additions and 5 deletions
+9 -5
View File
@@ -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);
+1
View File
@@ -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