Skip to content

[Security Assistant] KnowledgeBaseRetrievalTool and AskAboutESQLTool prompt updates#228074

Merged
stephmilovic merged 2 commits intoelastic:mainfrom
stephmilovic:kb_prompt_update
Jul 15, 2025
Merged

[Security Assistant] KnowledgeBaseRetrievalTool and AskAboutESQLTool prompt updates#228074
stephmilovic merged 2 commits intoelastic:mainfrom
stephmilovic:kb_prompt_update

Conversation

@stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Jul 15, 2025

Summary

@spong and I iterated on the KnowledgeBaseRetrievalTool prompt as we noticed poor evals, especially for GPT-4.1. This prompt brings us to 100% correctness rate

Additionally, I noticed the following error:

[ERROR][plugins.elasticAssistant.defaultAssistantGraph] Failed to get prompt for tool: AskAboutESQLTool

At first I thought the prompt was missing, but it turns out it was a capitalization mismatch (AskAboutEsqlTool vs AskAboutESQLTool). The capitalization is corrected in this PR, and here in the integrations repo: elastic/integrations#14555

@stephmilovic stephmilovic added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. labels Jul 15, 2025
@stephmilovic stephmilovic requested a review from a team as a code owner July 15, 2025 17:17
@stephmilovic stephmilovic added the Team:Security Generative AI Security Generative AI label Jul 15, 2025
@stephmilovic stephmilovic requested a review from a team as a code owner July 15, 2025 17:17
@stephmilovic stephmilovic added backport:version Backport to applied version labels v9.1.0 v8.19.0 v9.2.0 labels Jul 15, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

LGTM! 👍 Thanks for pairing on these changes @stephmilovic, and the extra error fix too!

@stephmilovic stephmilovic merged commit 9c53a52 into elastic:main Jul 15, 2025
28 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/16306297315

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 16, 2025
…ESQLTool` prompt updates (#228074) (#228112)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security Assistant] `KnowledgeBaseRetrievalTool` and
`AskAboutESQLTool` prompt updates
(#228074)](#228074)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"stephanie.milovic@elastic.co"},"sourceCommit":{"committedDate":"2025-07-15T23:10:39Z","message":"[Security
Assistant] `KnowledgeBaseRetrievalTool` and `AskAboutESQLTool` prompt
updates
(#228074)","sha":"9c53a52b48ac41706e77f3f595f4a2d947f97751","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Security
Assistant] `KnowledgeBaseRetrievalTool` and `AskAboutESQLTool` prompt
updates","number":228074,"url":"https://github.com/elastic/kibana/pull/228074","mergeCommit":{"message":"[Security
Assistant] `KnowledgeBaseRetrievalTool` and `AskAboutESQLTool` prompt
updates
(#228074)","sha":"9c53a52b48ac41706e77f3f595f4a2d947f97751"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228074","number":228074,"mergeCommit":{"message":"[Security
Assistant] `KnowledgeBaseRetrievalTool` and `AskAboutESQLTool` prompt
updates (#228074)","sha":"9c53a52b48ac41706e77f3f595f4a2d947f97751"}}]}]
BACKPORT-->

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Jul 16, 2025
…tESQLTool` prompt updates (#228074) (#228111)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Security Assistant] `KnowledgeBaseRetrievalTool` and
`AskAboutESQLTool` prompt updates
(#228074)](#228074)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"stephanie.milovic@elastic.co"},"sourceCommit":{"committedDate":"2025-07-15T23:10:39Z","message":"[Security
Assistant] `KnowledgeBaseRetrievalTool` and `AskAboutESQLTool` prompt
updates
(#228074)","sha":"9c53a52b48ac41706e77f3f595f4a2d947f97751","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Security
Assistant] `KnowledgeBaseRetrievalTool` and `AskAboutESQLTool` prompt
updates","number":228074,"url":"https://github.com/elastic/kibana/pull/228074","mergeCommit":{"message":"[Security
Assistant] `KnowledgeBaseRetrievalTool` and `AskAboutESQLTool` prompt
updates
(#228074)","sha":"9c53a52b48ac41706e77f3f595f4a2d947f97751"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228074","number":228074,"mergeCommit":{"message":"[Security
Assistant] `KnowledgeBaseRetrievalTool` and `AskAboutESQLTool` prompt
updates (#228074)","sha":"9c53a52b48ac41706e77f3f595f4a2d947f97751"}}]}]
BACKPORT-->

---------

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.19.0 v9.1.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments