kibana/x-pack/solutions
Kenneth Kreindler 686315e62d
[Security Solution] [AI assistant] Global assistant bugs (#225149)
## Summary

Summarize your PR. If it involves visual changes, include a screenshot
or gif.

Fixes various bugs introduced by this PR
https://github.com/elastic/kibana/pull/223936

Changes:
- Fix bug where esql_content_references (citations that open the ESQL
editor) were not working due to the discover plugin not getting imported
to the elastic_assistant plugin. This caused the assistant to crash.
- Fix bug where some buttons in the AI4Soc flavour were not linking to
the correct pages.
https://github.com/elastic/kibana/pull/223936#discussion_r2164506213

### How to test:
#### Verify ESQL citations work:
- Start Kibana
- Create a semantic index and index a document through the dev console:
```
PUT my-index-000001
{
  "mappings": {
    "properties": {
      "description": {
        "type": "semantic_text"
      }
    }
  }
}


# Add a document to my-index
POST /my-index-000001/_doc
{
    "id": "Security threats",
    "title": "Stuxnet",
    "description": "What Made It Special:
Stuxnet was the first known cyber weapon designed to cause physical destruction. It targeted the Iranian nuclear program by infecting uranium enrichment facilities and sabotaging centrifuges."
}
```
- Set up a knowledge base and a knowledge base index in
http://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=knowledge_base
<img width="678" alt="image"
src="https://github.com/user-attachments/assets/a267146e-7973-4723-8c1d-365b8729a28e"
/>

- Open the security AI assistant and ask "What is the Stuxnet computer
virus?"
- Check the response to see if it contains a citation, click on the
citation, and verify the ESQL editor opens.
* If you don't get a citation, ask "What is the Stuxnet computer virus?
Provide me the citation"

#### Verify Ai4Soc buttons in the Security AI assistant link to the
correct pages:
- Start AI4Soc flavor - Create the following file
`config/serverless.security.dev.yml` with this content:
```yml
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]
```
- Start serverless ES
```bash
node scripts/es serverless --projectType security --clean --kill
```
- Start serverless Kibana for security
```bash
node --no-experimental-require-module scripts/kibana --dev --serverless=security --no-base-path
```

- Open the security AI assistant
- Check that clicking on these buttons takes you to the respective pages
(KB settings
`/app/security/configurations/ai_settings?tab=knowledge_base` and AI
settings `/app/security/configurations/ai_settings` ):
<img width="690" alt="image"
src="https://github.com/user-attachments/assets/4e2728e9-8a13-4670-aef4-05b1bdb3fd57"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [X]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [X] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [X] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-27 09:30:23 -05:00
..
chat Remapping iInCircle and questionInCircle and deprecating help icon (#223142) 2025-06-25 14:52:04 -05:00
observability [Obs Onboarding] Add E2E Ensemble test for Firehose flow (#223560) 2025-06-27 14:16:35 +02:00
search chore(NA): bump version to 9.2.0 (#225519) 2025-06-27 03:12:11 +01:00
security [Security Solution] [AI assistant] Global assistant bugs (#225149) 2025-06-27 09:30:23 -05:00