Skip to content

Agentix | Actions | CortexGetEmailInvestigationSummary#43081

Open
mayyagoldman wants to merge 7 commits intomasterfrom
CRTX-223087
Open

Agentix | Actions | CortexGetEmailInvestigationSummary#43081
mayyagoldman wants to merge 7 commits intomasterfrom
CRTX-223087

Conversation

@mayyagoldman
Copy link
Contributor

Contributing to Cortex XSOAR Content

Make sure to register your contribution by filling the contribution registration form

The Pull Request will be reviewed only after the contribution registration form is filled.

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

https://jira-dc.paloaltonetworks.com/browse/CRTX-223087

Description

Must have

  • Tests
  • Documentation

@mayyagoldman mayyagoldman added ready-for-pipeline-running Whether the pr is ready for running the whole pipeline, including testing on SAAS machines ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. labels Feb 12, 2026
@content-bot
Copy link
Contributor

🤖 AI-Powered Code Review Available

You can leverage AI-powered code review to assist with this PR!

Available Commands:

  • @content-bot start review - Initiate a full AI code review
  • @content-bot re-review - Incremental review for new commits

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

@content-bot content-bot removed the ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. label Feb 12, 2026
@content-bot
Copy link
Contributor

🤖 Content AI Reviewer: Analysis started. Please wait for results...

@content-bot
Copy link
Contributor

🤖 Content-bot Review Disclaimer

This review was generated by an AI-powered tool and may contain inaccuracies. Please be advised, and we extend our sincere apologies for any inconvenience this may cause.

Copy link
Contributor

@content-bot content-bot left a comment

Choose a reason for hiding this comment

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

Thanks for the update to the Cortex Core integration! I've reviewed the changes and have a few suggestions to improve robustness and consistency.

Please update the Python code to use arg_to_number for safer type conversions and ensure the new command is properly registered in the YAML and covered by a test playbook. Also, take a look at the release notes formatting and verify if the new command is intended to be hidden.

Great work so far!

Additionally, please address the following file-level notes:

  • Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml: Please ensure a test playbook is added or updated to test the new command core-get-email-investigation-summary. The tests section currently indicates No tests.

@JudahSchwartz please review and approve the results generated by the AI Reviewer by responding 👍 on this comment.

verify_platform_version()
return_results(xql_query_platform_command(client, args))

elif command == "core-get-email-investigation-summary":
Copy link
Contributor

Choose a reason for hiding this comment

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

The command core-get-email-investigation-summary is registered here, but the integration YAML file (CortexPlatformCore.yml) does not appear to be modified in this PR. Please ensure the command is added to the YAML definition so it is exposed to Cortex XSOAR.

params: dict[str, Any] = {}

if days_timeframe := args.get("days_timeframe"):
params["days_timeframe"] = int(days_timeframe)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use arg_to_number for robust integer conversion and error handling.

if detection_method := args.get("detection_method"):
params["detection_method"] = detection_method
if min_severity := args.get("min_severity"):
params["min_severity"] = severity_mapping.get(min_severity, min_severity)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using .lower() to handle case-insensitive input for severity mapping.

if min_severity := args.get("min_severity"):
params["min_severity"] = severity_mapping.get(min_severity, min_severity)
if min_severity_phishing := args.get("min_severity_phishing"):
params["min_severity_phishing"] = severity_mapping.get(min_severity_phishing, min_severity_phishing)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using .lower() to handle case-insensitive input for severity mapping.

if min_severity_phishing := args.get("min_severity_phishing"):
params["min_severity_phishing"] = severity_mapping.get(min_severity_phishing, min_severity_phishing)
if page_size := args.get("page_size"):
params["page_size"] = int(page_size)
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Use arg_to_number for robust integer conversion.
  • Use arg_to_number for robust type conversion.

if page_size := args.get("page_size"):
params["page_size"] = int(page_size)
if page_number := args.get("page_number"):
params["page_number"] = int(page_number)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use arg_to_number for robust integer conversion.

params["min_severity_phishing"] = severity_mapping.get(min_severity_phishing, min_severity_phishing)
if page_size := args.get("page_size"):
params["page_size"] = int(page_size)
if page_number := args.get("page_number"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Handle 0 correctly when using arg_to_number.

defaultValue: "1"
name: core-get-email-investigation-summary
description: Retrieves a summary of phishing email investigation campaigns from Cortex, grouping individual alerts by email message ID to help prioritize investigations based on impact and scale.
hidden: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a specific reason for hiding this command? Generally, commands like core-get-cases or core-get-issues are exposed. If this is intended only for Agentix/AI use, please confirm.

type: Unknown
- arguments:
- description: Number of days to look back for issues.
name: days_timeframe
Copy link
Contributor

Choose a reason for hiding this comment

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

The argument days_timeframe is used as an integer in the code (int(days_timeframe)). Consider using arg_to_number for safer conversion or clarifying the expected input format in the description.

@@ -0,0 +1,12 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the leading empty line and the extra empty lines between the headers and content to adhere to the standard release notes format.

Recommended format:

<~PLATFORM>
#### Integrations
##### Cortex Core - Platform
- Documentation and metadata improvements.
<!-- Added the core-get-email-investigation-summary command for retrieving phishing email investigation campaign summaries (hidden command for internal use). -->
</~PLATFORM>

@content-bot
Copy link
Contributor

Validate summary
The following errors were reported as warnings: BC117.
BC117 validation requires PM review due to changes to supportedModules.
The following errors were thrown as a part of this pr: RN114, GR109, RN107.
The following errors can be ignored: RN114.
The following errors cannot be ignored: GR109, RN107.
If the AG100 validation in the pre-commit GitHub Action fails, the pull request cannot be force-merged.
The following errors don't run as part of the nightly flow and therefore can be force merged: RN114, GR109, RN107.

Verdict: PR can be force merged from validate perspective? ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-pipeline-running Whether the pr is ready for running the whole pipeline, including testing on SAAS machines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants