Skip to content

Conversation

@krngrover94
Copy link
Collaborator

  • Introduced Base Prompt Rule in GuardrailPoliciesAction to auto-populate base prompts based on selected agent collections.
  • Updated GuardrailPolicies DTO to include BasePromptRule with properties for enabling, auto-detection, and confidence score.
  • Enhanced CreateGuardrailModal to manage Base Prompt Rule settings, including UI elements for configuration.
  • Modified GuardrailPolicies component to handle Base Prompt Rule data in the UI.
  • Added logic to fetch detected base prompts from agent collections.

- Introduced Base Prompt Rule in GuardrailPoliciesAction to auto-populate base prompts based on selected agent collections.
- Updated GuardrailPolicies DTO to include BasePromptRule with properties for enabling, auto-detection, and confidence score.
- Enhanced CreateGuardrailModal to manage Base Prompt Rule settings, including UI elements for configuration.
- Modified GuardrailPolicies component to handle Base Prompt Rule data in the UI.
- Added logic to fetch detected base prompts from agent collections.
@krngrover94 krngrover94 requested a review from Ark2307 November 21, 2025 04:21
Copy link
Contributor

@devsecopsbot devsecopsbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Security analysis: "Automated analysis found no security issues in the five changed files. No immediate fixes required, but residual risks such as runtime logic flaws and dependency vulnerabilities may remain and warrant verification."

Risk Level AI Score
🟢 NO RISK 5.0/100

Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)

Title Location Recommendation
No issues to display

🔗 View Detailed Report

Copy link
Contributor

@devsecopsbot devsecopsbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Security analysis: "Automated scan found no issues across nine changed files, but changes could still introduce undetected vulnerabilities or logic errors. Ensure manual review and full CI/security testing for sensitive areas."

Risk Level AI Score
🟢 NO RISK 5.0/100

Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)

Title Location Recommendation
No issues to display

🔗 View Detailed Report

Copy link
Contributor

@devsecopsbot devsecopsbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Security analysis: "Automated scan found no issues across nine changed files, but changes could still introduce undetected vulnerabilities or logic errors. Ensure manual review and full CI/security testing for sensitive areas."

Risk Level AI Score
🟢 NO RISK 5.0/100

Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)

Title Location Recommendation
No issues to display

🔗 View Detailed Report

*
* Fetches detectedBasePrompt from the first selected agent collection
*/
private void populateBasePromptIfNeeded(GuardrailPolicies policy) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Duplicate logic in cyborg as well, can think of keeping it in some common place like libs/dao/src/main/java/com/akto/util
  2. Also, we are not showing the auto detected base prompt in UI. Why do we need this then?

<HorizontalStack gap="2" blockAlign="center">
<Text
variant="bodyMd"
<Text
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix / restore the formatting in entire renderAllSteps block

…ve placeholder detection logic. Update CreateGuardrailModal for better layout consistency and adjust BasePromptStep for confidence threshold labeling.
Copy link
Contributor

@devsecopsbot devsecopsbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Security analysis: "Automated scan found no issues, but absence of findings does not guarantee safety. Multiple modified files increase regression and undetected-vulnerability risk; validate with additional targeted testing and reviews."

Risk Level AI Score
🟢 NO RISK 10.0/100

Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)

Title Location Recommendation
No issues to display

🔗 View Detailed Report

Copy link
Contributor

@rakshak-akto rakshak-akto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed,

  • lets show base prompt for all agents
  • show some messaging if base prompt could not be detected or confidence score is not enough or no single template found.
  • in future iteration, we can allow option to edit as well
  • In policy page, simply show a checkbox (no additional text prompts needed). This rule can be called something on the lines of Base prompt template enforcement (agent only)

tabs={[
ValuesTab,
SchemaTab,
...(detectedBasePrompt ? [BasePromptTab] : []),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should show if isAgent = true (which is controlled by gen-ai tag
As discussed, show some messaging from backend ("Couldn't detect base prompt" or "No single / Multiple base prompt detected")

* @param {string} text - The text to search for placeholders
* @returns {Array} Array of placeholder objects with {start, end, phrase}
*/
findPlaceholders: function(text) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple regex match won't work?
Search for regex groups like these?
{...} {{...}}

rakshak-akto
rakshak-akto previously approved these changes Dec 4, 2025
…ase prompt auto-detection logic. Update BasePromptStep to enhance intent verification messaging and simplify state management. Adjust GuardrailPolicies DTO to reflect changes in base prompt handling.
Copy link
Contributor

@devsecopsbot devsecopsbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Security analysis: "Automated scan found no issues, but absence of findings does not guarantee safety. Multiple modified files increase regression and undetected-vulnerability risk; validate with additional targeted testing and reviews."

Risk Level AI Score
🟢 NO RISK 10.0/100

Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)

Title Location Recommendation
No issues to display

🔗 View Detailed Report

…d on the presence of a 'gen-ai' tag in the API collection. Remove detectedBasePrompt from ApiCollection DTO to streamline data handling.
Copy link
Contributor

@devsecopsbot devsecopsbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Security analysis: "Review found no security issues in the change. Residual risk remains from undetected vulnerabilities or dependency/configuration regressions; continue automated scanning and verify security-focused tests before merging."

Risk Level AI Score
🟢 NO RISK 10.0/100

Top 0 security issues / 0 total (Critical: 0, High: 0, Medium: 0, Low: 0)

Title Location Recommendation
No issues to display

🔗 View Detailed Report

@krngrover94 krngrover94 merged commit 16861d0 into master Dec 4, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants