Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution][Detection Engine] adds AI Assistant to rule create form #179091

Merged
merged 56 commits into from
Jul 1, 2024

Conversation

vitaliidm
Copy link
Contributor

@vitaliidm vitaliidm commented Mar 20, 2024

Summary

  • adds AI assistant for queries for every rule type, apart Machine Learning
  • AI assistant is shown only when query is not empty and invalid
  • When user clicks on assistant it records telemetry event open_assistant_on_rule_query_error
  • hidden behind AIAssistantOnRuleCreationFormEnabled feature flag

Design

Design

AI assistant help contextual

Demo

new.UX.mov

Old Demoes

Note: old demo videos use old UI design, and assistant is shown even for valid queries.

list of videos

ES|QL Case 1

Simple ES|QL query validation error solving
There 2 problems in query highlighted by validation.
First, missing metadata operator
Second, operator = instead of ==
By feeding query twice in Ai Assistant, I was able to get working solution

Screen.Recording.2024-03-20.at.16.15.02.mov

ES|QL Case 2

Fixes missing _id field, when metadata operator is present

4k.Screen.Recording.2024-03-21.at.16.08.21.mov

EQL Case 1

fixes EQL typo

Screen.Recording.2024-03-21.at.16.33.26.mov

Issues

Results might not be always consistent and for more complex queries they might not correct

Screen.Recording.2024-03-21.at.16.57.00.mov

@vitaliidm vitaliidm self-assigned this Mar 20, 2024
@vitaliidm vitaliidm added Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Engine Security Solution Detection Engine Area labels Mar 20, 2024
@approksiu
Copy link

@vitaliidm Some videos here do not open, could you check please?

@vitaliidm
Copy link
Contributor Author

vitaliidm commented Apr 15, 2024

@vitaliidm Some videos here do not open, could you check please?

@approksiu do you see any error? can you attach a screen recording with failure?

I suspect it might be because github authentication token expired. It happens when page is opened for a long time.
Try to refresh a page and play videos.

It works for me even from incognito tab, when I am not log in as myself.

@approksiu
Copy link

approksiu commented Apr 15, 2024

@approksiu do you see any error? can you attach a screen recording with failure?

I get this error for ESQL case2 and Issues videos, refresh did not help:
image

@vitaliidm
Copy link
Contributor Author

@approksiu

probably something related to browser/OS that could not play that video format. I'll share internal link to this video

@ARWNightingale
Copy link

@vitaliidm What happens if the user clicks on the Ask assistant button before any query is inputted?

@vitaliidm
Copy link
Contributor Author

@ARWNightingale

New assistant chat would be opened with empty context:
Screenshot 2024-04-22 at 18 14 08

We can hide chat button if query is empty. I left it there, so user could use it and ask assistant help with query creation

@ARWNightingale
Copy link

I think we should hide it unless there is an actual warning/error on the query. The user has the option of AI assistant in the top nav/breadcrumb bar to open it separately. We can look at how to use AI more contextually in the whole form at a later date.
Sorry for the late reply, we can always update this later if its too late.

@ARWNightingale
Copy link

@ARWNightingale
Copy link

This gives a more detail on how the ui should look. I hope it helps let me know if you need any more info.

Design

AI assistant help contextual

@vitaliidm vitaliidm removed the ci:cloud-redeploy Always create a new Cloud deployment label Jun 24, 2024
@vitaliidm vitaliidm added the ci:cloud-deploy Create or update a Cloud deployment label Jun 24, 2024
/**
* Enables AI assistant on rule creation form when query has error
*/
AIAssistantOnRuleCreationFormEnabled: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

disable before merge. Needed for CI deployment to be testable

@vitaliidm vitaliidm requested a review from jamesspi June 24, 2024 14:31
@vitaliidm vitaliidm enabled auto-merge (squash) July 1, 2024 14:40
@vitaliidm vitaliidm removed the ci:cloud-deploy Create or update a Cloud deployment label Jul 1, 2024
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jul 1, 2024

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 5580 5582 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 15.6MB 15.6MB +3.2KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 83.6KB 83.7KB +114.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @vitaliidm

@vitaliidm vitaliidm merged commit 3506e14 into elastic:main Jul 1, 2024
38 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.15 candidate backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team:Detection Engine Security Solution Detection Engine Area Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants